You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jiangshachina <ji...@gmail.com> on 2006/11/02 09:17:52 UTC

Too many jars added to lib?

Hello,
My web projects needs Apache commons-configuration.
I added commons-configuration to my dependency.
After run "mvn package", too many jar files were added into WEB-INF/lib
directory.
But I found many jars(e.g. xalan-2.7.0.jar) out of the list, which lists
commons-configuration's runtime dependencies, shown at home of
commons-collections.
In commons-configuration-1.2.pom, so many dependencies are added.

How to cancel the trouble?

a cup of Java, cheers!
Sha Jiang 
-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7129441
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear Wayne,
> You can certainly do "whatever you want" to your local repo, including
> "moving" artifacts to a new groupId and modifying the pom.xml files to
> suit your needs.
I also think I have the free :D

> Changing the groupId is not entirely uncommon -- sometimes you need to
> build a release of your own project but depend on a SNAPSHOT, and
> can't wait for a formal release of their code, so you release your own
> internal non-Snapshot version of the code under your own groupId. Or
> perhaps you have your own modifications to some open source code
> library and so you literally have a different artifact than what is
>being delivered by Central.
But I think my idea is uncommon :)
The idea would make my local repository to stand alone mostly.
Namely, I don't need Maven central repository(except for plugins).

a cup of Java, cheers!
Sha Jiang


Wayne Fay wrote:
> 
> You can certainly do "whatever you want" to your local repo, including
> "moving" artifacts to a new groupId and modifying the pom.xml files to
> suit your needs.
> 
> Changing the groupId is not entirely uncommon -- sometimes you need to
> build a release of your own project but depend on a SNAPSHOT, and
> can't wait for a formal release of their code, so you release your own
> internal non-Snapshot version of the code under your own groupId. Or
> perhaps you have your own modifications to some open source code
> library and so you literally have a different artifact than what is
> being delivered by Central.
> 
> Wayne
> 
> On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
>>
>> Hello,
>> I have an idea, can I install jar files to local repository, and don't
>> use
>> the artifacts at central repository?
>> I just use different groupId, but artifactId and version aren't changed.
>> Namely, before start a project, I install the dependencies firstly.
>> Because I exactly know which jar is my want, then I can set dependencies
>> exactly.
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>>
>> jiangshachina wrote:
>> >
>> > Dear Wayne,
>> > I have encountered some of the reasons you gave.
>> > But the reason why I release the topic is very simple :D
>> > I just think so many jar files are put at WEB-INF/lib would confused
>> > somebody.
>> > He/She would be puzzled why some many jars were used.
>> > And some of the files aren't associate with the project obviously.
>> >
>> > Additionally, according to the discussion, some files can be excluded
>> > surely.
>> > It means that the jars are not needed in runtime time(say nothing of
>> > compile time).
>> > Why the artifacts are at dependency element?
>> > I think the setting can be erased from the pom file. Or have other
>> > reasons?
>> >
>> > a cup of Java, cheers!
>> > Sha Jiang
>> >
>> >
>> > Wayne Fay wrote:
>> >>
>> >> There are numerous reasons for why you might want to exclude some
>> >> dependencies of dependencies... Here are a few:
>> >>
>> >> 1. New version of artifact is available which is not automatically
>> >> being found and used instead of the old version, resulting in 2 copies
>> >> of the artifact with different versions attached.
>> >> 2. GroupID of artifact has changed, resulting in 2 copies of the
>> >> artifact with different versions attached.
>> >> 3. An API which might have multiple vendors -- ie Sun API which
>> >> requires click-wrap licensing and manual install into repo vs CDDL/GNU
>> >> licensed version of the same API which is freely available in the
>> >> repo.
>> >> 4. An artifact that should have been marked optional but was not.
>> >> 5. An artifact which is provided by your runtime container thus should
>> >> not be included with your build.
>> >>
>> >> I'm sure there are many more reasons to use <excludes>, but these are
>> >> a few I've run into myself in the last few months...
>> >>
>> >> Wayne
>> >>
>> >> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
>> >>>
>> >>> Automatically importing dependencies of dependencies is a great
>> feature.
>> >>> But users have to know the dependency hierarchy, or we cannot exclude
>> >>> the
>> >>> artifacts exactly.
>> >>>
>> >>> And I'm puzzled that why can exclude some dependencies of
>> dependencies?
>> >>> If a jar(artifact) is a dependency of our project's direct
>> dependency,
>> >>> it
>> >>> means that we need it, but exclude it?
>> >>>
>> >>> a cup of Java, cheers!
>> >>> Sha Jiang
>> >>>
>> >>>
>> >>> struberg wrote:
>> >>> >
>> >>> > there is a syntax to exclude some transitive
>> >>> > dependencies from the dependency-list:
>> >>> >
>> >>> > a small sample:
>> >>> >     <dependency>
>> >>> >       <groupId>avalon-framework</groupId>
>> >>> >       <artifactId>avalon-framework-api</artifactId>
>> >>> >       <version>4.3</version>
>> >>> >       <exclusions>
>> >>> >         <exclusion>
>> >>> >           <groupId>avalon-logkit</groupId>
>> >>> >           <artifactId>avalon-logkit</artifactId>
>> >>> >         </exclusion>
>> >>> >       </exclusions>
>> >>> >     </dependency>
>> >>> >
>> >>> > I guess this may solve your problems.
>> >>> >
>> >>> > best regards,
>> >>> > strub
>> >>> >
>> >>> > --- Dmystery <De...@infosys.com> schrieb:
>> >>> >
>> >>> >>
>> >>> >> This should definitely remove all the unwanted
>> >>> >> dependencies. Even if they are
>> >>> >> dependencies of a dependency. I'm doing the same
>> >>> >> thing to remove all the
>> >>> >> unwanted files.
>> >>> >> Can you post your pom.xml?
>> >>> >>
>> >>> >> jiangshachina wrote:
>> >>> >> >
>> >>> >> > Hi Dmystery,
>> >>> >> > Thanks for your help.
>> >>> >> >
>> >>> >> > I'm sorry that I cannot success with your
>> >>> >> instructions.
>> >>> >> > And I also read the guide on maven-war-plugin,
>> >>> >> especially at
>> >>> >> >
>> >>> >>
>> >>> >
>> >>>
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> >>> >> > Unfortunately, I don't find the answer.
>> >>> >> >
>> >>> >> > The guide is on how to add or filter resources
>> >>> >> from standard/customized
>> >>> >> > resource paths.
>> >>> >> > But it's not on how to filter resources from the
>> >>> >> dependencies of
>> >>> >> > dependencies.
>> >>> >> >
>> >>> >> > a cup of Java, cheers!
>> >>> >> > Sha Jiang
>> >>> >> >
>> >>> >> >
>> >>> >> > Dmystery wrote:
>> >>> >> >>
>> >>> >> >> Use maven-war-plugin. Due to transitive
>> >>> >> dependencies in M2, you need to
>> >>> >> >> remove them using the <warSourceExcludes> tag in
>> >>> >> the plugin as below.
>> >>> >> >>
>> >>> >> >>   <build>
>> >>> >> >>    <plugins>
>> >>> >> >>     <plugin>
>> >>> >> >>      <groupId>org.apache.maven.plugins</groupId>
>> >>> >> >>      <artifactId>maven-war-plugin</artifactId>
>> >>> >> >>      <version>2.0.1</version>
>> >>> >> >>      <configuration>
>> >>> >> >> 	 <warSourceExcludes>
>> >>> >> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>> >>> >> >>  	</warSourceExcludes>
>> >>> >> >>      </configuration>
>> >>> >> >>     </plugin>
>> >>> >> >>    </plugins>
>> >>> >> >>   </build>
>> >>> >> >>
>> >>> >> >> Checkout :
>> >>> >>
>> >>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
>> >>> >> >>
>> >>> >> >>
>> >>> >> >> jiangshachina wrote:
>> >>> >> >>>
>> >>> >> >>> I have another question.
>> >>> >> >>> In Web application project, generally, class
>> >>> >> files would be located at
>> >>> >> >>> WEB-INF/classes.
>> >>> >> >>> But now, I want they to be archived, and locate
>> >>> >> at WEB-INF/lib.
>> >>> >> >>>
>> >>> >> >>> And I want the jars could be put into different
>> >>> >> sub-directory under
>> >>> >> >>> WEB-INF/lib?
>> >>> >> >>>
>> >>> >> >>> maven-jar-plugin or maven-war-plugin can help
>> >>> >> me?
>> >>> >> >>> How can I do?
>> >>> >> >>>
>> >>> >> >>>
>> >>> >> >>> jiangshachina wrote:
>> >>> >> >>>>
>> >>> >> >>>> Hello,
>> >>> >> >>>> My web projects needs Apache
>> >>> >> commons-configuration.
>> >>> >> >>>> I added commons-configuration to my dependency.
>> >>> >> >>>> After run "mvn package", too many jar files
>> >>> >> were added into WEB-INF/lib
>> >>> >> >>>> directory.
>> >>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>> >>> >> of the list, which
>> >>> >> >>>> lists commons-configuration's runtime
>> >>> >> dependencies, shown at home of
>> >>> >> >>>> commons-collections.
>> >>> >> >>>> In commons-configuration-1.2.pom, so many
>> >>> >> dependencies are added.
>> >>> >> >>>>
>> >>> >> >>>> How to cancel the trouble?
>> >>> >> >>>>
>> >>> >> >>>> a cup of Java, cheers!
>> >>> >> >>>> Sha Jiang
>> >>> >> >>>>
>> >>> >> >>>
>> >>> >> >>>
>> >>> >> >>
>> >>> >> >>
>> >>> >> >
>> >>> >> >
>> >>> >>
>> >>> >> --
>> >>> >> View this message in context:
>> >>> >>
>> >>> >
>> >>>
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>> >>> >> 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
>> >>> >>
>> >>> >>
>> >>> >
>> >>> >
>> >>> >
>> >>> > 		
>> >>> > ___________________________________________________________
>> >>> > Telefonate ohne weitere Kosten vom PC zum PC:
>> >>> http://messenger.yahoo.de
>> >>> >
>> >>> >
>> ---------------------------------------------------------------------
>> >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>> > For additional commands, e-mail: users-help@maven.apache.org
>> >>> >
>> >>> >
>> >>> >
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
>> >>> 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
>> >>>
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7254900
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear Wendy,
Thanks for your reply and suggestions.
My organization just cared Maven recently, we may use it in real project in
the future(not long).
But now, many topics aren't on calendar currently, for instance, we haven't
our own remote repository.
Of course, my co-works and me will focus on Maven continuously.
All will be OK, I'm sure of that.
Thanks!

a cup of Java, cheers!
Sha Jiang


Wendy Smoak-3 wrote:
> 
> On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
> 
>> Undoubtedly, Maven central repository is crucial.
>> My question just be why so many unessential artifacts are added to pom?
>> May there are "some reasons" I don't know.
> 
> The usual case is that the project in question is not using Maven, so
> the developers don't realize what happens when they leave all of their
> dependencies in the default (compile) scope.
> 
> If you can identify the pom that's causing the problem, it's usually
> possible to work with the developers of that project to correct it for
> the next release.
> 
> To correct the problem you're having now, I suggest correcting the
> poms in your internal corporate repository.  (IMO, proxying the
> central repo internally is a good idea for several reasons, including
> including gaining control of the artifacts you're using and reducing
> traffic at the central repo.)
> 
> -- 
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7270671
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: Too many jars added to lib?

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/28/06, Dário Oliveros <ol...@cpqd.com.br> wrote:

> I've been facing the same issue with apache commons configuration.
> I've checked its source repository at apache and noticed this component was
> being generated by maven 1. And that might be the reason its pom at central
> repository has some many compile dependencies since compile is the default
> scope in maven 2.
> I think it's really important to get it fixed at the central repository to
> avoid excluding unnecessary dependencies every time a sort of packaging is
> needed.
> What would be the steps to get it updated at ibiblio ? Whom should I contact
> ? commons configuration developers or an ibiblio administrator ?

The current policy seems to be that released poms will not be changed.
 So, the Commons Configuration developers would need to fix it and do
another release.

Here's the Commons Configuration project.xml file:
http://svn.apache.org/repos/asf/jakarta/commons/proper/configuration/trunk/project.xml

It looks like the problem you describe has been fixed, I see a lot of
test scope and at least one optional dependency.  (The properties will
be converted to the appropriate elements for pom.xml in the Maven 2
repository.)  If you see any more that need to be fixed, you can
submit a patch in their issue tracker.

-- 
Wendy

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


Re: Too many jars added to lib?

Posted by Dário Oliveros <ol...@cpqd.com.br>.
I've been facing the same issue with apache commons configuration.
I've checked its source repository at apache and noticed this component was
being generated by maven 1. And that might be the reason its pom at central
repository has some many compile dependencies since compile is the default
scope in maven 2.
I think it's really important to get it fixed at the central repository to
avoid excluding unnecessary dependencies every time a sort of packaging is
needed.
What would be the steps to get it updated at ibiblio ? Whom should I contact
? commons configuration developers or an ibiblio administrator ?
Thanks,
Dário



Wendy Smoak-3 wrote:
> 
> On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
> 
>> Undoubtedly, Maven central repository is crucial.
>> My question just be why so many unessential artifacts are added to pom?
>> May there are "some reasons" I don't know.
> 
> The usual case is that the project in question is not using Maven, so
> the developers don't realize what happens when they leave all of their
> dependencies in the default (compile) scope.
> 
> If you can identify the pom that's causing the problem, it's usually
> possible to work with the developers of that project to correct it for
> the next release.
> 
> To correct the problem you're having now, I suggest correcting the
> poms in your internal corporate repository.  (IMO, proxying the
> central repo internally is a good idea for several reasons, including
> including gaining control of the artifacts you're using and reducing
> traffic at the central repo.)
> 
> -- 
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a8077263
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: Too many jars added to lib?

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/9/06, jiangshachina <ji...@gmail.com> wrote:

> Undoubtedly, Maven central repository is crucial.
> My question just be why so many unessential artifacts are added to pom?
> May there are "some reasons" I don't know.

The usual case is that the project in question is not using Maven, so
the developers don't realize what happens when they leave all of their
dependencies in the default (compile) scope.

If you can identify the pom that's causing the problem, it's usually
possible to work with the developers of that project to correct it for
the next release.

To correct the problem you're having now, I suggest correcting the
poms in your internal corporate repository.  (IMO, proxying the
central repo internally is a good idea for several reasons, including
including gaining control of the artifacts you're using and reducing
traffic at the central repo.)

-- 
Wendy

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


Re: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear friends,
I really don't want to "miss the boat on Maven".
If cut the connection between Maven and my local repository, I'll miss some
benefits provided by Maven.

For example, I want to use Apache commons-configuration as dependency.
[1]I just re-install all jars simply, and don't enhance theire pom files.
Then I have to set commons-lang, commons-collections ... as dependencies
manually. But with Maven central repository, I just need set
commons-configuration as dependency, Maven would reference to other related
artifacts automatically, since the pom of commons-configuration indicates
the relation.
[2]I re-install all jars, and enhance thiere pom files. The poms exactly set
dependency relation. Of course, then I can use this commons-configuration as
the same as that in Maven central repository. But it's duplicate work, which
isn't my want.

Undoubtedly, Maven central repository is crucial.
My question just be why so many unessential artifacts are added to pom? 
May there are "some reasons" I don't know.
Thanks!

a cup of Java, cheers!
Sha Jiang


