You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Shelli Orton <Sh...@sjrb.ca> on 2010/04/30 23:11:08 UTC
How To Determine/Exclude Transitive Dependencies
I am new to Maven and am trying to understand transitive dependencies
and how to exclude them from my war.
For example, in my war file, FastInfoset-1.2.2.jar file is included. I
do not have it listed as a dependency in my POM, so it must be a
transitive dependency. I ran mvn with the -X parameter and saved the
output to a file to see if I could glean which dependency is the
"mother" dependency.
The first time FastInfoset is noted in the output follows:
[WARNING]
Artifact javax.servlet:servlet-api:jar:2.4:provided
retains local scope 'provided' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify
or remove the local scope.
[DEBUG] javax.servlet:servlet-api:jar:2.3:compile (removed -
nearer found: 2.4)
[DEBUG] commons-logging:commons-logging-api:jar:1.1:compile
(selected for compile)
[DEBUG] javax.el:el-api:jar:1.0:compile (selected for compile)
[DEBUG] com.sun.xml.fastinfoset:FastInfoset:jar:1.2.2:compile
(selected for compile)
Does this mean that it is a transitive dependency of the
servlet-api.jar? If not, how can I determine which dependency this is a
transitive one of?
In my POM.xml, here is the servlet-api dependency:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
The servlet-api.jar is not included in my war (as expected). Do I have
to add exclusions to this dependency for all its transitive
dependencies? I would have expected that transitive dependencies would
be included/excluded as per the mother dependency.
Thanks in advance!
RE: How To Determine/Exclude Transitive Dependencies
Posted by Shelli Orton <Sh...@sjrb.ca>.
Thanks!
That makes so much more sense. :)
Shelli
-----Original Message-----
From: Jörg Schaible [mailto:joerg.schaible@gmx.de]
Sent: Friday, April 30, 2010 3:16 PM
To: users@maven.apache.org
Subject: Re: How To Determine/Exclude Transitive Dependencies
Shelli Orton wrote:
> I am new to Maven and am trying to understand transitive dependencies
> and how to exclude them from my war.
>
>
>
> For example, in my war file, FastInfoset-1.2.2.jar file is included. I
> do not have it listed as a dependency in my POM, so it must be a
> transitive dependency. I ran mvn with the -X parameter and saved the
> output to a file to see if I could glean which dependency is the
> "mother" dependency.
-X is useful for debugging if a process fails. For simple dependency
checking, use "mvn dependency:tree"
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How To Determine/Exclude Transitive Dependencies
Posted by Jörg Schaible <jo...@gmx.de>.
Shelli Orton wrote:
> I am new to Maven and am trying to understand transitive dependencies
> and how to exclude them from my war.
>
>
>
> For example, in my war file, FastInfoset-1.2.2.jar file is included. I
> do not have it listed as a dependency in my POM, so it must be a
> transitive dependency. I ran mvn with the -X parameter and saved the
> output to a file to see if I could glean which dependency is the
> "mother" dependency.
-X is useful for debugging if a process fails. For simple dependency
checking, use "mvn dependency:tree"
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Missing archetype.xml in new archetype created from project
Posted by Shelli Orton <Sh...@sjrb.ca>.
Well, to partially answer one of my questions, it appears I need to fix all my xml config files where the create archetype process changed all references to "<?xml version="1.0" encoding="UTF-8"?>" to "<?xml version="${version}" encoding="UTF-8"?>"
:(
-----Original Message-----
From: Shelli Orton
Sent: Monday, May 10, 2010 3:06 PM
To: Maven Users List
Subject: RE: Missing archetype.xml in new archetype created from project
Thanks for the link. Unfortunately it didn't help with my understanding of how to create an archetype or the structure of one.
I'm using Maven 2.2.1.
I set up a skeleton project (MyProject) that I want to use to create the archetype (minimal classes, mainly config files and the pom.xml set up with the dependencies). Everything in my project is contained in the MyProject/src directory except for its pom.xml which is under MyProject.
I ran the archetype:create-from-project command for the project. I now have a new " target\generated-sources\archetype" directory in my project directory which has a pom.xml file in it. The pom.xml has an artifactId of "Project-archetype" and a a packaging of "maven-archetype".
It also has two sub-directories:
MyProject\target\generated-sources\archetype\src
MyProject\target\generated-sources\archetype\target
Both of these subdirectories contains a pom.xml and an archetype-metadata.xml which are identical.
What exactly is the archetype? Everything under the MyProject\target directory or one of these directories:
MyProject\target\generated-sources\archetype\
MyProject\target\generated-sources\archetype\src
MyProject\target\generated-sources\archetype\target
Do I need to update any files before installing the archetype? If so which ones?
Thanks in advance for all help.
Shelli
-----Original Message-----
From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
Sent: Thursday, May 06, 2010 1:54 PM
To: Maven Users List
Subject: Re: Missing archetype.xml in new archetype created from project
perhaps http://maven.apache.org/guides/mini/guide-creating-archetypes.html
will help you
It has been written for 1.x (old) archetype, but principles are the same
Regards,
Hervé
Le mercredi 05 mai 2010, Shelli Orton a écrit :
> Thank you.
>
> Is there any documentation (online or paper) that is better than what's in
> the Maven documentation
> (http://maven.apache.org/archetype/maven-archetype-plugin/create-from-proj
> ect-mojo.html and
> http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.ht
> ml)? Something that includes some explanation as to what is being
> done/created and why? For someone new to Maven, most of the documentation
> is very cryptic.
>
> Thanks again!
>
> -----Original Message-----
> From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
> Sent: Wednesday, May 05, 2010 3:37 PM
> To: Maven Users List
> Subject: Re: Missing archetype.xml in new archetype created from project
>
> see http://jira.codehaus.org/browse/ARCHETYPE-292
>
> archetype.xml is "old" archetype descriptor
>
> Regards,
>
> Hervé
>
> Le mercredi 05 mai 2010, Shelli Orton a écrit :
> > Hi,
> >
> > I am using Maven 2.2.1. and am new to Maven. I am trying to create an
> > archetype based on an existing project. I have been using this blog post
> > as a guide: http://blog.inflinx.com/category/m2eclipse/
> >
> > Step 7 says "The next step is to verify that the generated archetype.xml
> > (located under srcmainresourcesMETA-INFmaven (sic)) has all the files
> > listed and they are located in the right directories."
> >
> > My generated archetype does not have an archetype.xml. It does have an
> > archetype-metadata.xml file though. There aren't any errors in the
> > output from calling archetype:create-from-project, just a couple of
> > warnings about using platform encoding (Cp1252).
> >
> > Any thoughts on why this file wasn't generated?
> >
> > Thanks in advance!
> >
> > Shelli
> >
> > ---------------------------------------------------------------------
> > 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
---------------------------------------------------------------------
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: Missing archetype.xml in new archetype created from project
Posted by Shelli Orton <Sh...@sjrb.ca>.
Thanks for the link. Unfortunately it didn't help with my understanding of how to create an archetype or the structure of one.
I'm using Maven 2.2.1.
I set up a skeleton project (MyProject) that I want to use to create the archetype (minimal classes, mainly config files and the pom.xml set up with the dependencies). Everything in my project is contained in the MyProject/src directory except for its pom.xml which is under MyProject.
I ran the archetype:create-from-project command for the project. I now have a new " target\generated-sources\archetype" directory in my project directory which has a pom.xml file in it. The pom.xml has an artifactId of "Project-archetype" and a a packaging of "maven-archetype".
It also has two sub-directories:
MyProject\target\generated-sources\archetype\src
MyProject\target\generated-sources\archetype\target
Both of these subdirectories contains a pom.xml and an archetype-metadata.xml which are identical.
What exactly is the archetype? Everything under the MyProject\target directory or one of these directories:
MyProject\target\generated-sources\archetype\
MyProject\target\generated-sources\archetype\src
MyProject\target\generated-sources\archetype\target
Do I need to update any files before installing the archetype? If so which ones?
Thanks in advance for all help.
Shelli
-----Original Message-----
From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
Sent: Thursday, May 06, 2010 1:54 PM
To: Maven Users List
Subject: Re: Missing archetype.xml in new archetype created from project
perhaps http://maven.apache.org/guides/mini/guide-creating-archetypes.html
will help you
It has been written for 1.x (old) archetype, but principles are the same
Regards,
Hervé
Le mercredi 05 mai 2010, Shelli Orton a écrit :
> Thank you.
>
> Is there any documentation (online or paper) that is better than what's in
> the Maven documentation
> (http://maven.apache.org/archetype/maven-archetype-plugin/create-from-proj
> ect-mojo.html and
> http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.ht
> ml)? Something that includes some explanation as to what is being
> done/created and why? For someone new to Maven, most of the documentation
> is very cryptic.
>
> Thanks again!
>
> -----Original Message-----
> From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
> Sent: Wednesday, May 05, 2010 3:37 PM
> To: Maven Users List
> Subject: Re: Missing archetype.xml in new archetype created from project
>
> see http://jira.codehaus.org/browse/ARCHETYPE-292
>
> archetype.xml is "old" archetype descriptor
>
> Regards,
>
> Hervé
>
> Le mercredi 05 mai 2010, Shelli Orton a écrit :
> > Hi,
> >
> > I am using Maven 2.2.1. and am new to Maven. I am trying to create an
> > archetype based on an existing project. I have been using this blog post
> > as a guide: http://blog.inflinx.com/category/m2eclipse/
> >
> > Step 7 says "The next step is to verify that the generated archetype.xml
> > (located under srcmainresourcesMETA-INFmaven (sic)) has all the files
> > listed and they are located in the right directories."
> >
> > My generated archetype does not have an archetype.xml. It does have an
> > archetype-metadata.xml file though. There aren't any errors in the
> > output from calling archetype:create-from-project, just a couple of
> > warnings about using platform encoding (Cp1252).
> >
> > Any thoughts on why this file wasn't generated?
> >
> > Thanks in advance!
> >
> > Shelli
> >
> > ---------------------------------------------------------------------
> > 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
---------------------------------------------------------------------
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: Missing archetype.xml in new archetype created from project
Posted by Hervé BOUTEMY <he...@free.fr>.
perhaps http://maven.apache.org/guides/mini/guide-creating-archetypes.html
will help you
It has been written for 1.x (old) archetype, but principles are the same
Regards,
Hervé
Le mercredi 05 mai 2010, Shelli Orton a écrit :
> Thank you.
>
> Is there any documentation (online or paper) that is better than what's in
> the Maven documentation
> (http://maven.apache.org/archetype/maven-archetype-plugin/create-from-proj
> ect-mojo.html and
> http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.ht
> ml)? Something that includes some explanation as to what is being
> done/created and why? For someone new to Maven, most of the documentation
> is very cryptic.
>
> Thanks again!
>
> -----Original Message-----
> From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
> Sent: Wednesday, May 05, 2010 3:37 PM
> To: Maven Users List
> Subject: Re: Missing archetype.xml in new archetype created from project
>
> see http://jira.codehaus.org/browse/ARCHETYPE-292
>
> archetype.xml is "old" archetype descriptor
>
> Regards,
>
> Hervé
>
> Le mercredi 05 mai 2010, Shelli Orton a écrit :
> > Hi,
> >
> > I am using Maven 2.2.1. and am new to Maven. I am trying to create an
> > archetype based on an existing project. I have been using this blog post
> > as a guide: http://blog.inflinx.com/category/m2eclipse/
> >
> > Step 7 says "The next step is to verify that the generated archetype.xml
> > (located under srcmainresourcesMETA-INFmaven (sic)) has all the files
> > listed and they are located in the right directories."
> >
> > My generated archetype does not have an archetype.xml. It does have an
> > archetype-metadata.xml file though. There aren't any errors in the
> > output from calling archetype:create-from-project, just a couple of
> > warnings about using platform encoding (Cp1252).
> >
> > Any thoughts on why this file wasn't generated?
> >
> > Thanks in advance!
> >
> > Shelli
> >
> > ---------------------------------------------------------------------
> > 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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Missing archetype.xml in new archetype created from project
Posted by Shelli Orton <Sh...@sjrb.ca>.
Unfortunatley I don't know enough to update the docs myself. :(
Shelli
-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com]
Sent: Wednesday, May 05, 2010 5:06 PM
To: Maven Users List
Subject: Re: Missing archetype.xml in new archetype created from project
> For someone new to Maven, most of the documentation is very cryptic.
This is simply the state of things today; we've discussed this more
than once on this list. Patches to improve the docs are always
appreciated!
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Missing archetype.xml in new archetype created from project
Posted by Wayne Fay <wa...@gmail.com>.
> For someone new to Maven, most of the documentation is very cryptic.
This is simply the state of things today; we've discussed this more
than once on this list. Patches to improve the docs are always
appreciated!
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Missing archetype.xml in new archetype created from project
Posted by Shelli Orton <Sh...@sjrb.ca>.
Thank you.
Is there any documentation (online or paper) that is better than what's in the Maven documentation (http://maven.apache.org/archetype/maven-archetype-plugin/create-from-project-mojo.html and http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.html)? Something that includes some explanation as to what is being done/created and why? For someone new to Maven, most of the documentation is very cryptic.
Thanks again!
-----Original Message-----
From: Hervé BOUTEMY [mailto:herve.boutemy@free.fr]
Sent: Wednesday, May 05, 2010 3:37 PM
To: Maven Users List
Subject: Re: Missing archetype.xml in new archetype created from project
see http://jira.codehaus.org/browse/ARCHETYPE-292
archetype.xml is "old" archetype descriptor
Regards,
Hervé
Le mercredi 05 mai 2010, Shelli Orton a écrit :
> Hi,
>
> I am using Maven 2.2.1. and am new to Maven. I am trying to create an
> archetype based on an existing project. I have been using this blog post
> as a guide: http://blog.inflinx.com/category/m2eclipse/
>
> Step 7 says "The next step is to verify that the generated archetype.xml
> (located under srcmainresourcesMETA-INFmaven (sic)) has all the files
> listed and they are located in the right directories."
>
> My generated archetype does not have an archetype.xml. It does have an
> archetype-metadata.xml file though. There aren't any errors in the
> output from calling archetype:create-from-project, just a couple of
> warnings about using platform encoding (Cp1252).
>
> Any thoughts on why this file wasn't generated?
>
> Thanks in advance!
>
> Shelli
>
> ---------------------------------------------------------------------
> 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: Missing archetype.xml in new archetype created from project
Posted by Hervé BOUTEMY <he...@free.fr>.
see http://jira.codehaus.org/browse/ARCHETYPE-292
archetype.xml is "old" archetype descriptor
Regards,
Hervé
Le mercredi 05 mai 2010, Shelli Orton a écrit :
> Hi,
>
> I am using Maven 2.2.1. and am new to Maven. I am trying to create an
> archetype based on an existing project. I have been using this blog post
> as a guide: http://blog.inflinx.com/category/m2eclipse/
>
> Step 7 says "The next step is to verify that the generated archetype.xml
> (located under srcmainresourcesMETA-INFmaven (sic)) has all the files
> listed and they are located in the right directories."
>
> My generated archetype does not have an archetype.xml. It does have an
> archetype-metadata.xml file though. There aren't any errors in the
> output from calling archetype:create-from-project, just a couple of
> warnings about using platform encoding (Cp1252).
>
> Any thoughts on why this file wasn't generated?
>
> Thanks in advance!
>
> Shelli
>
> ---------------------------------------------------------------------
> 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
Missing archetype.xml in new archetype created from project
Posted by Shelli Orton <Sh...@sjrb.ca>.
Hi,
I am using Maven 2.2.1. and am new to Maven. I am trying to create an
archetype based on an existing project. I have been using this blog post
as a guide: http://blog.inflinx.com/category/m2eclipse/
Step 7 says "The next step is to verify that the generated archetype.xml
(located under srcmainresourcesMETA-INFmaven (sic)) has all the files
listed and they are located in the right directories."
My generated archetype does not have an archetype.xml. It does have an
archetype-metadata.xml file though. There aren't any errors in the
output from calling archetype:create-from-project, just a couple of
warnings about using platform encoding (Cp1252).
Any thoughts on why this file wasn't generated?
Thanks in advance!
Shelli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org