You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by vaskikamal <va...@gmail.com> on 2011/04/26 09:05:28 UTC

Excluding Jars from EAR packaging

Hi, I have a requirement where i want to exclude dependent jars from EAR
packaging and instead use Share Library for the same. For example, please
consider the below dependecy: com.ThirdParty hibernate-core 3.3.1 compile As
you can see, i have mentioned jars having compile scope. I need to make sure
that my project is build successfully without any compilation errors. Also,
once my project is built i need these jars tobe excluded from EAR packaging.
I have tried using *.jar, META-INF/**. But, it packages all the jars in EAR.
Kindly let me know how can i achieve the desired result. Regards Vaski  



--
View this message in context: http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340264.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by Jörg Schaible <jo...@scalaris.com>.
... and the issues list is *always* the wrong list to post anything!

vaskikamal wrote:

> Hi, I have a requirement where i want to exclude dependent jars from EAR
> packaging and instead use Share Library for the same. For example, please
> consider the below dependecy: com.ThirdParty hibernate-core 3.3.1 compile
> As you can see, i have mentioned jars having compile scope. I need to make
> sure that my project is build successfully without any compilation errors.
> Also, once my project is built i need these jars tobe excluded from EAR
> packaging. I have tried using *.jar, META-INF/**. But, it packages all the
> jars in EAR. Kindly let me know how can i achieve the desired result.
> Regards Vaski
> 
> 
> 
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-
tp4340264p4340264.html
> Sent from the Maven - Users mailing list archive at Nabble.com.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by Wayne Fay <wa...@gmail.com>.
>  I applied your suggestion and change the scope to "provided" for below
> mentioned dependency.
...
> Logically, it should have been excluded from EAR packaging. But, it was not.

Make sure you are running "mvn clean package" so leftover Jars from
previous builds are deleted. I bet that will resolve it.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by vaskikamal <va...@gmail.com>.
Hi,

 I have tried the same with little success.

 "earSourceExcludes" excludes the contents from Ear Source Directory but
doesnt exclude it from EAR packaging.


 Regards
Vaski

On Tue, Apr 26, 2011 at 8:18 PM, Sony Antony [via Maven] <
ml-node+4341094-1281017412-201761@n5.nabble.com> wrote:

> Assuming you are using the maven-ear-plugin, did you try
> *earSourceExcludes*<
> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html#earSourceExcludes>
>
> --sony
>
> On Tue, Apr 26, 2011 at 7:18 AM, vaskikamal <[hidden email]<http://user/SendEmail.jtp?type=node&node=4341094&i=0&by-user=t>>
> wrote:
>
> > Hi Anders,
> >  My project is dependent on many thirdparty jars. These jars internally
> > maintain thier own pom.xml.
> >
> >  I applied your suggestion and change the scope to "provided" for below
> > mentioned dependency.
> >
> >  For example, consider the below dependency:
> >         <dependency>
> >            <groupId>com.fairisaac.fidms.ThirdParty</groupId>
> >            <artifactId>dom4j</artifactId>
> >            <version>1.6.1</version>
> >            <scope>provided</scope>
> >        </dependency>
> >
> > Logically, it should have been excluded from EAR packaging. But, it was
> > not.
> >
> > I am unable to understand why its not working.
> >
> > Can some one please guide me in resolving the issue.
> >
> > Regards
> > Vaski
> >
> > --
> > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340680.html<http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340680.html?by-user=t>
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4341094&i=1&by-user=t>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=4341094&i=2&by-user=t>
> >
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4341094.html
>   To unsubscribe from Excluding Jars from EAR packaging, click here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4340264&code=dmFza2lrYW1hbEBnbWFpbC5jb218NDM0MDI2NHwtMTA5MDQ2NTI5Nw==>.
>
>


--
View this message in context: http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4341388.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Excluding Jars from EAR packaging

Posted by Sony Antony <so...@gmail.com>.
Assuming you are using the maven-ear-plugin, did you try
*earSourceExcludes*<http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html#earSourceExcludes>

--sony

On Tue, Apr 26, 2011 at 7:18 AM, vaskikamal <va...@gmail.com> wrote:

> Hi Anders,
>  My project is dependent on many thirdparty jars. These jars internally
> maintain thier own pom.xml.
>
>  I applied your suggestion and change the scope to "provided" for below
> mentioned dependency.
>
>  For example, consider the below dependency:
>         <dependency>
>            <groupId>com.fairisaac.fidms.ThirdParty</groupId>
>            <artifactId>dom4j</artifactId>
>            <version>1.6.1</version>
>            <scope>provided</scope>
>        </dependency>
>
> Logically, it should have been excluded from EAR packaging. But, it was
> not.
>
> I am unable to understand why its not working.
>
> Can some one please guide me in resolving the issue.
>
> Regards
> Vaski
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340680.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Excluding Jars from EAR packaging

Posted by vaskikamal <va...@gmail.com>.
Hi Anders,
  My project is dependent on many thirdparty jars. These jars internally
maintain thier own pom.xml.

  I applied your suggestion and change the scope to "provided" for below
mentioned dependency. 

 For example, consider the below dependency:
         <dependency>
            <groupId>com.fairisaac.fidms.ThirdParty</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
            <scope>provided</scope>
        </dependency>

Logically, it should have been excluded from EAR packaging. But, it was not.

I am unable to understand why its not working.

Can some one please guide me in resolving the issue.

Regards
Vaski

--
View this message in context: http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340680.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by vaskikamal <va...@gmail.com>.
Besides, i want to make sure all JARs which are currently packaged inside EAR
should be excluded. There are many internal jars which are required at
compile time.

How can i achieve the same?

ANy inputs will be highly appreciated.


Thanks in advance.
Vaski

--
View this message in context: http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340522.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by vaskikamal <va...@gmail.com>.
Hi,
 I have tried your suggestion but still the jar is appearing in EAR
packaging. ANy reason for the same.
 
I have the belo wmentioned understanding for "provided" scope.
"For example, when building a web application for the Java Enterprise
Edition, you would set the dependency on the Servlet API and related Java EE
APIs to scope provided because the web container provides those classes.
This scope is only available on the compilation and test classpath, and is
not transitive."

Suppose if i give "provided" scope to all the jars, will my code compile
properly as they wont be provided by JDK or JAVA EE API's.


Regards
Vaski

--
View this message in context: http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340515.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Excluding Jars from EAR packaging

Posted by Anders Hammar <an...@hammar.net>.
Specify scope as "provided" for those dependencies that you expect to be
made available by the container.

/Anders

On Tue, Apr 26, 2011 at 09:05, vaskikamal <va...@gmail.com> wrote:

> Hi, I have a requirement where i want to exclude dependent jars from EAR
> packaging and instead use Share Library for the same. For example, please
> consider the below dependecy: com.ThirdParty hibernate-core 3.3.1 compile
> As
> you can see, i have mentioned jars having compile scope. I need to make
> sure
> that my project is build successfully without any compilation errors. Also,
> once my project is built i need these jars tobe excluded from EAR
> packaging.
> I have tried using *.jar, META-INF/**. But, it packages all the jars in
> EAR.
> Kindly let me know how can i achieve the desired result. Regards Vaski
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Excluding-Jars-from-EAR-packaging-tp4340264p4340264.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>