Wayne Fay wrote:
> 
> I certainly am not using any custom local repo w/custom artifacts etc
> except in extremely rare cases, and I really don't think anyone else
> should either just because it will be a management nightmare IMO.
> 
> Someone else posted some similar questions/problems about a month or
> so ago -- it seems they had completely missed the boat on Maven
> automatically downloading and installing dependencies etc and had
> actually built out their own repo with artifacts under their own
> groupIds with modified poms etc. And then they started running into
> some problems... It sounded like hell to me and my suggestion was to
> throw it all away, RTFM and start over from scratch.
> 
> But I'm happy to help Sha configure things as their organization
> requires... even if I think its a bad idea personally. Maven gives you
> enough rope to hang yourself, if you work hard at it and really want
> to.
> 
> Wayne
> 
> On 11/9/06, Barrett Nuzum <Ba...@valtech.com> wrote:
>> Sha & Wayne:
>>
>> I would propose that a better idea would be that once things have been
>> installed in your local repository, to change your settings.xml to
>> <offline>true</offline>.
>>
>> That way you have limited your local repository to a desired set of
>> artifacts, but still can reconnect up or upgrade without changing all
>> your
>> groupIds, when the time comes. (... for it certainly will.)
>>
>> Barrett
>>
>> Barrett Nuzum
>> Consultant, Skill Development
>> barrett.nuzum@valtech.com
>> T:  +1 (918) 640 4414
>> F:  +1 (972) 789 1340
>>
>>
>> Valtech
>> 5080 Spectrum Drive Suite 700 West
>> Addison, Texas 75001
>> USA
>> T: +1 (972) 789 1200
>>
>> ________________________________
>>
>> From: Wayne Fay [mailto:waynefay@gmail.com]
>> Sent: Thu 11/9/2006 2:41 AM
>> To: Maven Users List
>> Subject: Re: Too many jars added to lib?
>>
>>
>>
>> You can certainly do "whatever you want" to your local repo, including
>> "moving" artifacts to a new groupId and modifying the pom.xml files to
>> suit your needs.
>>
>> Changing the groupId is not entirely uncommon -- sometimes you need to
>> build a release of your own project but depend on a SNAPSHOT, and
>> can't wait for a formal release of their code, so you release your own
>> internal non-Snapshot version of the code under your own groupId. Or
>> perhaps you have your own modifications to some open source code
>> library and so you literally have a different artifact than what is
>> being delivered by Central.
>>
>> Wayne
>>
>> On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
>> >
>> > Hello,
>> > I have an idea, can I install jar files to local repository, and don't
>> use
>> > the artifacts at central repository?
>> > I just use different groupId, but artifactId and version aren't
>> changed.
>> > Namely, before start a project, I install the dependencies firstly.
>> > Because I exactly know which jar is my want, then I can set
>> dependencies
>> > exactly.
>> >
>> > a cup of Java, cheers!
>> > Sha Jiang
>> >
>> >
>> > jiangshachina wrote:
>> > >
>> > > Dear Wayne,
>> > > I have encountered some of the reasons you gave.
>> > > But the reason why I release the topic is very simple :D
>> > > I just think so many jar files are put at WEB-INF/lib would confused
>> > > somebody.
>> > > He/She would be puzzled why some many jars were used.
>> > > And some of the files aren't associate with the project obviously.
>> > >
>> > > Additionally, according to the discussion, some files can be excluded
>> > > surely.
>> > > It means that the jars are not needed in runtime time(say nothing of
>> > > compile time).
>> > > Why the artifacts are at dependency element?
>> > > I think the setting can be erased from the pom file. Or have other
>> > > reasons?
>> > >
>> > > a cup of Java, cheers!
>> > > Sha Jiang
>> > >
>> > >
>> > > Wayne Fay wrote:
>> > >>
>> > >> There are numerous reasons for why you might want to exclude some
>> > >> dependencies of dependencies... Here are a few:
>> > >>
>> > >> 1. New version of artifact is available which is not automatically
>> > >> being found and used instead of the old version, resulting in 2
>> copies
>> > >> of the artifact with different versions attached.
>> > >> 2. GroupID of artifact has changed, resulting in 2 copies of the
>> > >> artifact with different versions attached.
>> > >> 3. An API which might have multiple vendors -- ie Sun API which
>> > >> requires click-wrap licensing and manual install into repo vs
>> CDDL/GNU
>> > >> licensed version of the same API which is freely available in the
>> > >> repo.
>> > >> 4. An artifact that should have been marked optional but was not.
>> > >> 5. An artifact which is provided by your runtime container thus
>> should
>> > >> not be included with your build.
>> > >>
>> > >> I'm sure there are many more reasons to use <excludes>, but these
>> are
>> > >> a few I've run into myself in the last few months...
>> > >>
>> > >> Wayne
>> > >>
>> > >> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
>> > >>>
>> > >>> Automatically importing dependencies of dependencies is a great
>> feature.
>> > >>> But users have to know the dependency hierarchy, or we cannot
>> exclude
>> > >>> the
>> > >>> artifacts exactly.
>> > >>>
>> > >>> And I'm puzzled that why can exclude some dependencies of
>> dependencies?
>> > >>> If a jar(artifact) is a dependency of our project's direct
>> dependency,
>> > >>> it
>> > >>> means that we need it, but exclude it?
>> > >>>
>> > >>> a cup of Java, cheers!
>> > >>> Sha Jiang
>> > >>>
>> > >>>
>> > >>> struberg wrote:
>> > >>> >
>> > >>> > there is a syntax to exclude some transitive
>> > >>> > dependencies from the dependency-list:
>> > >>> >
>> > >>> > a small sample:
>> > >>> >     <dependency>
>> > >>> >       <groupId>avalon-framework</groupId>
>> > >>> >       <artifactId>avalon-framework-api</artifactId>
>> > >>> >       <version>4.3</version>
>> > >>> >       <exclusions>
>> > >>> >         <exclusion>
>> > >>> >           <groupId>avalon-logkit</groupId>
>> > >>> >           <artifactId>avalon-logkit</artifactId>
>> > >>> >         </exclusion>
>> > >>> >       </exclusions>
>> > >>> >     </dependency>
>> > >>> >
>> > >>> > I guess this may solve your problems.
>> > >>> >
>> > >>> > best regards,
>> > >>> > strub
>> > >>> >
>> > >>> > --- Dmystery <De...@infosys.com> schrieb:
>> > >>> >
>> > >>> >>
>> > >>> >> This should definitely remove all the unwanted
>> > >>> >> dependencies. Even if they are
>> > >>> >> dependencies of a dependency. I'm doing the same
>> > >>> >> thing to remove all the
>> > >>> >> unwanted files.
>> > >>> >> Can you post your pom.xml?
>> > >>> >>
>> > >>> >> jiangshachina wrote:
>> > >>> >> >
>> > >>> >> > Hi Dmystery,
>> > >>> >> > Thanks for your help.
>> > >>> >> >
>> > >>> >> > I'm sorry that I cannot success with your
>> > >>> >> instructions.
>> > >>> >> > And I also read the guide on maven-war-plugin,
>> > >>> >> especially at
>> > >>> >> >
>> > >>> >>
>> > >>> >
>> > >>>
>> >
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> > >>> >> > Unfortunately, I don't find the answer.
>> > >>> >> >
>> > >>> >> > The guide is on how to add or filter resources
>> > >>> >> from standard/customized
>> > >>> >> > resource paths.
>> > >>> >> > But it's not on how to filter resources from the
>> > >>> >> dependencies of
>> > >>> >> > dependencies.
>> > >>> >> >
>> > >>> >> > a cup of Java, cheers!
>> > >>> >> > Sha Jiang
>> > >>> >> >
>> > >>> >> >
>> > >>> >> > Dmystery wrote:
>> > >>> >> >>
>> > >>> >> >> Use maven-war-plugin. Due to transitive
>> > >>> >> dependencies in M2, you need to
>> > >>> >> >> remove them using the <warSourceExcludes> tag in
>> > >>> >> the plugin as below.
>> > >>> >> >>
>> > >>> >> >>   <build>
>> > >>> >> >>    <plugins>
>> > >>> >> >>     <plugin>
>> > >>> >> >>      <groupId>org.apache.maven.plugins</groupId>
>> > >>> >> >>      <artifactId>maven-war-plugin</artifactId>
>> > >>> >> >>      <version>2.0.1</version>
>> > >>> >> >>      <configuration>
>> > >>> >> >>      <warSourceExcludes>
>> > >>> >> >>             WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>> > >>> >> >>     </warSourceExcludes>
>> > >>> >> >>      </configuration>
>> > >>> >> >>     </plugin>
>> > >>> >> >>    </plugins>
>> > >>> >> >>   </build>
>> > >>> >> >>
>> > >>> >> >> Checkout :
>> > >>> >>
>> > >>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
>> > >>> >> >>
>> > >>> >> >>
>> > >>> >> >> jiangshachina wrote:
>> > >>> >> >>>
>> > >>> >> >>> I have another question.
>> > >>> >> >>> In Web application project, generally, class
>> > >>> >> files would be located at
>> > >>> >> >>> WEB-INF/classes.
>> > >>> >> >>> But now, I want they to be archived, and locate
>> > >>> >> at WEB-INF/lib.
>> > >>> >> >>>
>> > >>> >> >>> And I want the jars could be put into different
>> > >>> >> sub-directory under
>> > >>> >> >>> WEB-INF/lib?
>> > >>> >> >>>
>> > >>> >> >>> maven-jar-plugin or maven-war-plugin can help
>> > >>> >> me?
>> > >>> >> >>> How can I do?
>> > >>> >> >>>
>> > >>> >> >>>
>> > >>> >> >>> jiangshachina wrote:
>> > >>> >> >>>>
>> > >>> >> >>>> Hello,
>> > >>> >> >>>> My web projects needs Apache
>> > >>> >> commons-configuration.
>> > >>> >> >>>> I added commons-configuration to my dependency.
>> > >>> >> >>>> After run "mvn package", too many jar files
>> > >>> >> were added into WEB-INF/lib
>> > >>> >> >>>> directory.
>> > >>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>> > >>> >> of the list, which
>> > >>> >> >>>> lists commons-configuration's runtime
>> > >>> >> dependencies, shown at home of
>> > >>> >> >>>> commons-collections.
>> > >>> >> >>>> In commons-configuration-1.2.pom, so many
>> > >>> >> dependencies are added.
>> > >>> >> >>>>
>> > >>> >> >>>> How to cancel the trouble?
>> > >>> >> >>>>
>> > >>> >> >>>> a cup of Java, cheers!
>> > >>> >> >>>> Sha Jiang
>> > >>> >> >>>>
>> > >>> >> >>>
>> > >>> >> >>>
>> > >>> >> >>
>> > >>> >> >>
>> > >>> >> >
>> > >>> >> >
>> > >>> >>
>> > >>> >> --
>> > >>> >> View this message in context:
>> > >>> >>
>> > >>> >
>> > >>>
>> >
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>> > >>> >> 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
>> > >>> >>
>> > >>> >>
>> > >>> >
>> > >>> >
>> > >>> >
>> > >>> >
>> > >>> > ___________________________________________________________
>> > >>> > Telefonate ohne weitere Kosten vom PC zum PC:
>> > >>> http://messenger.yahoo.de
>> > >>> >
>> > >>> >
>> ---------------------------------------------------------------------
>> > >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > >>> > For additional commands, e-mail: users-help@maven.apache.org
>> > >>> >
>> > >>> >
>> > >>> >
>> > >>>
>> > >>> --
>> > >>> View this message in context:
>> > >>>
>> >
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
>> > >>> 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
>> > >>>
>> > >>>
>> > >>
>> > >>
>> ---------------------------------------------------------------------
>> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > >> For additional commands, e-mail: users-help@maven.apache.org
>> > >>
>> > >>
>> > >>
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
>> > 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
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7270395
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: Too many jars added to lib?

Posted by Wayne Fay <wa...@gmail.com>.
I certainly am not using any custom local repo w/custom artifacts etc
except in extremely rare cases, and I really don't think anyone else
should either just because it will be a management nightmare IMO.

Someone else posted some similar questions/problems about a month or
so ago -- it seems they had completely missed the boat on Maven
automatically downloading and installing dependencies etc and had
actually built out their own repo with artifacts under their own
groupIds with modified poms etc. And then they started running into
some problems... It sounded like hell to me and my suggestion was to
throw it all away, RTFM and start over from scratch.

But I'm happy to help Sha configure things as their organization
requires... even if I think its a bad idea personally. Maven gives you
enough rope to hang yourself, if you work hard at it and really want
to.

Wayne

On 11/9/06, Barrett Nuzum <Ba...@valtech.com> wrote:
> Sha & Wayne:
>
> I would propose that a better idea would be that once things have been
> installed in your local repository, to change your settings.xml to
> <offline>true</offline>.
>
> That way you have limited your local repository to a desired set of
> artifacts, but still can reconnect up or upgrade without changing all your
> groupIds, when the time comes. (... for it certainly will.)
>
> Barrett
>
> Barrett Nuzum
> Consultant, Skill Development
> barrett.nuzum@valtech.com
> T:  +1 (918) 640 4414
> F:  +1 (972) 789 1340
>
>
> Valtech
> 5080 Spectrum Drive Suite 700 West
> Addison, Texas 75001
> USA
> T: +1 (972) 789 1200
>
> ________________________________
>
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Thu 11/9/2006 2:41 AM
> To: Maven Users List
> Subject: Re: Too many jars added to lib?
>
>
>
> You can certainly do "whatever you want" to your local repo, including
> "moving" artifacts to a new groupId and modifying the pom.xml files to
> suit your needs.
>
> Changing the groupId is not entirely uncommon -- sometimes you need to
> build a release of your own project but depend on a SNAPSHOT, and
> can't wait for a formal release of their code, so you release your own
> internal non-Snapshot version of the code under your own groupId. Or
> perhaps you have your own modifications to some open source code
> library and so you literally have a different artifact than what is
> being delivered by Central.
>
> Wayne
>
> On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
> >
> > Hello,
> > I have an idea, can I install jar files to local repository, and don't use
> > the artifacts at central repository?
> > I just use different groupId, but artifactId and version aren't changed.
> > Namely, before start a project, I install the dependencies firstly.
> > Because I exactly know which jar is my want, then I can set dependencies
> > exactly.
> >
> > a cup of Java, cheers!
> > Sha Jiang
> >
> >
> > jiangshachina wrote:
> > >
> > > Dear Wayne,
> > > I have encountered some of the reasons you gave.
> > > But the reason why I release the topic is very simple :D
> > > I just think so many jar files are put at WEB-INF/lib would confused
> > > somebody.
> > > He/She would be puzzled why some many jars were used.
> > > And some of the files aren't associate with the project obviously.
> > >
> > > Additionally, according to the discussion, some files can be excluded
> > > surely.
> > > It means that the jars are not needed in runtime time(say nothing of
> > > compile time).
> > > Why the artifacts are at dependency element?
> > > I think the setting can be erased from the pom file. Or have other
> > > reasons?
> > >
> > > a cup of Java, cheers!
> > > Sha Jiang
> > >
> > >
> > > Wayne Fay wrote:
> > >>
> > >> There are numerous reasons for why you might want to exclude some
> > >> dependencies of dependencies... Here are a few:
> > >>
> > >> 1. New version of artifact is available which is not automatically
> > >> being found and used instead of the old version, resulting in 2 copies
> > >> of the artifact with different versions attached.
> > >> 2. GroupID of artifact has changed, resulting in 2 copies of the
> > >> artifact with different versions attached.
> > >> 3. An API which might have multiple vendors -- ie Sun API which
> > >> requires click-wrap licensing and manual install into repo vs CDDL/GNU
> > >> licensed version of the same API which is freely available in the
> > >> repo.
> > >> 4. An artifact that should have been marked optional but was not.
> > >> 5. An artifact which is provided by your runtime container thus should
> > >> not be included with your build.
> > >>
> > >> I'm sure there are many more reasons to use <excludes>, but these are
> > >> a few I've run into myself in the last few months...
> > >>
> > >> Wayne
> > >>
> > >> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
> > >>>
> > >>> Automatically importing dependencies of dependencies is a great
> feature.
> > >>> But users have to know the dependency hierarchy, or we cannot exclude
> > >>> the
> > >>> artifacts exactly.
> > >>>
> > >>> And I'm puzzled that why can exclude some dependencies of
> dependencies?
> > >>> If a jar(artifact) is a dependency of our project's direct dependency,
> > >>> it
> > >>> means that we need it, but exclude it?
> > >>>
> > >>> a cup of Java, cheers!
> > >>> Sha Jiang
> > >>>
> > >>>
> > >>> struberg wrote:
> > >>> >
> > >>> > there is a syntax to exclude some transitive
> > >>> > dependencies from the dependency-list:
> > >>> >
> > >>> > a small sample:
> > >>> >     <dependency>
> > >>> >       <groupId>avalon-framework</groupId>
> > >>> >       <artifactId>avalon-framework-api</artifactId>
> > >>> >       <version>4.3</version>
> > >>> >       <exclusions>
> > >>> >         <exclusion>
> > >>> >           <groupId>avalon-logkit</groupId>
> > >>> >           <artifactId>avalon-logkit</artifactId>
> > >>> >         </exclusion>
> > >>> >       </exclusions>
> > >>> >     </dependency>
> > >>> >
> > >>> > I guess this may solve your problems.
> > >>> >
> > >>> > best regards,
> > >>> > strub
> > >>> >
> > >>> > --- Dmystery <De...@infosys.com> schrieb:
> > >>> >
> > >>> >>
> > >>> >> This should definitely remove all the unwanted
> > >>> >> dependencies. Even if they are
> > >>> >> dependencies of a dependency. I'm doing the same
> > >>> >> thing to remove all the
> > >>> >> unwanted files.
> > >>> >> Can you post your pom.xml?
> > >>> >>
> > >>> >> jiangshachina wrote:
> > >>> >> >
> > >>> >> > Hi Dmystery,
> > >>> >> > Thanks for your help.
> > >>> >> >
> > >>> >> > I'm sorry that I cannot success with your
> > >>> >> instructions.
> > >>> >> > And I also read the guide on maven-war-plugin,
> > >>> >> especially at
> > >>> >> >
> > >>> >>
> > >>> >
> > >>>
> >
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> > >>> >> > Unfortunately, I don't find the answer.
> > >>> >> >
> > >>> >> > The guide is on how to add or filter resources
> > >>> >> from standard/customized
> > >>> >> > resource paths.
> > >>> >> > But it's not on how to filter resources from the
> > >>> >> dependencies of
> > >>> >> > dependencies.
> > >>> >> >
> > >>> >> > a cup of Java, cheers!
> > >>> >> > Sha Jiang
> > >>> >> >
> > >>> >> >
> > >>> >> > Dmystery wrote:
> > >>> >> >>
> > >>> >> >> Use maven-war-plugin. Due to transitive
> > >>> >> dependencies in M2, you need to
> > >>> >> >> remove them using the <warSourceExcludes> tag in
> > >>> >> the plugin as below.
> > >>> >> >>
> > >>> >> >>   <build>
> > >>> >> >>    <plugins>
> > >>> >> >>     <plugin>
> > >>> >> >>      <groupId>org.apache.maven.plugins</groupId>
> > >>> >> >>      <artifactId>maven-war-plugin</artifactId>
> > >>> >> >>      <version>2.0.1</version>
> > >>> >> >>      <configuration>
> > >>> >> >>      <warSourceExcludes>
> > >>> >> >>             WEB-INF/lib/jar1,WEB-INF/lib/jar2,
> > >>> >> >>     </warSourceExcludes>
> > >>> >> >>      </configuration>
> > >>> >> >>     </plugin>
> > >>> >> >>    </plugins>
> > >>> >> >>   </build>
> > >>> >> >>
> > >>> >> >> Checkout :
> > >>> >>
> > >>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
> > >>> >> >>
> > >>> >> >>
> > >>> >> >> jiangshachina wrote:
> > >>> >> >>>
> > >>> >> >>> I have another question.
> > >>> >> >>> In Web application project, generally, class
> > >>> >> files would be located at
> > >>> >> >>> WEB-INF/classes.
> > >>> >> >>> But now, I want they to be archived, and locate
> > >>> >> at WEB-INF/lib.
> > >>> >> >>>
> > >>> >> >>> And I want the jars could be put into different
> > >>> >> sub-directory under
> > >>> >> >>> WEB-INF/lib?
> > >>> >> >>>
> > >>> >> >>> maven-jar-plugin or maven-war-plugin can help
> > >>> >> me?
> > >>> >> >>> How can I do?
> > >>> >> >>>
> > >>> >> >>>
> > >>> >> >>> jiangshachina wrote:
> > >>> >> >>>>
> > >>> >> >>>> Hello,
> > >>> >> >>>> My web projects needs Apache
> > >>> >> commons-configuration.
> > >>> >> >>>> I added commons-configuration to my dependency.
> > >>> >> >>>> After run "mvn package", too many jar files
> > >>> >> were added into WEB-INF/lib
> > >>> >> >>>> directory.
> > >>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
> > >>> >> of the list, which
> > >>> >> >>>> lists commons-configuration's runtime
> > >>> >> dependencies, shown at home of
> > >>> >> >>>> commons-collections.
> > >>> >> >>>> In commons-configuration-1.2.pom, so many
> > >>> >> dependencies are added.
> > >>> >> >>>>
> > >>> >> >>>> How to cancel the trouble?
> > >>> >> >>>>
> > >>> >> >>>> a cup of Java, cheers!
> > >>> >> >>>> Sha Jiang
> > >>> >> >>>>
> > >>> >> >>>
> > >>> >> >>>
> > >>> >> >>
> > >>> >> >>
> > >>> >> >
> > >>> >> >
> > >>> >>
> > >>> >> --
> > >>> >> View this message in context:
> > >>> >>
> > >>> >
> > >>>
> >
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
> > >>> >> 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
> > >>> >>
> > >>> >>
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> > ___________________________________________________________
> > >>> > Telefonate ohne weitere Kosten vom PC zum PC:
> > >>> http://messenger.yahoo.de
> > >>> >
> > >>> >
> ---------------------------------------------------------------------
> > >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >>> > For additional commands, e-mail: users-help@maven.apache.org
> > >>> >
> > >>> >
> > >>> >
> > >>>
> > >>> --
> > >>> View this message in context:
> > >>>
> >
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
> > >>> 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
> > >>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
>
>

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


RE: Too many jars added to lib?

Posted by Barrett Nuzum <Ba...@Valtech.com>.
Sha & Wayne:
 
I would propose that a better idea would be that once things have been installed in your local repository, to change your settings.xml to <offline>true</offline>.
 
That way you have limited your local repository to a desired set of artifacts, but still can reconnect up or upgrade without changing all your groupIds, when the time comes. (... for it certainly will.)
 
Barrett
 
Barrett Nuzum
Consultant, Skill Development
barrett.nuzum@valtech.com
T:  +1 (918) 640 4414
F:  +1 (972) 789 1340


Valtech
5080 Spectrum Drive Suite 700 West 
Addison, Texas 75001
USA
T: +1 (972) 789 1200

________________________________

From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: Thu 11/9/2006 2:41 AM
To: Maven Users List
Subject: Re: Too many jars added to lib?



You can certainly do "whatever you want" to your local repo, including
"moving" artifacts to a new groupId and modifying the pom.xml files to
suit your needs.

Changing the groupId is not entirely uncommon -- sometimes you need to
build a release of your own project but depend on a SNAPSHOT, and
can't wait for a formal release of their code, so you release your own
internal non-Snapshot version of the code under your own groupId. Or
perhaps you have your own modifications to some open source code
library and so you literally have a different artifact than what is
being delivered by Central.

Wayne

On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
>
> Hello,
> I have an idea, can I install jar files to local repository, and don't use
> the artifacts at central repository?
> I just use different groupId, but artifactId and version aren't changed.
> Namely, before start a project, I install the dependencies firstly.
> Because I exactly know which jar is my want, then I can set dependencies
> exactly.
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
> >
> > Dear Wayne,
> > I have encountered some of the reasons you gave.
> > But the reason why I release the topic is very simple :D
> > I just think so many jar files are put at WEB-INF/lib would confused
> > somebody.
> > He/She would be puzzled why some many jars were used.
> > And some of the files aren't associate with the project obviously.
> >
> > Additionally, according to the discussion, some files can be excluded
> > surely.
> > It means that the jars are not needed in runtime time(say nothing of
> > compile time).
> > Why the artifacts are at dependency element?
> > I think the setting can be erased from the pom file. Or have other
> > reasons?
> >
> > a cup of Java, cheers!
> > Sha Jiang
> >
> >
> > Wayne Fay wrote:
> >>
> >> There are numerous reasons for why you might want to exclude some
> >> dependencies of dependencies... Here are a few:
> >>
> >> 1. New version of artifact is available which is not automatically
> >> being found and used instead of the old version, resulting in 2 copies
> >> of the artifact with different versions attached.
> >> 2. GroupID of artifact has changed, resulting in 2 copies of the
> >> artifact with different versions attached.
> >> 3. An API which might have multiple vendors -- ie Sun API which
> >> requires click-wrap licensing and manual install into repo vs CDDL/GNU
> >> licensed version of the same API which is freely available in the
> >> repo.
> >> 4. An artifact that should have been marked optional but was not.
> >> 5. An artifact which is provided by your runtime container thus should
> >> not be included with your build.
> >>
> >> I'm sure there are many more reasons to use <excludes>, but these are
> >> a few I've run into myself in the last few months...
> >>
> >> Wayne
> >>
> >> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
> >>>
> >>> Automatically importing dependencies of dependencies is a great feature.
> >>> But users have to know the dependency hierarchy, or we cannot exclude
> >>> the
> >>> artifacts exactly.
> >>>
> >>> And I'm puzzled that why can exclude some dependencies of dependencies?
> >>> If a jar(artifact) is a dependency of our project's direct dependency,
> >>> it
> >>> means that we need it, but exclude it?
> >>>
> >>> a cup of Java, cheers!
> >>> Sha Jiang
> >>>
> >>>
> >>> struberg wrote:
> >>> >
> >>> > there is a syntax to exclude some transitive
> >>> > dependencies from the dependency-list:
> >>> >
> >>> > a small sample:
> >>> >     <dependency>
> >>> >       <groupId>avalon-framework</groupId>
> >>> >       <artifactId>avalon-framework-api</artifactId>
> >>> >       <version>4.3</version>
> >>> >       <exclusions>
> >>> >         <exclusion>
> >>> >           <groupId>avalon-logkit</groupId>
> >>> >           <artifactId>avalon-logkit</artifactId>
> >>> >         </exclusion>
> >>> >       </exclusions>
> >>> >     </dependency>
> >>> >
> >>> > I guess this may solve your problems.
> >>> >
> >>> > best regards,
> >>> > strub
> >>> >
> >>> > --- Dmystery <De...@infosys.com> schrieb:
> >>> >
> >>> >>
> >>> >> This should definitely remove all the unwanted
> >>> >> dependencies. Even if they are
> >>> >> dependencies of a dependency. I'm doing the same
> >>> >> thing to remove all the
> >>> >> unwanted files.
> >>> >> Can you post your pom.xml?
> >>> >>
> >>> >> jiangshachina wrote:
> >>> >> >
> >>> >> > Hi Dmystery,
> >>> >> > Thanks for your help.
> >>> >> >
> >>> >> > I'm sorry that I cannot success with your
> >>> >> instructions.
> >>> >> > And I also read the guide on maven-war-plugin,
> >>> >> especially at
> >>> >> >
> >>> >>
> >>> >
> >>>
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> >>> >> > Unfortunately, I don't find the answer.
> >>> >> >
> >>> >> > The guide is on how to add or filter resources
> >>> >> from standard/customized
> >>> >> > resource paths.
> >>> >> > But it's not on how to filter resources from the
> >>> >> dependencies of
> >>> >> > dependencies.
> >>> >> >
> >>> >> > a cup of Java, cheers!
> >>> >> > Sha Jiang
> >>> >> >
> >>> >> >
> >>> >> > Dmystery wrote:
> >>> >> >>
> >>> >> >> Use maven-war-plugin. Due to transitive
> >>> >> dependencies in M2, you need to
> >>> >> >> remove them using the <warSourceExcludes> tag in
> >>> >> the plugin as below.
> >>> >> >>
> >>> >> >>   <build>
> >>> >> >>    <plugins>
> >>> >> >>     <plugin>
> >>> >> >>      <groupId>org.apache.maven.plugins</groupId>
> >>> >> >>      <artifactId>maven-war-plugin</artifactId>
> >>> >> >>      <version>2.0.1</version>
> >>> >> >>      <configuration>
> >>> >> >>      <warSourceExcludes>
> >>> >> >>             WEB-INF/lib/jar1,WEB-INF/lib/jar2,
> >>> >> >>     </warSourceExcludes>
> >>> >> >>      </configuration>
> >>> >> >>     </plugin>
> >>> >> >>    </plugins>
> >>> >> >>   </build>
> >>> >> >>
> >>> >> >> Checkout :
> >>> >>
> >>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
> >>> >> >>
> >>> >> >>
> >>> >> >> jiangshachina wrote:
> >>> >> >>>
> >>> >> >>> I have another question.
> >>> >> >>> In Web application project, generally, class
> >>> >> files would be located at
> >>> >> >>> WEB-INF/classes.
> >>> >> >>> But now, I want they to be archived, and locate
> >>> >> at WEB-INF/lib.
> >>> >> >>>
> >>> >> >>> And I want the jars could be put into different
> >>> >> sub-directory under
> >>> >> >>> WEB-INF/lib?
> >>> >> >>>
> >>> >> >>> maven-jar-plugin or maven-war-plugin can help
> >>> >> me?
> >>> >> >>> How can I do?
> >>> >> >>>
> >>> >> >>>
> >>> >> >>> jiangshachina wrote:
> >>> >> >>>>
> >>> >> >>>> Hello,
> >>> >> >>>> My web projects needs Apache
> >>> >> commons-configuration.
> >>> >> >>>> I added commons-configuration to my dependency.
> >>> >> >>>> After run "mvn package", too many jar files
> >>> >> were added into WEB-INF/lib
> >>> >> >>>> directory.
> >>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
> >>> >> of the list, which
> >>> >> >>>> lists commons-configuration's runtime
> >>> >> dependencies, shown at home of
> >>> >> >>>> commons-collections.
> >>> >> >>>> In commons-configuration-1.2.pom, so many
> >>> >> dependencies are added.
> >>> >> >>>>
> >>> >> >>>> How to cancel the trouble?
> >>> >> >>>>
> >>> >> >>>> a cup of Java, cheers!
> >>> >> >>>> Sha Jiang
> >>> >> >>>>
> >>> >> >>>
> >>> >> >>>
> >>> >> >>
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >>
> >>> >> --
> >>> >> View this message in context:
> >>> >>
> >>> >
> >>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
> >>> >> 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
> >>> >>
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> >                
> >>> > ___________________________________________________________
> >>> > Telefonate ohne weitere Kosten vom PC zum PC:
> >>> http://messenger.yahoo.de
> >>> >
> >>> > ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> > For additional commands, e-mail: users-help@maven.apache.org
> >>> >
> >>> >
> >>> >
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
> >>> 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
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
> 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
>
>

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





Re: Too many jars added to lib?

Posted by Wayne Fay <wa...@gmail.com>.
You can certainly do "whatever you want" to your local repo, including
"moving" artifacts to a new groupId and modifying the pom.xml files to
suit your needs.

Changing the groupId is not entirely uncommon -- sometimes you need to
build a release of your own project but depend on a SNAPSHOT, and
can't wait for a formal release of their code, so you release your own
internal non-Snapshot version of the code under your own groupId. Or
perhaps you have your own modifications to some open source code
library and so you literally have a different artifact than what is
being delivered by Central.

Wayne

On 11/9/06, jiangshachina <ji...@gmail.com> wrote:
>
> Hello,
> I have an idea, can I install jar files to local repository, and don't use
> the artifacts at central repository?
> I just use different groupId, but artifactId and version aren't changed.
> Namely, before start a project, I install the dependencies firstly.
> Because I exactly know which jar is my want, then I can set dependencies
> exactly.
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
> >
> > Dear Wayne,
> > I have encountered some of the reasons you gave.
> > But the reason why I release the topic is very simple :D
> > I just think so many jar files are put at WEB-INF/lib would confused
> > somebody.
> > He/She would be puzzled why some many jars were used.
> > And some of the files aren't associate with the project obviously.
> >
> > Additionally, according to the discussion, some files can be excluded
> > surely.
> > It means that the jars are not needed in runtime time(say nothing of
> > compile time).
> > Why the artifacts are at dependency element?
> > I think the setting can be erased from the pom file. Or have other
> > reasons?
> >
> > a cup of Java, cheers!
> > Sha Jiang
> >
> >
> > Wayne Fay wrote:
> >>
> >> There are numerous reasons for why you might want to exclude some
> >> dependencies of dependencies... Here are a few:
> >>
> >> 1. New version of artifact is available which is not automatically
> >> being found and used instead of the old version, resulting in 2 copies
> >> of the artifact with different versions attached.
> >> 2. GroupID of artifact has changed, resulting in 2 copies of the
> >> artifact with different versions attached.
> >> 3. An API which might have multiple vendors -- ie Sun API which
> >> requires click-wrap licensing and manual install into repo vs CDDL/GNU
> >> licensed version of the same API which is freely available in the
> >> repo.
> >> 4. An artifact that should have been marked optional but was not.
> >> 5. An artifact which is provided by your runtime container thus should
> >> not be included with your build.
> >>
> >> I'm sure there are many more reasons to use <excludes>, but these are
> >> a few I've run into myself in the last few months...
> >>
> >> Wayne
> >>
> >> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
> >>>
> >>> Automatically importing dependencies of dependencies is a great feature.
> >>> But users have to know the dependency hierarchy, or we cannot exclude
> >>> the
> >>> artifacts exactly.
> >>>
> >>> And I'm puzzled that why can exclude some dependencies of dependencies?
> >>> If a jar(artifact) is a dependency of our project's direct dependency,
> >>> it
> >>> means that we need it, but exclude it?
> >>>
> >>> a cup of Java, cheers!
> >>> Sha Jiang
> >>>
> >>>
> >>> struberg wrote:
> >>> >
> >>> > there is a syntax to exclude some transitive
> >>> > dependencies from the dependency-list:
> >>> >
> >>> > a small sample:
> >>> >     <dependency>
> >>> >       <groupId>avalon-framework</groupId>
> >>> >       <artifactId>avalon-framework-api</artifactId>
> >>> >       <version>4.3</version>
> >>> >       <exclusions>
> >>> >         <exclusion>
> >>> >           <groupId>avalon-logkit</groupId>
> >>> >           <artifactId>avalon-logkit</artifactId>
> >>> >         </exclusion>
> >>> >       </exclusions>
> >>> >     </dependency>
> >>> >
> >>> > I guess this may solve your problems.
> >>> >
> >>> > best regards,
> >>> > strub
> >>> >
> >>> > --- Dmystery <De...@infosys.com> schrieb:
> >>> >
> >>> >>
> >>> >> This should definitely remove all the unwanted
> >>> >> dependencies. Even if they are
> >>> >> dependencies of a dependency. I'm doing the same
> >>> >> thing to remove all the
> >>> >> unwanted files.
> >>> >> Can you post your pom.xml?
> >>> >>
> >>> >> jiangshachina wrote:
> >>> >> >
> >>> >> > Hi Dmystery,
> >>> >> > Thanks for your help.
> >>> >> >
> >>> >> > I'm sorry that I cannot success with your
> >>> >> instructions.
> >>> >> > And I also read the guide on maven-war-plugin,
> >>> >> especially at
> >>> >> >
> >>> >>
> >>> >
> >>>
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> >>> >> > Unfortunately, I don't find the answer.
> >>> >> >
> >>> >> > The guide is on how to add or filter resources
> >>> >> from standard/customized
> >>> >> > resource paths.
> >>> >> > But it's not on how to filter resources from the
> >>> >> dependencies of
> >>> >> > dependencies.
> >>> >> >
> >>> >> > a cup of Java, cheers!
> >>> >> > Sha Jiang
> >>> >> >
> >>> >> >
> >>> >> > Dmystery wrote:
> >>> >> >>
> >>> >> >> Use maven-war-plugin. Due to transitive
> >>> >> dependencies in M2, you need to
> >>> >> >> remove them using the <warSourceExcludes> tag in
> >>> >> the plugin as below.
> >>> >> >>
> >>> >> >>   <build>
> >>> >> >>    <plugins>
> >>> >> >>     <plugin>
> >>> >> >>      <groupId>org.apache.maven.plugins</groupId>
> >>> >> >>      <artifactId>maven-war-plugin</artifactId>
> >>> >> >>      <version>2.0.1</version>
> >>> >> >>      <configuration>
> >>> >> >> 	 <warSourceExcludes>
> >>> >> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
> >>> >> >>  	</warSourceExcludes>
> >>> >> >>      </configuration>
> >>> >> >>     </plugin>
> >>> >> >>    </plugins>
> >>> >> >>   </build>
> >>> >> >>
> >>> >> >> Checkout :
> >>> >>
> >>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
> >>> >> >>
> >>> >> >>
> >>> >> >> jiangshachina wrote:
> >>> >> >>>
> >>> >> >>> I have another question.
> >>> >> >>> In Web application project, generally, class
> >>> >> files would be located at
> >>> >> >>> WEB-INF/classes.
> >>> >> >>> But now, I want they to be archived, and locate
> >>> >> at WEB-INF/lib.
> >>> >> >>>
> >>> >> >>> And I want the jars could be put into different
> >>> >> sub-directory under
> >>> >> >>> WEB-INF/lib?
> >>> >> >>>
> >>> >> >>> maven-jar-plugin or maven-war-plugin can help
> >>> >> me?
> >>> >> >>> How can I do?
> >>> >> >>>
> >>> >> >>>
> >>> >> >>> jiangshachina wrote:
> >>> >> >>>>
> >>> >> >>>> Hello,
> >>> >> >>>> My web projects needs Apache
> >>> >> commons-configuration.
> >>> >> >>>> I added commons-configuration to my dependency.
> >>> >> >>>> After run "mvn package", too many jar files
> >>> >> were added into WEB-INF/lib
> >>> >> >>>> directory.
> >>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
> >>> >> of the list, which
> >>> >> >>>> lists commons-configuration's runtime
> >>> >> dependencies, shown at home of
> >>> >> >>>> commons-collections.
> >>> >> >>>> In commons-configuration-1.2.pom, so many
> >>> >> dependencies are added.
> >>> >> >>>>
> >>> >> >>>> How to cancel the trouble?
> >>> >> >>>>
> >>> >> >>>> a cup of Java, cheers!
> >>> >> >>>> Sha Jiang
> >>> >> >>>>
> >>> >> >>>
> >>> >> >>>
> >>> >> >>
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >>
> >>> >> --
> >>> >> View this message in context:
> >>> >>
> >>> >
> >>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
> >>> >> 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
> >>> >>
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > 		
> >>> > ___________________________________________________________
> >>> > Telefonate ohne weitere Kosten vom PC zum PC:
> >>> http://messenger.yahoo.de
> >>> >
> >>> > ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> > For additional commands, e-mail: users-help@maven.apache.org
> >>> >
> >>> >
> >>> >
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
> >>> 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
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
> 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
>
>

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


Re: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Hello,
I have an idea, can I install jar files to local repository, and don't use
the artifacts at central repository?
I just use different groupId, but artifactId and version aren't changed.
Namely, before start a project, I install the dependencies firstly.
Because I exactly know which jar is my want, then I can set dependencies
exactly.

a cup of Java, cheers!
Sha Jiang


jiangshachina wrote:
> 
> Dear Wayne,
> I have encountered some of the reasons you gave.
> But the reason why I release the topic is very simple :D
> I just think so many jar files are put at WEB-INF/lib would confused
> somebody.
> He/She would be puzzled why some many jars were used.
> And some of the files aren't associate with the project obviously.
> 
> Additionally, according to the discussion, some files can be excluded
> surely.
> It means that the jars are not needed in runtime time(say nothing of
> compile time).
> Why the artifacts are at dependency element?
> I think the setting can be erased from the pom file. Or have other
> reasons?
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 
> Wayne Fay wrote:
>> 
>> There are numerous reasons for why you might want to exclude some
>> dependencies of dependencies... Here are a few:
>> 
>> 1. New version of artifact is available which is not automatically
>> being found and used instead of the old version, resulting in 2 copies
>> of the artifact with different versions attached.
>> 2. GroupID of artifact has changed, resulting in 2 copies of the
>> artifact with different versions attached.
>> 3. An API which might have multiple vendors -- ie Sun API which
>> requires click-wrap licensing and manual install into repo vs CDDL/GNU
>> licensed version of the same API which is freely available in the
>> repo.
>> 4. An artifact that should have been marked optional but was not.
>> 5. An artifact which is provided by your runtime container thus should
>> not be included with your build.
>> 
>> I'm sure there are many more reasons to use <excludes>, but these are
>> a few I've run into myself in the last few months...
>> 
>> Wayne
>> 
>> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
>>>
>>> Automatically importing dependencies of dependencies is a great feature.
>>> But users have to know the dependency hierarchy, or we cannot exclude
>>> the
>>> artifacts exactly.
>>>
>>> And I'm puzzled that why can exclude some dependencies of dependencies?
>>> If a jar(artifact) is a dependency of our project's direct dependency,
>>> it
>>> means that we need it, but exclude it?
>>>
>>> a cup of Java, cheers!
>>> Sha Jiang
>>>
>>>
>>> struberg wrote:
>>> >
>>> > there is a syntax to exclude some transitive
>>> > dependencies from the dependency-list:
>>> >
>>> > a small sample:
>>> >     <dependency>
>>> >       <groupId>avalon-framework</groupId>
>>> >       <artifactId>avalon-framework-api</artifactId>
>>> >       <version>4.3</version>
>>> >       <exclusions>
>>> >         <exclusion>
>>> >           <groupId>avalon-logkit</groupId>
>>> >           <artifactId>avalon-logkit</artifactId>
>>> >         </exclusion>
>>> >       </exclusions>
>>> >     </dependency>
>>> >
>>> > I guess this may solve your problems.
>>> >
>>> > best regards,
>>> > strub
>>> >
>>> > --- Dmystery <De...@infosys.com> schrieb:
>>> >
>>> >>
>>> >> This should definitely remove all the unwanted
>>> >> dependencies. Even if they are
>>> >> dependencies of a dependency. I'm doing the same
>>> >> thing to remove all the
>>> >> unwanted files.
>>> >> Can you post your pom.xml?
>>> >>
>>> >> jiangshachina wrote:
>>> >> >
>>> >> > Hi Dmystery,
>>> >> > Thanks for your help.
>>> >> >
>>> >> > I'm sorry that I cannot success with your
>>> >> instructions.
>>> >> > And I also read the guide on maven-war-plugin,
>>> >> especially at
>>> >> >
>>> >>
>>> >
>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>> >> > Unfortunately, I don't find the answer.
>>> >> >
>>> >> > The guide is on how to add or filter resources
>>> >> from standard/customized
>>> >> > resource paths.
>>> >> > But it's not on how to filter resources from the
>>> >> dependencies of
>>> >> > dependencies.
>>> >> >
>>> >> > a cup of Java, cheers!
>>> >> > Sha Jiang
>>> >> >
>>> >> >
>>> >> > Dmystery wrote:
>>> >> >>
>>> >> >> Use maven-war-plugin. Due to transitive
>>> >> dependencies in M2, you need to
>>> >> >> remove them using the <warSourceExcludes> tag in
>>> >> the plugin as below.
>>> >> >>
>>> >> >>   <build>
>>> >> >>    <plugins>
>>> >> >>     <plugin>
>>> >> >>      <groupId>org.apache.maven.plugins</groupId>
>>> >> >>      <artifactId>maven-war-plugin</artifactId>
>>> >> >>      <version>2.0.1</version>
>>> >> >>      <configuration>
>>> >> >> 	 <warSourceExcludes>
>>> >> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>> >> >>  	</warSourceExcludes>
>>> >> >>      </configuration>
>>> >> >>     </plugin>
>>> >> >>    </plugins>
>>> >> >>   </build>
>>> >> >>
>>> >> >> Checkout :
>>> >>
>>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
>>> >> >>
>>> >> >>
>>> >> >> jiangshachina wrote:
>>> >> >>>
>>> >> >>> I have another question.
>>> >> >>> In Web application project, generally, class
>>> >> files would be located at
>>> >> >>> WEB-INF/classes.
>>> >> >>> But now, I want they to be archived, and locate
>>> >> at WEB-INF/lib.
>>> >> >>>
>>> >> >>> And I want the jars could be put into different
>>> >> sub-directory under
>>> >> >>> WEB-INF/lib?
>>> >> >>>
>>> >> >>> maven-jar-plugin or maven-war-plugin can help
>>> >> me?
>>> >> >>> How can I do?
>>> >> >>>
>>> >> >>>
>>> >> >>> jiangshachina wrote:
>>> >> >>>>
>>> >> >>>> Hello,
>>> >> >>>> My web projects needs Apache
>>> >> commons-configuration.
>>> >> >>>> I added commons-configuration to my dependency.
>>> >> >>>> After run "mvn package", too many jar files
>>> >> were added into WEB-INF/lib
>>> >> >>>> directory.
>>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>>> >> of the list, which
>>> >> >>>> lists commons-configuration's runtime
>>> >> dependencies, shown at home of
>>> >> >>>> commons-collections.
>>> >> >>>> In commons-configuration-1.2.pom, so many
>>> >> dependencies are added.
>>> >> >>>>
>>> >> >>>> How to cancel the trouble?
>>> >> >>>>
>>> >> >>>> a cup of Java, cheers!
>>> >> >>>> Sha Jiang
>>> >> >>>>
>>> >> >>>
>>> >> >>>
>>> >> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> >
>>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>>> >> 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
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> > 		
>>> > ___________________________________________________________
>>> > Telefonate ohne weitere Kosten vom PC zum PC:
>>> http://messenger.yahoo.de
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> > For additional commands, e-mail: users-help@maven.apache.org
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
>>> 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
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253724
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear Wayne,
I have encountered some of the reasons you gave.
But the reason why I release the topic is very simple :D
I just think so many jar files are put at WEB-INF/lib would confused
somebody.
He/She would be puzzled why some many jars were used.
And some of the files aren't associate with the project obviously.

Additionally, according to the discussion, some files can be excluded
surely.
It means that the jars are not needed in runtime time(say nothing of compile
time).
Why the artifacts are at dependency element?
I think the setting can be erased from the pom file. Or have other reasons?

a cup of Java, cheers!
Sha Jiang


Wayne Fay wrote:
> 
> There are numerous reasons for why you might want to exclude some
> dependencies of dependencies... Here are a few:
> 
> 1. New version of artifact is available which is not automatically
> being found and used instead of the old version, resulting in 2 copies
> of the artifact with different versions attached.
> 2. GroupID of artifact has changed, resulting in 2 copies of the
> artifact with different versions attached.
> 3. An API which might have multiple vendors -- ie Sun API which
> requires click-wrap licensing and manual install into repo vs CDDL/GNU
> licensed version of the same API which is freely available in the
> repo.
> 4. An artifact that should have been marked optional but was not.
> 5. An artifact which is provided by your runtime container thus should
> not be included with your build.
> 
> I'm sure there are many more reasons to use <excludes>, but these are
> a few I've run into myself in the last few months...
> 
> Wayne
> 
> On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
>>
>> Automatically importing dependencies of dependencies is a great feature.
>> But users have to know the dependency hierarchy, or we cannot exclude the
>> artifacts exactly.
>>
>> And I'm puzzled that why can exclude some dependencies of dependencies?
>> If a jar(artifact) is a dependency of our project's direct dependency, it
>> means that we need it, but exclude it?
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>>
>> struberg wrote:
>> >
>> > there is a syntax to exclude some transitive
>> > dependencies from the dependency-list:
>> >
>> > a small sample:
>> >     <dependency>
>> >       <groupId>avalon-framework</groupId>
>> >       <artifactId>avalon-framework-api</artifactId>
>> >       <version>4.3</version>
>> >       <exclusions>
>> >         <exclusion>
>> >           <groupId>avalon-logkit</groupId>
>> >           <artifactId>avalon-logkit</artifactId>
>> >         </exclusion>
>> >       </exclusions>
>> >     </dependency>
>> >
>> > I guess this may solve your problems.
>> >
>> > best regards,
>> > strub
>> >
>> > --- Dmystery <De...@infosys.com> schrieb:
>> >
>> >>
>> >> This should definitely remove all the unwanted
>> >> dependencies. Even if they are
>> >> dependencies of a dependency. I'm doing the same
>> >> thing to remove all the
>> >> unwanted files.
>> >> Can you post your pom.xml?
>> >>
>> >> jiangshachina wrote:
>> >> >
>> >> > Hi Dmystery,
>> >> > Thanks for your help.
>> >> >
>> >> > I'm sorry that I cannot success with your
>> >> instructions.
>> >> > And I also read the guide on maven-war-plugin,
>> >> especially at
>> >> >
>> >>
>> >
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> >> > Unfortunately, I don't find the answer.
>> >> >
>> >> > The guide is on how to add or filter resources
>> >> from standard/customized
>> >> > resource paths.
>> >> > But it's not on how to filter resources from the
>> >> dependencies of
>> >> > dependencies.
>> >> >
>> >> > a cup of Java, cheers!
>> >> > Sha Jiang
>> >> >
>> >> >
>> >> > Dmystery wrote:
>> >> >>
>> >> >> Use maven-war-plugin. Due to transitive
>> >> dependencies in M2, you need to
>> >> >> remove them using the <warSourceExcludes> tag in
>> >> the plugin as below.
>> >> >>
>> >> >>   <build>
>> >> >>    <plugins>
>> >> >>     <plugin>
>> >> >>      <groupId>org.apache.maven.plugins</groupId>
>> >> >>      <artifactId>maven-war-plugin</artifactId>
>> >> >>      <version>2.0.1</version>
>> >> >>      <configuration>
>> >> >> 	 <warSourceExcludes>
>> >> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>> >> >>  	</warSourceExcludes>
>> >> >>      </configuration>
>> >> >>     </plugin>
>> >> >>    </plugins>
>> >> >>   </build>
>> >> >>
>> >> >> Checkout :
>> >>
>> > http://maven.apache.org/plugins/maven-war-plugin/index.html
>> >> >>
>> >> >>
>> >> >> jiangshachina wrote:
>> >> >>>
>> >> >>> I have another question.
>> >> >>> In Web application project, generally, class
>> >> files would be located at
>> >> >>> WEB-INF/classes.
>> >> >>> But now, I want they to be archived, and locate
>> >> at WEB-INF/lib.
>> >> >>>
>> >> >>> And I want the jars could be put into different
>> >> sub-directory under
>> >> >>> WEB-INF/lib?
>> >> >>>
>> >> >>> maven-jar-plugin or maven-war-plugin can help
>> >> me?
>> >> >>> How can I do?
>> >> >>>
>> >> >>>
>> >> >>> jiangshachina wrote:
>> >> >>>>
>> >> >>>> Hello,
>> >> >>>> My web projects needs Apache
>> >> commons-configuration.
>> >> >>>> I added commons-configuration to my dependency.
>> >> >>>> After run "mvn package", too many jar files
>> >> were added into WEB-INF/lib
>> >> >>>> directory.
>> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>> >> of the list, which
>> >> >>>> lists commons-configuration's runtime
>> >> dependencies, shown at home of
>> >> >>>> commons-collections.
>> >> >>>> In commons-configuration-1.2.pom, so many
>> >> dependencies are added.
>> >> >>>>
>> >> >>>> How to cancel the trouble?
>> >> >>>>
>> >> >>>> a cup of Java, cheers!
>> >> >>>> Sha Jiang
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> >
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>> >> 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
>> >>
>> >>
>> >
>> >
>> >
>> > 		
>> > ___________________________________________________________
>> > Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7253410
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: Too many jars added to lib?

Posted by Wayne Fay <wa...@gmail.com>.
There are numerous reasons for why you might want to exclude some
dependencies of dependencies... Here are a few:

1. New version of artifact is available which is not automatically
being found and used instead of the old version, resulting in 2 copies
of the artifact with different versions attached.
2. GroupID of artifact has changed, resulting in 2 copies of the
artifact with different versions attached.
3. An API which might have multiple vendors -- ie Sun API which
requires click-wrap licensing and manual install into repo vs CDDL/GNU
licensed version of the same API which is freely available in the
repo.
4. An artifact that should have been marked optional but was not.
5. An artifact which is provided by your runtime container thus should
not be included with your build.

I'm sure there are many more reasons to use <excludes>, but these are
a few I've run into myself in the last few months...

Wayne

On 11/8/06, jiangshachina <ji...@gmail.com> wrote:
>
> Automatically importing dependencies of dependencies is a great feature.
> But users have to know the dependency hierarchy, or we cannot exclude the
> artifacts exactly.
>
> And I'm puzzled that why can exclude some dependencies of dependencies?
> If a jar(artifact) is a dependency of our project's direct dependency, it
> means that we need it, but exclude it?
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> struberg wrote:
> >
> > there is a syntax to exclude some transitive
> > dependencies from the dependency-list:
> >
> > a small sample:
> >     <dependency>
> >       <groupId>avalon-framework</groupId>
> >       <artifactId>avalon-framework-api</artifactId>
> >       <version>4.3</version>
> >       <exclusions>
> >         <exclusion>
> >           <groupId>avalon-logkit</groupId>
> >           <artifactId>avalon-logkit</artifactId>
> >         </exclusion>
> >       </exclusions>
> >     </dependency>
> >
> > I guess this may solve your problems.
> >
> > best regards,
> > strub
> >
> > --- Dmystery <De...@infosys.com> schrieb:
> >
> >>
> >> This should definitely remove all the unwanted
> >> dependencies. Even if they are
> >> dependencies of a dependency. I'm doing the same
> >> thing to remove all the
> >> unwanted files.
> >> Can you post your pom.xml?
> >>
> >> jiangshachina wrote:
> >> >
> >> > Hi Dmystery,
> >> > Thanks for your help.
> >> >
> >> > I'm sorry that I cannot success with your
> >> instructions.
> >> > And I also read the guide on maven-war-plugin,
> >> especially at
> >> >
> >>
> >
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> >> > Unfortunately, I don't find the answer.
> >> >
> >> > The guide is on how to add or filter resources
> >> from standard/customized
> >> > resource paths.
> >> > But it's not on how to filter resources from the
> >> dependencies of
> >> > dependencies.
> >> >
> >> > a cup of Java, cheers!
> >> > Sha Jiang
> >> >
> >> >
> >> > Dmystery wrote:
> >> >>
> >> >> Use maven-war-plugin. Due to transitive
> >> dependencies in M2, you need to
> >> >> remove them using the <warSourceExcludes> tag in
> >> the plugin as below.
> >> >>
> >> >>   <build>
> >> >>    <plugins>
> >> >>     <plugin>
> >> >>      <groupId>org.apache.maven.plugins</groupId>
> >> >>      <artifactId>maven-war-plugin</artifactId>
> >> >>      <version>2.0.1</version>
> >> >>      <configuration>
> >> >> 	 <warSourceExcludes>
> >> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
> >> >>  	</warSourceExcludes>
> >> >>      </configuration>
> >> >>     </plugin>
> >> >>    </plugins>
> >> >>   </build>
> >> >>
> >> >> Checkout :
> >>
> > http://maven.apache.org/plugins/maven-war-plugin/index.html
> >> >>
> >> >>
> >> >> jiangshachina wrote:
> >> >>>
> >> >>> I have another question.
> >> >>> In Web application project, generally, class
> >> files would be located at
> >> >>> WEB-INF/classes.
> >> >>> But now, I want they to be archived, and locate
> >> at WEB-INF/lib.
> >> >>>
> >> >>> And I want the jars could be put into different
> >> sub-directory under
> >> >>> WEB-INF/lib?
> >> >>>
> >> >>> maven-jar-plugin or maven-war-plugin can help
> >> me?
> >> >>> How can I do?
> >> >>>
> >> >>>
> >> >>> jiangshachina wrote:
> >> >>>>
> >> >>>> Hello,
> >> >>>> My web projects needs Apache
> >> commons-configuration.
> >> >>>> I added commons-configuration to my dependency.
> >> >>>> After run "mvn package", too many jar files
> >> were added into WEB-INF/lib
> >> >>>> directory.
> >> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
> >> of the list, which
> >> >>>> lists commons-configuration's runtime
> >> dependencies, shown at home of
> >> >>>> commons-collections.
> >> >>>> In commons-configuration-1.2.pom, so many
> >> dependencies are added.
> >> >>>>
> >> >>>> How to cancel the trouble?
> >> >>>>
> >> >>>> a cup of Java, cheers!
> >> >>>> Sha Jiang
> >> >>>>
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> >
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
> >> 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
> >>
> >>
> >
> >
> >
> > 		
> > ___________________________________________________________
> > Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
> 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
>
>

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


Re: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Automatically importing dependencies of dependencies is a great feature.
But users have to know the dependency hierarchy, or we cannot exclude the
artifacts exactly.

And I'm puzzled that why can exclude some dependencies of dependencies?
If a jar(artifact) is a dependency of our project's direct dependency, it
means that we need it, but exclude it?

a cup of Java, cheers!
Sha Jiang


struberg wrote:
> 
> there is a syntax to exclude some transitive
> dependencies from the dependency-list:
> 
> a small sample:
>     <dependency>
>       <groupId>avalon-framework</groupId>
>       <artifactId>avalon-framework-api</artifactId>
>       <version>4.3</version>
>       <exclusions>
>         <exclusion>
>           <groupId>avalon-logkit</groupId>
>           <artifactId>avalon-logkit</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
> 
> I guess this may solve your problems.
> 
> best regards,
> strub
> 
> --- Dmystery <De...@infosys.com> schrieb:
> 
>> 
>> This should definitely remove all the unwanted
>> dependencies. Even if they are
>> dependencies of a dependency. I'm doing the same
>> thing to remove all the
>> unwanted files. 
>> Can you post your pom.xml?
>> 
>> jiangshachina wrote:
>> > 
>> > Hi Dmystery,
>> > Thanks for your help.
>> > 
>> > I'm sorry that I cannot success with your
>> instructions.
>> > And I also read the guide on maven-war-plugin,
>> especially at
>> >
>>
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> > Unfortunately, I don't find the answer.
>> > 
>> > The guide is on how to add or filter resources
>> from standard/customized
>> > resource paths.
>> > But it's not on how to filter resources from the
>> dependencies of
>> > dependencies.
>> > 
>> > a cup of Java, cheers!
>> > Sha Jiang
>> > 
>> > 
>> > Dmystery wrote:
>> >> 
>> >> Use maven-war-plugin. Due to transitive
>> dependencies in M2, you need to
>> >> remove them using the <warSourceExcludes> tag in
>> the plugin as below.
>> >> 
>> >>   <build>
>> >>    <plugins>
>> >>     <plugin> 
>> >>      <groupId>org.apache.maven.plugins</groupId> 
>> >>      <artifactId>maven-war-plugin</artifactId> 
>> >>      <version>2.0.1</version> 
>> >>      <configuration> 
>> >> 	 <warSourceExcludes> 
>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>> >>  	</warSourceExcludes> 
>> >>      </configuration> 
>> >>     </plugin>   
>> >>    </plugins>
>> >>   </build>
>> >> 
>> >> Checkout :
>>
> http://maven.apache.org/plugins/maven-war-plugin/index.html
>> >> 
>> >> 
>> >> jiangshachina wrote:
>> >>> 
>> >>> I have another question.
>> >>> In Web application project, generally, class
>> files would be located at
>> >>> WEB-INF/classes.
>> >>> But now, I want they to be archived, and locate
>> at WEB-INF/lib.
>> >>> 
>> >>> And I want the jars could be put into different
>> sub-directory under
>> >>> WEB-INF/lib?
>> >>> 
>> >>> maven-jar-plugin or maven-war-plugin can help
>> me?
>> >>> How can I do?
>> >>> 
>> >>> 
>> >>> jiangshachina wrote:
>> >>>> 
>> >>>> Hello,
>> >>>> My web projects needs Apache
>> commons-configuration.
>> >>>> I added commons-configuration to my dependency.
>> >>>> After run "mvn package", too many jar files
>> were added into WEB-INF/lib
>> >>>> directory.
>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>> of the list, which
>> >>>> lists commons-configuration's runtime
>> dependencies, shown at home of
>> >>>> commons-collections.
>> >>>> In commons-configuration-1.2.pom, so many
>> dependencies are added.
>> >>>> 
>> >>>> How to cancel the trouble?
>> >>>> 
>> >>>> a cup of Java, cheers!
>> >>>> Sha Jiang 
>> >>>> 
>> >>> 
>> >>> 
>> >> 
>> >> 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>> 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
>> 
>> 
> 
> 
> 
> 		
> ___________________________________________________________ 
> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7250848
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear Dmystery,
I must say sorry, it's my fault.
Use following scripts is ok,
<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-war-plugin</artifactId>
			<version>2.0.1</version>
			<configuration>
				<warSourceExcludes>WEB-INF/lib/dom4j-1.4.jar</warSourceExcludes>
			</configuration>
		</plugin>
	</plugins>
</build>
Really, every time, I just looked at dir webapp-1.0-SNAPSHOT, but real war
file webapp-1.0-SNAPSHOT.war.
In fact, I never care the sequence of generating dir webapp-1.0-SNAPSHOT(and
it's content) and file webapp-1.0-SNAPSHOT.war.
I always think the content in dir webapp-1.0-SNAPSHOT is the same as that in
webapp-1.0-SNAPSHOT.war.

Thanks again!
Best Regards!

a cup of Java, cheers!
Sha Jiang


Dmystery wrote:
> 
> This sounds strange. Is dom4j jar in your
> target/webapp-1.0-SNAPSHOT/WEB-INF/lib ? if its a parent dependency then,
> it should be in this folder. <warSourceExcludes> will exclude whatever jar
> you specify from this folder when the plugin creates the war file, but
> those jar will continue to exist in that folder.
> 
> 
> 
> jiangshachina wrote:
>> 
>> Dear Dmystery,
>> The following is new pom.xml with your instructions,
>> <project>
>> 	<parent>
>> 		<groupId>ce.demo</groupId>
>> 		<artifactId>demo</artifactId>
>> 		<version>1.0-SNAPSHOT</version>
>> 	</parent>
>> 
>> 	<modelVersion>4.0.0</modelVersion>
>> 	<groupId>ce.demo</groupId>
>> 	<artifactId>webapp</artifactId>
>> 	<packaging>war</packaging>
>> 	<name>Web Application Project</name>
>> 
>> 	<dependencies>
>> 		<dependency>
>> 			<groupId>ce.demo</groupId>
>> 			<artifactId>app</artifactId>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>javax.servlet</groupId>
>> 			<artifactId>servlet-api</artifactId>
>> 			<version>2.4</version>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>commons-configuration</groupId>
>> 			<artifactId>commons-configuration</artifactId>
>> 			<version>2.4</version>
>> 		</dependency>
>> 	</dependencies>
>> 
>> 	<build>
>> 		<plugins>
>> 			<plugin>
>> 				<groupId>org.apache.maven.plugins</groupId>
>> 				<artifactId>maven-war-plugin</artifactId>
>> 				<version>2.0.1</version>
>> 				<configuration>
>> 					<warSourceExcludes>dom4j-1.4.jar</warSourceExcludes>
>> 				</configuration>
>> 			</plugin>
>> 		</plugins>
>> 	</build>
>> </project>
>> But can't get result I expect.
>> If change <warSourceExcludes>dom4j-1.4.jar</warSourceExcludes> to
>> <warSourceExcludes>WEB-INF/lib/dom4j-1.4.jar</warSourceExcludes>, the
>> result still is that.
>> 
>> 
>> Dmystery wrote:
>>> 
>>> I'm not sure how you are using the plugin, but your pom.xml should read
>>> like, 
>>> 
>>> 
>>> <project>
>>>   <parent>
>>>     <groupId>ce.demo</groupId>
>>>     <artifactId>demo</artifactId>
>>>     <version>1.0-SNAPSHOT</version>
>>>  </parent>
>>> 
>>>  <modelVersion>4.0.0</modelVersion>
>>>  <groupId>ce.demo</groupId>
>>>  <artifactId>webapp</artifactId>
>>>  <packaging>war</packaging>
>>>  <name>Web Application Project</name>
>>>  <dependencies>
>>>   <dependency>
>>>     <groupId>ce.demo</groupId>
>>>     <artifactId>app</artifactId>
>>>     <version>${project.version}</version>
>>>   </dependency>
>>>   <dependency>
>>>     <groupId>javax.servlet</groupId>
>>>     <artifactId>servlet-api</artifactId>
>>>     <version>2.4</version>
>>>   </dependency>
>>>   <dependency> 
>>>     <groupId>commons-configuration</groupId>
>>>     <artifactId>commons-configuration</artifactId>
>>>     <version>1.2</version>
>>>     <exclusions>
>>>       <exclusion>
>>>         <groupId>dom4j</groupId>
>>>         <artifactId>dom4j</artifactId>
>>>       </exclusion>
>>>    </exclusions>
>>>   </dependency>
>>>   </dependencies>
>>> 
>>>   <build>
>>>    <plugins>
>>>     <plugin> 
>>>      <groupId>org.apache.maven.plugins</groupId> 
>>>      <artifactId>maven-war-plugin</artifactId> 
>>>      <version>2.0.1</version> 
>>>      <configuration> 
>>> 	 <warSourceExcludes> 
>>> 	 </warSourceExcludes> 
>>>      </configuration> 
>>>     </plugin>   
>>>    </plugins>
>>>   </build>
>>> 
>>> </project>
>>> 
>>> Do note that the plugin version is 2.0.1
>>> 
>>> 
>>> 
>>> 
>>> jiangshachina wrote:
>>>> 
>>>> Hi,
>>>> I used the following scripts(for example, I didn't want dom4j-1.4.jar),
>>>> and had a success.
>>>> <dependency>
>>>> 	<dependency>
>>>> 		<groupId>commons-configuration</groupId>
>>>> 		<artifactId>commons-configuration</artifactId>
>>>> 		<version>1.2</version>
>>>> 		<exclusions>
>>>> 			<exclusion>
>>>> 				<groupId>dom4j</groupId>
>>>> 				<artifactId>dom4j</artifactId>
>>>> 			</exclusion>
>>>> 		</exclusions>
>>>> 	</dependency>
>>>> </dependency>
>>>> 
>>>> but didn't get same result with following scripts,
>>>> <build>
>>>> 	<plugins>
>>>> 		<plugin>
>>>> 			<groupId>org.apache.maven.plugins</groupId>
>>>> 			<artifactId>maven-war-plugin</artifactId>
>>>> 			<version>2.0.1</version>
>>>> 			<configuration>
>>>> 				<warSourceExcludes>
>>>> 					WEB-INF/lib/dom4j-1.4.jar
>>>> 				</warSourceExcludes>
>>>> 			</configuration>
>>>> 		</plugin>
>>>> 	</plugins>
>>>> </build>
>>>> And I don't find parameter "warSourceExcludes" at maven-war-plugin doc
>>>> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>>>> I also don't find "warSourceExcludes" at link
>>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>>> 
>>>> Dmystery, you said all is ok in your project.
>>>> Can you show your case briefly?
>>>> My pom.xml is very simple, following is the all
>>>> <project>
>>>> 	<parent>
>>>> 		<groupId>ce.demo</groupId>
>>>> 		<artifactId>demo</artifactId>
>>>> 		<version>1.0-SNAPSHOT</version>
>>>> 	</parent>
>>>> 
>>>> 	<modelVersion>4.0.0</modelVersion>
>>>> 	<groupId>ce.demo</groupId>
>>>> 	<artifactId>webapp</artifactId>
>>>> 	<packaging>war</packaging>
>>>> 	<name>Web Application Project</name>
>>>> 
>>>> 	<dependencies>
>>>> 		<dependency>
>>>> 			<groupId>ce.demo</groupId>
>>>> 			<artifactId>app</artifactId>
>>>> 			<version>${project.version}</version>
>>>> 		</dependency>
>>>> 		<dependency>
>>>> 			<groupId>javax.servlet</groupId>
>>>> 			<artifactId>servlet-api</artifactId>
>>>> 			<version>2.4</version>
>>>> 		</dependency>
>>>> 		<dependency>
>>>> 			<groupId>commons-configuration</groupId>
>>>> 			<artifactId>commons-configuration</artifactId>
>>>> 			<version>1.2</version>
>>>> 			<exclusions>
>>>> 				<exclusion>
>>>> 					<groupId>dom4j</groupId>
>>>> 					<artifactId>dom4j</artifactId>
>>>> 				</exclusion>
>>>> 			</exclusions>
>>>> 		</dependency>
>>>> 	</dependencies>
>>>> </project>
>>>> 
>>>> a cup of Java, cheers!
>>>> Sha Jiang
>>>> 
>>>> 
>>>> struberg wrote:
>>>>> 
>>>>> there is a syntax to exclude some transitive
>>>>> dependencies from the dependency-list:
>>>>> 
>>>>> a small sample:
>>>>>     <dependency>
>>>>>       <groupId>avalon-framework</groupId>
>>>>>       <artifactId>avalon-framework-api</artifactId>
>>>>>       <version>4.3</version>
>>>>>       <exclusions>
>>>>>         <exclusion>
>>>>>           <groupId>avalon-logkit</groupId>
>>>>>           <artifactId>avalon-logkit</artifactId>
>>>>>         </exclusion>
>>>>>       </exclusions>
>>>>>     </dependency>
>>>>> 
>>>>> I guess this may solve your problems.
>>>>> 
>>>>> best regards,
>>>>> strub
>>>>> 
>>>>> --- Dmystery <De...@infosys.com> schrieb:
>>>>> 
>>>>>> 
>>>>>> This should definitely remove all the unwanted
>>>>>> dependencies. Even if they are
>>>>>> dependencies of a dependency. I'm doing the same
>>>>>> thing to remove all the
>>>>>> unwanted files. 
>>>>>> Can you post your pom.xml?
>>>>>> 
>>>>>> jiangshachina wrote:
>>>>>> > 
>>>>>> > Hi Dmystery,
>>>>>> > Thanks for your help.
>>>>>> > 
>>>>>> > I'm sorry that I cannot success with your
>>>>>> instructions.
>>>>>> > And I also read the guide on maven-war-plugin,
>>>>>> especially at
>>>>>> >
>>>>>>
>>>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>>>>> > Unfortunately, I don't find the answer.
>>>>>> > 
>>>>>> > The guide is on how to add or filter resources
>>>>>> from standard/customized
>>>>>> > resource paths.
>>>>>> > But it's not on how to filter resources from the
>>>>>> dependencies of
>>>>>> > dependencies.
>>>>>> > 
>>>>>> > a cup of Java, cheers!
>>>>>> > Sha Jiang
>>>>>> > 
>>>>>> > 
>>>>>> > Dmystery wrote:
>>>>>> >> 
>>>>>> >> Use maven-war-plugin. Due to transitive
>>>>>> dependencies in M2, you need to
>>>>>> >> remove them using the <warSourceExcludes> tag in
>>>>>> the plugin as below.
>>>>>> >> 
>>>>>> >>   <build>
>>>>>> >>    <plugins>
>>>>>> >>     <plugin> 
>>>>>> >>      <groupId>org.apache.maven.plugins</groupId> 
>>>>>> >>      <artifactId>maven-war-plugin</artifactId> 
>>>>>> >>      <version>2.0.1</version> 
>>>>>> >>      <configuration> 
>>>>>> >> 	 <warSourceExcludes> 
>>>>>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>>>>> >>  	</warSourceExcludes> 
>>>>>> >>      </configuration> 
>>>>>> >>     </plugin>   
>>>>>> >>    </plugins>
>>>>>> >>   </build>
>>>>>> >> 
>>>>>> >> Checkout :
>>>>>>
>>>>> http://maven.apache.org/plugins/maven-war-plugin/index.html
>>>>>> >> 
>>>>>> >> 
>>>>>> >> jiangshachina wrote:
>>>>>> >>> 
>>>>>> >>> I have another question.
>>>>>> >>> In Web application project, generally, class
>>>>>> files would be located at
>>>>>> >>> WEB-INF/classes.
>>>>>> >>> But now, I want they to be archived, and locate
>>>>>> at WEB-INF/lib.
>>>>>> >>> 
>>>>>> >>> And I want the jars could be put into different
>>>>>> sub-directory under
>>>>>> >>> WEB-INF/lib?
>>>>>> >>> 
>>>>>> >>> maven-jar-plugin or maven-war-plugin can help
>>>>>> me?
>>>>>> >>> How can I do?
>>>>>> >>> 
>>>>>> >>> 
>>>>>> >>> jiangshachina wrote:
>>>>>> >>>> 
>>>>>> >>>> Hello,
>>>>>> >>>> My web projects needs Apache
>>>>>> commons-configuration.
>>>>>> >>>> I added commons-configuration to my dependency.
>>>>>> >>>> After run "mvn package", too many jar files
>>>>>> were added into WEB-INF/lib
>>>>>> >>>> directory.
>>>>>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>>>>>> of the list, which
>>>>>> >>>> lists commons-configuration's runtime
>>>>>> dependencies, shown at home of
>>>>>> >>>> commons-collections.
>>>>>> >>>> In commons-configuration-1.2.pom, so many
>>>>>> dependencies are added.
>>>>>> >>>> 
>>>>>> >>>> How to cancel the trouble?
>>>>>> >>>> 
>>>>>> >>>> a cup of Java, cheers!
>>>>>> >>>> Sha Jiang 
>>>>>> >>>> 
>>>>>> >>> 
>>>>>> >>> 
>>>>>> >> 
>>>>>> >> 
>>>>>> > 
>>>>>> > 
>>>>>> 
>>>>>> -- 
>>>>>> View this message in context:
>>>>>>
>>>>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>>>>>> 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
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 		
>>>>> ___________________________________________________________ 
>>>>> Telefonate ohne weitere Kosten vom PC zum PC:
>>>>> http://messenger.yahoo.de
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7152009
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: Too many jars added to lib?

Posted by Dmystery <De...@infosys.com>.
This sounds strange. Is dom4j jar in your
target/webapp-1.0-SNAPSHOT/WEB-INF/lib ? if its a parent dependency then, it
should be in this folder. <warSourceExcludes> will exclude whatever jar you
specify from this folder when the plugin creates the war file, but those jar
will continue to exist in that folder.



jiangshachina wrote:
> 
> Dear Dmystery,
> The following is new pom.xml with your instructions,
> <project>
> 	<parent>
> 		<groupId>ce.demo</groupId>
> 		<artifactId>demo</artifactId>
> 		<version>1.0-SNAPSHOT</version>
> 	</parent>
> 
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>ce.demo</groupId>
> 	<artifactId>webapp</artifactId>
> 	<packaging>war</packaging>
> 	<name>Web Application Project</name>
> 
> 	<dependencies>
> 		<dependency>
> 			<groupId>ce.demo</groupId>
> 			<artifactId>app</artifactId>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.4</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>commons-configuration</groupId>
> 			<artifactId>commons-configuration</artifactId>
> 			<version>2.4</version>
> 		</dependency>
> 	</dependencies>
> 
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-war-plugin</artifactId>
> 				<version>2.0.1</version>
> 				<configuration>
> 					<warSourceExcludes>dom4j-1.4.jar</warSourceExcludes>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> But can't get result I expect.
> If change <warSourceExcludes>dom4j-1.4.jar</warSourceExcludes> to
> <warSourceExcludes>WEB-INF/lib/dom4j-1.4.jar</warSourceExcludes>, the
> result still is that.
> 
> 
> Dmystery wrote:
>> 
>> I'm not sure how you are using the plugin, but your pom.xml should read
>> like, 
>> 
>> 
>> <project>
>>   <parent>
>>     <groupId>ce.demo</groupId>
>>     <artifactId>demo</artifactId>
>>     <version>1.0-SNAPSHOT</version>
>>  </parent>
>> 
>>  <modelVersion>4.0.0</modelVersion>
>>  <groupId>ce.demo</groupId>
>>  <artifactId>webapp</artifactId>
>>  <packaging>war</packaging>
>>  <name>Web Application Project</name>
>>  <dependencies>
>>   <dependency>
>>     <groupId>ce.demo</groupId>
>>     <artifactId>app</artifactId>
>>     <version>${project.version}</version>
>>   </dependency>
>>   <dependency>
>>     <groupId>javax.servlet</groupId>
>>     <artifactId>servlet-api</artifactId>
>>     <version>2.4</version>
>>   </dependency>
>>   <dependency> 
>>     <groupId>commons-configuration</groupId>
>>     <artifactId>commons-configuration</artifactId>
>>     <version>1.2</version>
>>     <exclusions>
>>       <exclusion>
>>         <groupId>dom4j</groupId>
>>         <artifactId>dom4j</artifactId>
>>       </exclusion>
>>    </exclusions>
>>   </dependency>
>>   </dependencies>
>> 
>>   <build>
>>    <plugins>
>>     <plugin> 
>>      <groupId>org.apache.maven.plugins</groupId> 
>>      <artifactId>maven-war-plugin</artifactId> 
>>      <version>2.0.1</version> 
>>      <configuration> 
>> 	 <warSourceExcludes> 
>> 	 </warSourceExcludes> 
>>      </configuration> 
>>     </plugin>   
>>    </plugins>
>>   </build>
>> 
>> </project>
>> 
>> Do note that the plugin version is 2.0.1
>> 
>> 
>> 
>> 
>> jiangshachina wrote:
>>> 
>>> Hi,
>>> I used the following scripts(for example, I didn't want dom4j-1.4.jar),
>>> and had a success.
>>> <dependency>
>>> 	<dependency>
>>> 		<groupId>commons-configuration</groupId>
>>> 		<artifactId>commons-configuration</artifactId>
>>> 		<version>1.2</version>
>>> 		<exclusions>
>>> 			<exclusion>
>>> 				<groupId>dom4j</groupId>
>>> 				<artifactId>dom4j</artifactId>
>>> 			</exclusion>
>>> 		</exclusions>
>>> 	</dependency>
>>> </dependency>
>>> 
>>> but didn't get same result with following scripts,
>>> <build>
>>> 	<plugins>
>>> 		<plugin>
>>> 			<groupId>org.apache.maven.plugins</groupId>
>>> 			<artifactId>maven-war-plugin</artifactId>
>>> 			<version>2.0.1</version>
>>> 			<configuration>
>>> 				<warSourceExcludes>
>>> 					WEB-INF/lib/dom4j-1.4.jar
>>> 				</warSourceExcludes>
>>> 			</configuration>
>>> 		</plugin>
>>> 	</plugins>
>>> </build>
>>> And I don't find parameter "warSourceExcludes" at maven-war-plugin doc
>>> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>>> I also don't find "warSourceExcludes" at link
>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>> 
>>> Dmystery, you said all is ok in your project.
>>> Can you show your case briefly?
>>> My pom.xml is very simple, following is the all
>>> <project>
>>> 	<parent>
>>> 		<groupId>ce.demo</groupId>
>>> 		<artifactId>demo</artifactId>
>>> 		<version>1.0-SNAPSHOT</version>
>>> 	</parent>
>>> 
>>> 	<modelVersion>4.0.0</modelVersion>
>>> 	<groupId>ce.demo</groupId>
>>> 	<artifactId>webapp</artifactId>
>>> 	<packaging>war</packaging>
>>> 	<name>Web Application Project</name>
>>> 
>>> 	<dependencies>
>>> 		<dependency>
>>> 			<groupId>ce.demo</groupId>
>>> 			<artifactId>app</artifactId>
>>> 			<version>${project.version}</version>
>>> 		</dependency>
>>> 		<dependency>
>>> 			<groupId>javax.servlet</groupId>
>>> 			<artifactId>servlet-api</artifactId>
>>> 			<version>2.4</version>
>>> 		</dependency>
>>> 		<dependency>
>>> 			<groupId>commons-configuration</groupId>
>>> 			<artifactId>commons-configuration</artifactId>
>>> 			<version>1.2</version>
>>> 			<exclusions>
>>> 				<exclusion>
>>> 					<groupId>dom4j</groupId>
>>> 					<artifactId>dom4j</artifactId>
>>> 				</exclusion>
>>> 			</exclusions>
>>> 		</dependency>
>>> 	</dependencies>
>>> </project>
>>> 
>>> a cup of Java, cheers!
>>> Sha Jiang
>>> 
>>> 
>>> struberg wrote:
>>>> 
>>>> there is a syntax to exclude some transitive
>>>> dependencies from the dependency-list:
>>>> 
>>>> a small sample:
>>>>     <dependency>
>>>>       <groupId>avalon-framework</groupId>
>>>>       <artifactId>avalon-framework-api</artifactId>
>>>>       <version>4.3</version>
>>>>       <exclusions>
>>>>         <exclusion>
>>>>           <groupId>avalon-logkit</groupId>
>>>>           <artifactId>avalon-logkit</artifactId>
>>>>         </exclusion>
>>>>       </exclusions>
>>>>     </dependency>
>>>> 
>>>> I guess this may solve your problems.
>>>> 
>>>> best regards,
>>>> strub
>>>> 
>>>> --- Dmystery <De...@infosys.com> schrieb:
>>>> 
>>>>> 
>>>>> This should definitely remove all the unwanted
>>>>> dependencies. Even if they are
>>>>> dependencies of a dependency. I'm doing the same
>>>>> thing to remove all the
>>>>> unwanted files. 
>>>>> Can you post your pom.xml?
>>>>> 
>>>>> jiangshachina wrote:
>>>>> > 
>>>>> > Hi Dmystery,
>>>>> > Thanks for your help.
>>>>> > 
>>>>> > I'm sorry that I cannot success with your
>>>>> instructions.
>>>>> > And I also read the guide on maven-war-plugin,
>>>>> especially at
>>>>> >
>>>>>
>>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>>>> > Unfortunately, I don't find the answer.
>>>>> > 
>>>>> > The guide is on how to add or filter resources
>>>>> from standard/customized
>>>>> > resource paths.
>>>>> > But it's not on how to filter resources from the
>>>>> dependencies of
>>>>> > dependencies.
>>>>> > 
>>>>> > a cup of Java, cheers!
>>>>> > Sha Jiang
>>>>> > 
>>>>> > 
>>>>> > Dmystery wrote:
>>>>> >> 
>>>>> >> Use maven-war-plugin. Due to transitive
>>>>> dependencies in M2, you need to
>>>>> >> remove them using the <warSourceExcludes> tag in
>>>>> the plugin as below.
>>>>> >> 
>>>>> >>   <build>
>>>>> >>    <plugins>
>>>>> >>     <plugin> 
>>>>> >>      <groupId>org.apache.maven.plugins</groupId> 
>>>>> >>      <artifactId>maven-war-plugin</artifactId> 
>>>>> >>      <version>2.0.1</version> 
>>>>> >>      <configuration> 
>>>>> >> 	 <warSourceExcludes> 
>>>>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>>>> >>  	</warSourceExcludes> 
>>>>> >>      </configuration> 
>>>>> >>     </plugin>   
>>>>> >>    </plugins>
>>>>> >>   </build>
>>>>> >> 
>>>>> >> Checkout :
>>>>>
>>>> http://maven.apache.org/plugins/maven-war-plugin/index.html
>>>>> >> 
>>>>> >> 
>>>>> >> jiangshachina wrote:
>>>>> >>> 
>>>>> >>> I have another question.
>>>>> >>> In Web application project, generally, class
>>>>> files would be located at
>>>>> >>> WEB-INF/classes.
>>>>> >>> But now, I want they to be archived, and locate
>>>>> at WEB-INF/lib.
>>>>> >>> 
>>>>> >>> And I want the jars could be put into different
>>>>> sub-directory under
>>>>> >>> WEB-INF/lib?
>>>>> >>> 
>>>>> >>> maven-jar-plugin or maven-war-plugin can help
>>>>> me?
>>>>> >>> How can I do?
>>>>> >>> 
>>>>> >>> 
>>>>> >>> jiangshachina wrote:
>>>>> >>>> 
>>>>> >>>> Hello,
>>>>> >>>> My web projects needs Apache
>>>>> commons-configuration.
>>>>> >>>> I added commons-configuration to my dependency.
>>>>> >>>> After run "mvn package", too many jar files
>>>>> were added into WEB-INF/lib
>>>>> >>>> directory.
>>>>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>>>>> of the list, which
>>>>> >>>> lists commons-configuration's runtime
>>>>> dependencies, shown at home of
>>>>> >>>> commons-collections.
>>>>> >>>> In commons-configuration-1.2.pom, so many
>>>>> dependencies are added.
>>>>> >>>> 
>>>>> >>>> How to cancel the trouble?
>>>>> >>>> 
>>>>> >>>> a cup of Java, cheers!
>>>>> >>>> Sha Jiang 
>>>>> >>>> 
>>>>> >>> 
>>>>> >>> 
>>>>> >> 
>>>>> >> 
>>>>> > 
>>>>> > 
>>>>> 
>>>>> -- 
>>>>> View this message in context:
>>>>>
>>>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>>>>> 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
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> 		
>>>> ___________________________________________________________ 
>>>> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7151835
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Dear Dmystery,
The following is new pom.xml with your instructions,
<project>
	<parent>
		<groupId>ce.demo</groupId>
		<artifactId>demo</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<groupId>ce.demo</groupId>
	<artifactId>webapp</artifactId>
	<packaging>war</packaging>
	<name>Web Application Project</name>

	<dependencies>
		<dependency>
			<groupId>ce.demo</groupId>
			<artifactId>app</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>2.4</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>dom4j-1.4.jar</warSourceExcludes>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
But can't get result I expect.
If change <warSourceExcludes>dom4j-1.4.jar</warSourceExcludes> to
<warSourceExcludes>WEB-INF/lib/dom4j-1.4.jar</warSourceExcludes>, the result
still is that.


Dmystery wrote:
> 
> I'm not sure how you are using the plugin, but your pom.xml should read
> like, 
> 
> 
> <project>
>   <parent>
>     <groupId>ce.demo</groupId>
>     <artifactId>demo</artifactId>
>     <version>1.0-SNAPSHOT</version>
>  </parent>
> 
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>ce.demo</groupId>
>  <artifactId>webapp</artifactId>
>  <packaging>war</packaging>
>  <name>Web Application Project</name>
>  <dependencies>
>   <dependency>
>     <groupId>ce.demo</groupId>
>     <artifactId>app</artifactId>
>     <version>${project.version}</version>
>   </dependency>
>   <dependency>
>     <groupId>javax.servlet</groupId>
>     <artifactId>servlet-api</artifactId>
>     <version>2.4</version>
>   </dependency>
>   <dependency> 
>     <groupId>commons-configuration</groupId>
>     <artifactId>commons-configuration</artifactId>
>     <version>1.2</version>
>     <exclusions>
>       <exclusion>
>         <groupId>dom4j</groupId>
>         <artifactId>dom4j</artifactId>
>       </exclusion>
>    </exclusions>
>   </dependency>
>   </dependencies>
> 
>   <build>
>    <plugins>
>     <plugin> 
>      <groupId>org.apache.maven.plugins</groupId> 
>      <artifactId>maven-war-plugin</artifactId> 
>      <version>2.0.1</version> 
>      <configuration> 
> 	 <warSourceExcludes> 
> 	 </warSourceExcludes> 
>      </configuration> 
>     </plugin>   
>    </plugins>
>   </build>
> 
> </project>
> 
> Do note that the plugin version is 2.0.1
> 
> 
> 
> 
> jiangshachina wrote:
>> 
>> Hi,
>> I used the following scripts(for example, I didn't want dom4j-1.4.jar),
>> and had a success.
>> <dependency>
>> 	<dependency>
>> 		<groupId>commons-configuration</groupId>
>> 		<artifactId>commons-configuration</artifactId>
>> 		<version>1.2</version>
>> 		<exclusions>
>> 			<exclusion>
>> 				<groupId>dom4j</groupId>
>> 				<artifactId>dom4j</artifactId>
>> 			</exclusion>
>> 		</exclusions>
>> 	</dependency>
>> </dependency>
>> 
>> but didn't get same result with following scripts,
>> <build>
>> 	<plugins>
>> 		<plugin>
>> 			<groupId>org.apache.maven.plugins</groupId>
>> 			<artifactId>maven-war-plugin</artifactId>
>> 			<version>2.0.1</version>
>> 			<configuration>
>> 				<warSourceExcludes>
>> 					WEB-INF/lib/dom4j-1.4.jar
>> 				</warSourceExcludes>
>> 			</configuration>
>> 		</plugin>
>> 	</plugins>
>> </build>
>> And I don't find parameter "warSourceExcludes" at maven-war-plugin doc
>> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
>> I also don't find "warSourceExcludes" at link
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> 
>> Dmystery, you said all is ok in your project.
>> Can you show your case briefly?
>> My pom.xml is very simple, following is the all
>> <project>
>> 	<parent>
>> 		<groupId>ce.demo</groupId>
>> 		<artifactId>demo</artifactId>
>> 		<version>1.0-SNAPSHOT</version>
>> 	</parent>
>> 
>> 	<modelVersion>4.0.0</modelVersion>
>> 	<groupId>ce.demo</groupId>
>> 	<artifactId>webapp</artifactId>
>> 	<packaging>war</packaging>
>> 	<name>Web Application Project</name>
>> 
>> 	<dependencies>
>> 		<dependency>
>> 			<groupId>ce.demo</groupId>
>> 			<artifactId>app</artifactId>
>> 			<version>${project.version}</version>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>javax.servlet</groupId>
>> 			<artifactId>servlet-api</artifactId>
>> 			<version>2.4</version>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>commons-configuration</groupId>
>> 			<artifactId>commons-configuration</artifactId>
>> 			<version>1.2</version>
>> 			<exclusions>
>> 				<exclusion>
>> 					<groupId>dom4j</groupId>
>> 					<artifactId>dom4j</artifactId>
>> 				</exclusion>
>> 			</exclusions>
>> 		</dependency>
>> 	</dependencies>
>> </project>
>> 
>> a cup of Java, cheers!
>> Sha Jiang
>> 
>> 
>> struberg wrote:
>>> 
>>> there is a syntax to exclude some transitive
>>> dependencies from the dependency-list:
>>> 
>>> a small sample:
>>>     <dependency>
>>>       <groupId>avalon-framework</groupId>
>>>       <artifactId>avalon-framework-api</artifactId>
>>>       <version>4.3</version>
>>>       <exclusions>
>>>         <exclusion>
>>>           <groupId>avalon-logkit</groupId>
>>>           <artifactId>avalon-logkit</artifactId>
>>>         </exclusion>
>>>       </exclusions>
>>>     </dependency>
>>> 
>>> I guess this may solve your problems.
>>> 
>>> best regards,
>>> strub
>>> 
>>> --- Dmystery <De...@infosys.com> schrieb:
>>> 
>>>> 
>>>> This should definitely remove all the unwanted
>>>> dependencies. Even if they are
>>>> dependencies of a dependency. I'm doing the same
>>>> thing to remove all the
>>>> unwanted files. 
>>>> Can you post your pom.xml?
>>>> 
>>>> jiangshachina wrote:
>>>> > 
>>>> > Hi Dmystery,
>>>> > Thanks for your help.
>>>> > 
>>>> > I'm sorry that I cannot success with your
>>>> instructions.
>>>> > And I also read the guide on maven-war-plugin,
>>>> especially at
>>>> >
>>>>
>>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>>> > Unfortunately, I don't find the answer.
>>>> > 
>>>> > The guide is on how to add or filter resources
>>>> from standard/customized
>>>> > resource paths.
>>>> > But it's not on how to filter resources from the
>>>> dependencies of
>>>> > dependencies.
>>>> > 
>>>> > a cup of Java, cheers!
>>>> > Sha Jiang
>>>> > 
>>>> > 
>>>> > Dmystery wrote:
>>>> >> 
>>>> >> Use maven-war-plugin. Due to transitive
>>>> dependencies in M2, you need to
>>>> >> remove them using the <warSourceExcludes> tag in
>>>> the plugin as below.
>>>> >> 
>>>> >>   <build>
>>>> >>    <plugins>
>>>> >>     <plugin> 
>>>> >>      <groupId>org.apache.maven.plugins</groupId> 
>>>> >>      <artifactId>maven-war-plugin</artifactId> 
>>>> >>      <version>2.0.1</version> 
>>>> >>      <configuration> 
>>>> >> 	 <warSourceExcludes> 
>>>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>>> >>  	</warSourceExcludes> 
>>>> >>      </configuration> 
>>>> >>     </plugin>   
>>>> >>    </plugins>
>>>> >>   </build>
>>>> >> 
>>>> >> Checkout :
>>>>
>>> http://maven.apache.org/plugins/maven-war-plugin/index.html
>>>> >> 
>>>> >> 
>>>> >> jiangshachina wrote:
>>>> >>> 
>>>> >>> I have another question.
>>>> >>> In Web application project, generally, class
>>>> files would be located at
>>>> >>> WEB-INF/classes.
>>>> >>> But now, I want they to be archived, and locate
>>>> at WEB-INF/lib.
>>>> >>> 
>>>> >>> And I want the jars could be put into different
>>>> sub-directory under
>>>> >>> WEB-INF/lib?
>>>> >>> 
>>>> >>> maven-jar-plugin or maven-war-plugin can help
>>>> me?
>>>> >>> How can I do?
>>>> >>> 
>>>> >>> 
>>>> >>> jiangshachina wrote:
>>>> >>>> 
>>>> >>>> Hello,
>>>> >>>> My web projects needs Apache
>>>> commons-configuration.
>>>> >>>> I added commons-configuration to my dependency.
>>>> >>>> After run "mvn package", too many jar files
>>>> were added into WEB-INF/lib
>>>> >>>> directory.
>>>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>>>> of the list, which
>>>> >>>> lists commons-configuration's runtime
>>>> dependencies, shown at home of
>>>> >>>> commons-collections.
>>>> >>>> In commons-configuration-1.2.pom, so many
>>>> dependencies are added.
>>>> >>>> 
>>>> >>>> How to cancel the trouble?
>>>> >>>> 
>>>> >>>> a cup of Java, cheers!
>>>> >>>> Sha Jiang 
>>>> >>>> 
>>>> >>> 
>>>> >>> 
>>>> >> 
>>>> >> 
>>>> > 
>>>> > 
>>>> 
>>>> -- 
>>>> View this message in context:
>>>>
>>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>>>> 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
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> 		
>>> ___________________________________________________________ 
>>> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7151476
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: Too many jars added to lib?

Posted by Dmystery <De...@infosys.com>.
I'm not sure how you are using the plugin, but your pom.xml should read like, 


<project>
  <parent>
    <groupId>ce.demo</groupId>
    <artifactId>demo</artifactId>
    <version>1.0-SNAPSHOT</version>
 </parent>

 <modelVersion>4.0.0</modelVersion>
 <groupId>ce.demo</groupId>
 <artifactId>webapp</artifactId>
 <packaging>war</packaging>
 <name>Web Application Project</name>
 <dependencies>
  <dependency>
    <groupId>ce.demo</groupId>
    <artifactId>app</artifactId>
    <version>${project.version}</version>
  </dependency>
  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.4</version>
  </dependency>
  <dependency> 
    <groupId>commons-configuration</groupId>
    <artifactId>commons-configuration</artifactId>
    <version>1.2</version>
    <exclusions>
      <exclusion>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
      </exclusion>
   </exclusions>
  </dependency>
  </dependencies>

  <build>
   <plugins>
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.0.1</version> 
     <configuration> 
	 <warSourceExcludes> 
	 </warSourceExcludes> 
     </configuration> 
    </plugin>   
   </plugins>
  </build>

</project>

Do note that the plugin version is 2.0.1




jiangshachina wrote:
> 
> Hi,
> I used the following scripts(for example, I didn't want dom4j-1.4.jar),
> and had a success.
> <dependency>
> 	<dependency>
> 		<groupId>commons-configuration</groupId>
> 		<artifactId>commons-configuration</artifactId>
> 		<version>1.2</version>
> 		<exclusions>
> 			<exclusion>
> 				<groupId>dom4j</groupId>
> 				<artifactId>dom4j</artifactId>
> 			</exclusion>
> 		</exclusions>
> 	</dependency>
> </dependency>
> 
> but didn't get same result with following scripts,
> <build>
> 	<plugins>
> 		<plugin>
> 			<groupId>org.apache.maven.plugins</groupId>
> 			<artifactId>maven-war-plugin</artifactId>
> 			<version>2.0.1</version>
> 			<configuration>
> 				<warSourceExcludes>
> 					WEB-INF/lib/dom4j-1.4.jar
> 				</warSourceExcludes>
> 			</configuration>
> 		</plugin>
> 	</plugins>
> </build>
> And I don't find parameter "warSourceExcludes" at maven-war-plugin doc
> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
> I also don't find "warSourceExcludes" at link
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> 
> Dmystery, you said all is ok in your project.
> Can you show your case briefly?
> My pom.xml is very simple, following is the all
> <project>
> 	<parent>
> 		<groupId>ce.demo</groupId>
> 		<artifactId>demo</artifactId>
> 		<version>1.0-SNAPSHOT</version>
> 	</parent>
> 
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>ce.demo</groupId>
> 	<artifactId>webapp</artifactId>
> 	<packaging>war</packaging>
> 	<name>Web Application Project</name>
> 
> 	<dependencies>
> 		<dependency>
> 			<groupId>ce.demo</groupId>
> 			<artifactId>app</artifactId>
> 			<version>${project.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.4</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>commons-configuration</groupId>
> 			<artifactId>commons-configuration</artifactId>
> 			<version>1.2</version>
> 			<exclusions>
> 				<exclusion>
> 					<groupId>dom4j</groupId>
> 					<artifactId>dom4j</artifactId>
> 				</exclusion>
> 			</exclusions>
> 		</dependency>
> 	</dependencies>
> </project>
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 
> struberg wrote:
>> 
>> there is a syntax to exclude some transitive
>> dependencies from the dependency-list:
>> 
>> a small sample:
>>     <dependency>
>>       <groupId>avalon-framework</groupId>
>>       <artifactId>avalon-framework-api</artifactId>
>>       <version>4.3</version>
>>       <exclusions>
>>         <exclusion>
>>           <groupId>avalon-logkit</groupId>
>>           <artifactId>avalon-logkit</artifactId>
>>         </exclusion>
>>       </exclusions>
>>     </dependency>
>> 
>> I guess this may solve your problems.
>> 
>> best regards,
>> strub
>> 
>> --- Dmystery <De...@infosys.com> schrieb:
>> 
>>> 
>>> This should definitely remove all the unwanted
>>> dependencies. Even if they are
>>> dependencies of a dependency. I'm doing the same
>>> thing to remove all the
>>> unwanted files. 
>>> Can you post your pom.xml?
>>> 
>>> jiangshachina wrote:
>>> > 
>>> > Hi Dmystery,
>>> > Thanks for your help.
>>> > 
>>> > I'm sorry that I cannot success with your
>>> instructions.
>>> > And I also read the guide on maven-war-plugin,
>>> especially at
>>> >
>>>
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>>> > Unfortunately, I don't find the answer.
>>> > 
>>> > The guide is on how to add or filter resources
>>> from standard/customized
>>> > resource paths.
>>> > But it's not on how to filter resources from the
>>> dependencies of
>>> > dependencies.
>>> > 
>>> > a cup of Java, cheers!
>>> > Sha Jiang
>>> > 
>>> > 
>>> > Dmystery wrote:
>>> >> 
>>> >> Use maven-war-plugin. Due to transitive
>>> dependencies in M2, you need to
>>> >> remove them using the <warSourceExcludes> tag in
>>> the plugin as below.
>>> >> 
>>> >>   <build>
>>> >>    <plugins>
>>> >>     <plugin> 
>>> >>      <groupId>org.apache.maven.plugins</groupId> 
>>> >>      <artifactId>maven-war-plugin</artifactId> 
>>> >>      <version>2.0.1</version> 
>>> >>      <configuration> 
>>> >> 	 <warSourceExcludes> 
>>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>> >>  	</warSourceExcludes> 
>>> >>      </configuration> 
>>> >>     </plugin>   
>>> >>    </plugins>
>>> >>   </build>
>>> >> 
>>> >> Checkout :
>>>
>> http://maven.apache.org/plugins/maven-war-plugin/index.html
>>> >> 
>>> >> 
>>> >> jiangshachina wrote:
>>> >>> 
>>> >>> I have another question.
>>> >>> In Web application project, generally, class
>>> files would be located at
>>> >>> WEB-INF/classes.
>>> >>> But now, I want they to be archived, and locate
>>> at WEB-INF/lib.
>>> >>> 
>>> >>> And I want the jars could be put into different
>>> sub-directory under
>>> >>> WEB-INF/lib?
>>> >>> 
>>> >>> maven-jar-plugin or maven-war-plugin can help
>>> me?
>>> >>> How can I do?
>>> >>> 
>>> >>> 
>>> >>> jiangshachina wrote:
>>> >>>> 
>>> >>>> Hello,
>>> >>>> My web projects needs Apache
>>> commons-configuration.
>>> >>>> I added commons-configuration to my dependency.
>>> >>>> After run "mvn package", too many jar files
>>> were added into WEB-INF/lib
>>> >>>> directory.
>>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>>> of the list, which
>>> >>>> lists commons-configuration's runtime
>>> dependencies, shown at home of
>>> >>>> commons-collections.
>>> >>>> In commons-configuration-1.2.pom, so many
>>> dependencies are added.
>>> >>>> 
>>> >>>> How to cancel the trouble?
>>> >>>> 
>>> >>>> a cup of Java, cheers!
>>> >>>> Sha Jiang 
>>> >>>> 
>>> >>> 
>>> >>> 
>>> >> 
>>> >> 
>>> > 
>>> > 
>>> 
>>> -- 
>>> View this message in context:
>>>
>> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>>> 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
>>> 
>>> 
>> 
>> 
>> 
>> 		
>> ___________________________________________________________ 
>> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7151398
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Hi,
I used the following scripts(for example, I didn't want dom4j-1.4.jar), and
had a success.
<dependency>
	<dependency>
		<groupId>commons-configuration</groupId>
		<artifactId>commons-configuration</artifactId>
		<version>1.2</version>
		<exclusions>
			<exclusion>
				<groupId>dom4j</groupId>
				<artifactId>dom4j</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
</dependency>

but didn't get same result with following scripts,
<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-war-plugin</artifactId>
			<version>2.0.1</version>
			<configuration>
				<warSourceExcludes>
					WEB-INF/lib/dom4j-1.4.jar
				</warSourceExcludes>
			</configuration>
		</plugin>
	</plugins>
</build>
And I don't find parameter "warSourceExcludes" at maven-war-plugin doc
http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
I also don't find "warSourceExcludes" at link
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html

Dmystery, you said all is ok in your project.
Can you show your case briefly?
My pom.xml is very simple, following is the all
<project>
	<parent>
		<groupId>ce.demo</groupId>
		<artifactId>demo</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<groupId>ce.demo</groupId>
	<artifactId>webapp</artifactId>
	<packaging>war</packaging>
	<name>Web Application Project</name>

	<dependencies>
		<dependency>
			<groupId>ce.demo</groupId>
			<artifactId>app</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>1.2</version>
			<exclusions>
				<exclusion>
					<groupId>dom4j</groupId>
					<artifactId>dom4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
</project>

a cup of Java, cheers!
Sha Jiang


struberg wrote:
> 
> there is a syntax to exclude some transitive
> dependencies from the dependency-list:
> 
> a small sample:
>     <dependency>
>       <groupId>avalon-framework</groupId>
>       <artifactId>avalon-framework-api</artifactId>
>       <version>4.3</version>
>       <exclusions>
>         <exclusion>
>           <groupId>avalon-logkit</groupId>
>           <artifactId>avalon-logkit</artifactId>
>         </exclusion>
>       </exclusions>
>     </dependency>
> 
> I guess this may solve your problems.
> 
> best regards,
> strub
> 
> --- Dmystery <De...@infosys.com> schrieb:
> 
>> 
>> This should definitely remove all the unwanted
>> dependencies. Even if they are
>> dependencies of a dependency. I'm doing the same
>> thing to remove all the
>> unwanted files. 
>> Can you post your pom.xml?
>> 
>> jiangshachina wrote:
>> > 
>> > Hi Dmystery,
>> > Thanks for your help.
>> > 
>> > I'm sorry that I cannot success with your
>> instructions.
>> > And I also read the guide on maven-war-plugin,
>> especially at
>> >
>>
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> > Unfortunately, I don't find the answer.
>> > 
>> > The guide is on how to add or filter resources
>> from standard/customized
>> > resource paths.
>> > But it's not on how to filter resources from the
>> dependencies of
>> > dependencies.
>> > 
>> > a cup of Java, cheers!
>> > Sha Jiang
>> > 
>> > 
>> > Dmystery wrote:
>> >> 
>> >> Use maven-war-plugin. Due to transitive
>> dependencies in M2, you need to
>> >> remove them using the <warSourceExcludes> tag in
>> the plugin as below.
>> >> 
>> >>   <build>
>> >>    <plugins>
>> >>     <plugin> 
>> >>      <groupId>org.apache.maven.plugins</groupId> 
>> >>      <artifactId>maven-war-plugin</artifactId> 
>> >>      <version>2.0.1</version> 
>> >>      <configuration> 
>> >> 	 <warSourceExcludes> 
>> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>> >>  	</warSourceExcludes> 
>> >>      </configuration> 
>> >>     </plugin>   
>> >>    </plugins>
>> >>   </build>
>> >> 
>> >> Checkout :
>>
> http://maven.apache.org/plugins/maven-war-plugin/index.html
>> >> 
>> >> 
>> >> jiangshachina wrote:
>> >>> 
>> >>> I have another question.
>> >>> In Web application project, generally, class
>> files would be located at
>> >>> WEB-INF/classes.
>> >>> But now, I want they to be archived, and locate
>> at WEB-INF/lib.
>> >>> 
>> >>> And I want the jars could be put into different
>> sub-directory under
>> >>> WEB-INF/lib?
>> >>> 
>> >>> maven-jar-plugin or maven-war-plugin can help
>> me?
>> >>> How can I do?
>> >>> 
>> >>> 
>> >>> jiangshachina wrote:
>> >>>> 
>> >>>> Hello,
>> >>>> My web projects needs Apache
>> commons-configuration.
>> >>>> I added commons-configuration to my dependency.
>> >>>> After run "mvn package", too many jar files
>> were added into WEB-INF/lib
>> >>>> directory.
>> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
>> of the list, which
>> >>>> lists commons-configuration's runtime
>> dependencies, shown at home of
>> >>>> commons-collections.
>> >>>> In commons-configuration-1.2.pom, so many
>> dependencies are added.
>> >>>> 
>> >>>> How to cancel the trouble?
>> >>>> 
>> >>>> a cup of Java, cheers!
>> >>>> Sha Jiang 
>> >>>> 
>> >>> 
>> >>> 
>> >> 
>> >> 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
>> 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
>> 
>> 
> 
> 
> 
> 		
> ___________________________________________________________ 
> Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7149812
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: Too many jars added to lib?

Posted by Mark Struberg <st...@yahoo.de>.
there is a syntax to exclude some transitive
dependencies from the dependency-list:

a small sample:
    <dependency>
      <groupId>avalon-framework</groupId>
      <artifactId>avalon-framework-api</artifactId>
      <version>4.3</version>
      <exclusions>
        <exclusion>
          <groupId>avalon-logkit</groupId>
          <artifactId>avalon-logkit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

I guess this may solve your problems.

best regards,
strub

--- Dmystery <De...@infosys.com> schrieb:

> 
> This should definitely remove all the unwanted
> dependencies. Even if they are
> dependencies of a dependency. I'm doing the same
> thing to remove all the
> unwanted files. 
> Can you post your pom.xml?
> 
> jiangshachina wrote:
> > 
> > Hi Dmystery,
> > Thanks for your help.
> > 
> > I'm sorry that I cannot success with your
> instructions.
> > And I also read the guide on maven-war-plugin,
> especially at
> >
>
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> > Unfortunately, I don't find the answer.
> > 
> > The guide is on how to add or filter resources
> from standard/customized
> > resource paths.
> > But it's not on how to filter resources from the
> dependencies of
> > dependencies.
> > 
> > a cup of Java, cheers!
> > Sha Jiang
> > 
> > 
> > Dmystery wrote:
> >> 
> >> Use maven-war-plugin. Due to transitive
> dependencies in M2, you need to
> >> remove them using the <warSourceExcludes> tag in
> the plugin as below.
> >> 
> >>   <build>
> >>    <plugins>
> >>     <plugin> 
> >>      <groupId>org.apache.maven.plugins</groupId> 
> >>      <artifactId>maven-war-plugin</artifactId> 
> >>      <version>2.0.1</version> 
> >>      <configuration> 
> >> 	 <warSourceExcludes> 
> >> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
> >>  	</warSourceExcludes> 
> >>      </configuration> 
> >>     </plugin>   
> >>    </plugins>
> >>   </build>
> >> 
> >> Checkout :
>
http://maven.apache.org/plugins/maven-war-plugin/index.html
> >> 
> >> 
> >> jiangshachina wrote:
> >>> 
> >>> I have another question.
> >>> In Web application project, generally, class
> files would be located at
> >>> WEB-INF/classes.
> >>> But now, I want they to be archived, and locate
> at WEB-INF/lib.
> >>> 
> >>> And I want the jars could be put into different
> sub-directory under
> >>> WEB-INF/lib?
> >>> 
> >>> maven-jar-plugin or maven-war-plugin can help
> me?
> >>> How can I do?
> >>> 
> >>> 
> >>> jiangshachina wrote:
> >>>> 
> >>>> Hello,
> >>>> My web projects needs Apache
> commons-configuration.
> >>>> I added commons-configuration to my dependency.
> >>>> After run "mvn package", too many jar files
> were added into WEB-INF/lib
> >>>> directory.
> >>>> But I found many jars(e.g. xalan-2.7.0.jar) out
> of the list, which
> >>>> lists commons-configuration's runtime
> dependencies, shown at home of
> >>>> commons-collections.
> >>>> In commons-configuration-1.2.pom, so many
> dependencies are added.
> >>>> 
> >>>> How to cancel the trouble?
> >>>> 
> >>>> a cup of Java, cheers!
> >>>> Sha Jiang 
> >>>> 
> >>> 
> >>> 
> >> 
> >> 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
> 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
> 
> 



		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

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


Re: Too many jars added to lib?

Posted by Dmystery <De...@infosys.com>.
This should definitely remove all the unwanted dependencies. Even if they are
dependencies of a dependency. I'm doing the same thing to remove all the
unwanted files. 
Can you post your pom.xml?

jiangshachina wrote:
> 
> Hi Dmystery,
> Thanks for your help.
> 
> I'm sorry that I cannot success with your instructions.
> And I also read the guide on maven-war-plugin, especially at
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> Unfortunately, I don't find the answer.
> 
> The guide is on how to add or filter resources from standard/customized
> resource paths.
> But it's not on how to filter resources from the dependencies of
> dependencies.
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 
> Dmystery wrote:
>> 
>> Use maven-war-plugin. Due to transitive dependencies in M2, you need to
>> remove them using the <warSourceExcludes> tag in the plugin as below.
>> 
>>   <build>
>>    <plugins>
>>     <plugin> 
>>      <groupId>org.apache.maven.plugins</groupId> 
>>      <artifactId>maven-war-plugin</artifactId> 
>>      <version>2.0.1</version> 
>>      <configuration> 
>> 	 <warSourceExcludes> 
>> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>>  	</warSourceExcludes> 
>>      </configuration> 
>>     </plugin>   
>>    </plugins>
>>   </build>
>> 
>> Checkout : http://maven.apache.org/plugins/maven-war-plugin/index.html
>> 
>> 
>> jiangshachina wrote:
>>> 
>>> I have another question.
>>> In Web application project, generally, class files would be located at
>>> WEB-INF/classes.
>>> But now, I want they to be archived, and locate at WEB-INF/lib.
>>> 
>>> And I want the jars could be put into different sub-directory under
>>> WEB-INF/lib?
>>> 
>>> maven-jar-plugin or maven-war-plugin can help me?
>>> How can I do?
>>> 
>>> 
>>> jiangshachina wrote:
>>>> 
>>>> Hello,
>>>> My web projects needs Apache commons-configuration.
>>>> I added commons-configuration to my dependency.
>>>> After run "mvn package", too many jar files were added into WEB-INF/lib
>>>> directory.
>>>> But I found many jars(e.g. xalan-2.7.0.jar) out of the list, which
>>>> lists commons-configuration's runtime dependencies, shown at home of
>>>> commons-collections.
>>>> In commons-configuration-1.2.pom, so many dependencies are added.
>>>> 
>>>> How to cancel the trouble?
>>>> 
>>>> a cup of Java, cheers!
>>>> Sha Jiang 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7131903
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
Hi Dmystery,
Thanks for your help.

I'm sorry that I cannot success with your instructions.
And I also read the guide on maven-war-plugin, especially at
http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
Unfortunately, I don't find the answer.

The guide is on how to add or filter resources from standard/customized
resource paths.
But it's not on how to filter resources from the dependencies of
dependencies.

a cup of Java, cheers!
Sha Jiang


Dmystery wrote:
> 
> Use maven-war-plugin. Due to transitive dependencies in M2, you need to
> remove them using the <warSourceExcludes> tag in the plugin as below.
> 
>   <build>
>    <plugins>
>     <plugin> 
>      <groupId>org.apache.maven.plugins</groupId> 
>      <artifactId>maven-war-plugin</artifactId> 
>      <version>2.0.1</version> 
>      <configuration> 
> 	 <warSourceExcludes> 
> 	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
>  	</warSourceExcludes> 
>      </configuration> 
>     </plugin>   
>    </plugins>
>   </build>
> 
> Checkout : http://maven.apache.org/plugins/maven-war-plugin/index.html
> 
> 
> jiangshachina wrote:
>> 
>> I have another question.
>> In Web application project, generally, class files would be located at
>> WEB-INF/classes.
>> But now, I want they to be archived, and locate at WEB-INF/lib.
>> 
>> And I want the jars could be put into different sub-directory under
>> WEB-INF/lib?
>> 
>> maven-jar-plugin or maven-war-plugin can help me?
>> How can I do?
>> 
>> 
>> jiangshachina wrote:
>>> 
>>> Hello,
>>> My web projects needs Apache commons-configuration.
>>> I added commons-configuration to my dependency.
>>> After run "mvn package", too many jar files were added into WEB-INF/lib
>>> directory.
>>> But I found many jars(e.g. xalan-2.7.0.jar) out of the list, which lists
>>> commons-configuration's runtime dependencies, shown at home of
>>> commons-collections.
>>> In commons-configuration-1.2.pom, so many dependencies are added.
>>> 
>>> How to cancel the trouble?
>>> 
>>> a cup of Java, cheers!
>>> Sha Jiang 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7130272
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: Too many jars added to lib?

Posted by Dmystery <De...@infosys.com>.
Use maven-war-plugin. Due to transitive dependencies in M2, you need to
remove them using the <warSourceExcludes> tag in the plugin as below.

  <build>
   <plugins>
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.0.1</version> 
     <configuration> 
	 <warSourceExcludes> 
	 	WEB-INF/lib/jar1,WEB-INF/lib/jar2,
 	</warSourceExcludes> 
     </configuration> 
    </plugin>   
   </plugins>
  </build>

Checkout : http://maven.apache.org/plugins/maven-war-plugin/index.html


jiangshachina wrote:
> 
> I have another question.
> In Web application project, generally, class files would be located at
> WEB-INF/classes.
> But now, I want they to be archived, and locate at WEB-INF/lib.
> 
> And I want the jars could be put into different sub-directory under
> WEB-INF/lib?
> 
> maven-jar-plugin or maven-war-plugin can help me?
> How can I do?
> 
> 
> jiangshachina wrote:
>> 
>> Hello,
>> My web projects needs Apache commons-configuration.
>> I added commons-configuration to my dependency.
>> After run "mvn package", too many jar files were added into WEB-INF/lib
>> directory.
>> But I found many jars(e.g. xalan-2.7.0.jar) out of the list, which lists
>> commons-configuration's runtime dependencies, shown at home of
>> commons-collections.
>> In commons-configuration-1.2.pom, so many dependencies are added.
>> 
>> How to cancel the trouble?
>> 
>> a cup of Java, cheers!
>> Sha Jiang 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7129610
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: Too many jars added to lib?

Posted by jiangshachina <ji...@gmail.com>.
I have another question.
In Web application project, generally, class files would be located at
WEB-INF/classes.
But now, I want they to be archived, and locate at WEB-INF/lib.

And I want the jars could be put into different sub-directory under
WEB-INF/lib?

maven-jar-plugin or maven-war-plugin can help me?
How can I do?


jiangshachina wrote:
> 
> Hello,
> My web projects needs Apache commons-configuration.
> I added commons-configuration to my dependency.
> After run "mvn package", too many jar files were added into WEB-INF/lib
> directory.
> But I found many jars(e.g. xalan-2.7.0.jar) out of the list, which lists
> commons-configuration's runtime dependencies, shown at home of
> commons-collections.
> In commons-configuration-1.2.pom, so many dependencies are added.
> 
> How to cancel the trouble?
> 
> a cup of Java, cheers!
> Sha Jiang 
> 

-- 
View this message in context: http://www.nabble.com/Too-many-jars-added-to-lib--tf2558368s177.html#a7129543
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