You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rick Mann <rm...@latencyzero.com> on 2005/08/26 18:52:05 UTC

Ant Maven2 Tasks include all .jars in local repo?

It seems like the Maven2 Ant Tasks include everything in the repo,  
rather than just the named dependencies. I was experimenting with my  
build file by removing dependencies I knew to be required, and the  
compile succeeded. My build file looks like this:

>     <artifact:dependencies filesetId="runtime.fileset">
>     </artifact:dependencies>
>
>     <artifact:dependencies filesetId="compile.fileset">
>     </artifact:dependencies>
>
>     <path id="compile.classpath">
>         <fileset refid="runtime.fileset"/>
>         <fileset refid="compile.fileset"/>
>     </path>
>
>     <target name="compile" description="==> Compile all the .java  
> files">
>         <mkdir    dir="${obj}"/>
>
>         <javac    srcdir="${src}"
>                 destdir="${obj}"
>                 source="1.4"
>                 deprecation="on"
>                 debug="on">
>             <classpath refid="compile.classpath"/>
>         </javac>
>     </target>


Note that there are no actual dependencies listed. There used to be,  
however, and so there are a handful of .jars in my ~/.m2 directory.  
When I run "ant compile -verbose" I see that it builds this classpath  
for javac (which I've broken into individual lines, no doubt broken  
into more lines by my mailer). In particular, note that it includes  
all of the .jars in my ~/.m2 directory. Is this a bug? Or some  
default setting I need to change ("include-all-jars")?

TIA,

>     [javac]
> /Users/rmann/Perforce/lzd/org.roderickmann/object
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils- 
> core/1.7.0/commons-beanutils-core-1.7.0.jar
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/ 
> commons-beanutils-1.6.jar
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.1/commons-collections-2.1.jar
> /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/ 
> commons-digester-1.7.jar
> /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/ 
> commons-logging-1.0.jar
> /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
> /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar
> /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.jar
> /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml- 
> apis-1.0.b2.jar
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils- 
> core/1.7.0/commons-beanutils-core-1.7.0.jar.sha1
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils- 
> core/1.7.0/commons-beanutils-core-1.7.0.pom
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils- 
> core/1.7.0/commons-beanutils-core-1.7.0.pom.sha1
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/ 
> commons-beanutils-1.6.jar.sha1
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/ 
> commons-beanutils-1.6.pom
> /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/ 
> commons-beanutils-1.6.pom.sha1
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.0/commons-collections-2.0.jar
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.0/commons-collections-2.0.jar.sha1
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.0/commons-collections-2.0.pom
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.0/commons-collections-2.0.pom.sha1
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.1/commons-collections-2.1.jar.sha1
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.1/commons-collections-2.1.pom
> /Users/rmann/.m2/repository/commons-collections/commons-collections/ 
> 2.1/commons-collections-2.1.pom.sha1
> /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/ 
> commons-digester-1.7.jar.sha1
> /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/ 
> commons-digester-1.7.pom
> /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/ 
> commons-digester-1.7.pom.sha1
> /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/ 
> commons-logging-1.0.jar.sha1
> /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/ 
> commons-logging-1.0.pom
> /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/ 
> commons-logging-1.0.pom.sha1
> /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet- 
> api-2.4.jar
> /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet- 
> api-2.4.jar.sha1
> /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet- 
> api-2.4.pom
> /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet- 
> api-2.4.pom.sha1
> /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.jar
> /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.jar.sha1
> /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.pom
> /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.pom.sha1
> /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar.sha1
> /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.pom
> /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.pom.sha1
> /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar.sha1
> /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.pom
> /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.pom.sha1
> /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.jar.sha1
> /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.pom
> /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.pom.sha1
> /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml- 
> apis-1.0.b2.jar.sha1
> /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml- 
> apis-1.0.b2.pom
> /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml- 
> apis-1.0.b2.pom.sha1
> /Developer/Java/Ant/lib/ant-launcher.jar
> /Developer/Java/Ant/lib/ant-antlr.jar
> /Developer/Java/Ant/lib/ant-apache-bcel.jar
> /Developer/Java/Ant/lib/ant-apache-bsf.jar
> /Developer/Java/Ant/lib/ant-apache-log4j.jar
> /Developer/Java/Ant/lib/ant-apache-oro.jar
> /Developer/Java/Ant/lib/ant-apache-regexp.jar
> /Developer/Java/Ant/lib/ant-apache-resolver.jar
> /Developer/Java/Ant/lib/ant-commons-logging.jar
> /Developer/Java/Ant/lib/ant-commons-net.jar
> /Developer/Java/Ant/lib/ant-icontract.jar
> /Developer/Java/Ant/lib/ant-jai.jar
> /Developer/Java/Ant/lib/ant-javamail.jar
> /Developer/Java/Ant/lib/ant-jdepend.jar
> /Developer/Java/Ant/lib/ant-jmf.jar
> /Developer/Java/Ant/lib/ant-jsch.jar
> /Developer/Java/Ant/lib/ant-junit.jar
> /Developer/Java/Ant/lib/ant-netrexx.jar
> /Developer/Java/Ant/lib/ant-nodeps.jar
> /Developer/Java/Ant/lib/ant-starteam.jar
> /Developer/Java/Ant/lib/ant-stylebook.jar
> /Developer/Java/Ant/lib/ant-swing.jar
> /Developer/Java/Ant/lib/ant-trax.jar
> /Developer/Java/Ant/lib/ant-vaj.jar
> /Developer/Java/Ant/lib/ant-weblogic.jar
> /Developer/Java/Ant/lib/ant-xalan1.jar
> /Developer/Java/Ant/lib/ant-xslp.jar
> /Developer/Java/Ant/lib/ant.jar
> /Developer/Java/Ant/lib/junit.jar
> /Developer/Java/Ant/lib/xercesImpl.jar
> /Developer/Java/Ant/lib/xml-apis.jar


-- 
Rick



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


Re: Ant Maven2 Tasks include all .jars in local repo?

Posted by Rick Mann <rm...@latencyzero.com>.
On Aug 26, 2005, at 10:21 AM, Kenney Westerhof wrote:

> Could you file a JIRA issue for this please?

Done. I don't know if I assigned it correctly (it's my first Jira bug).

     http://jira.codehaus.org/browse/MNG-795


-- 
Rick



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


Re: Ant Maven2 Tasks include all .jars in local repo?

Posted by Rick Mann <rm...@latencyzero.com>.
On Aug 26, 2005, at 10:21 AM, Kenney Westerhof wrote:

> It could be described as a bug: what the task does is
> create an ant FileSet object. Since you defined no dependencies,
> it's the same as <fileset id="runtime.fileset" dir="$ 
> {localRepository}"/>
> (where ${localRepository} = ~/.m2/repository).
> I guess the default ant implementation for FileSet has an include
> filter of **/* and no exclude filter.

> As soon as you specify 1 dependency it will override the default  
> include
> and put the referenced jar in there.

Ah. I tested that assertion and I believe you're right.

> Could you file a JIRA issue for this please?

You got it! Thanks!

At least now I can be confident that I'm pulling in the right .jars,  
and not getting multiple .jars of different versions.

-- 
Rick






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


Re: Ant Maven2 Tasks include all .jars in local repo?

Posted by Kenney Westerhof <fo...@neonics.com>.
On Fri, 26 Aug 2005, Rick Mann wrote:

It could be described as a bug: what the task does is
create an ant FileSet object. Since you defined no dependencies,
it's the same as <fileset id="runtime.fileset" dir="${localRepository}"/>
(where ${localRepository} = ~/.m2/repository).
I guess the default ant implementation for FileSet has an include
filter of **/* and no exclude filter.

As soon as you specify 1 dependency it will override the default include
and put the referenced jar in there.

Could you file a JIRA issue for this please?

-- Kenney

> It seems like the Maven2 Ant Tasks include everything in the repo,
> rather than just the named dependencies. I was experimenting with my
> build file by removing dependencies I knew to be required, and the
> compile succeeded. My build file looks like this:
>
> >     <artifact:dependencies filesetId="runtime.fileset">
> >     </artifact:dependencies>
> >
> >     <artifact:dependencies filesetId="compile.fileset">
> >     </artifact:dependencies>
> >
> >     <path id="compile.classpath">
> >         <fileset refid="runtime.fileset"/>
> >         <fileset refid="compile.fileset"/>
> >     </path>
> >
> >     <target name="compile" description="==> Compile all the .java
> > files">
> >         <mkdir    dir="${obj}"/>
> >
> >         <javac    srcdir="${src}"
> >                 destdir="${obj}"
> >                 source="1.4"
> >                 deprecation="on"
> >                 debug="on">
> >             <classpath refid="compile.classpath"/>
> >         </javac>
> >     </target>
>
>
> Note that there are no actual dependencies listed. There used to be,
> however, and so there are a handful of .jars in my ~/.m2 directory.
> When I run "ant compile -verbose" I see that it builds this classpath
> for javac (which I've broken into individual lines, no doubt broken
> into more lines by my mailer). In particular, note that it includes
> all of the .jars in my ~/.m2 directory. Is this a bug? Or some
> default setting I need to change ("include-all-jars")?
>
> TIA,
>
> >     [javac]
> > /Users/rmann/Perforce/lzd/org.roderickmann/object
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils-
> > core/1.7.0/commons-beanutils-core-1.7.0.jar
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/
> > commons-beanutils-1.6.jar
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.1/commons-collections-2.1.jar
> > /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/
> > commons-digester-1.7.jar
> > /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/
> > commons-logging-1.0.jar
> > /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
> > /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar
> > /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.jar
> > /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-
> > apis-1.0.b2.jar
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils-
> > core/1.7.0/commons-beanutils-core-1.7.0.jar.sha1
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils-
> > core/1.7.0/commons-beanutils-core-1.7.0.pom
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils-
> > core/1.7.0/commons-beanutils-core-1.7.0.pom.sha1
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/
> > commons-beanutils-1.6.jar.sha1
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/
> > commons-beanutils-1.6.pom
> > /Users/rmann/.m2/repository/commons-beanutils/commons-beanutils/1.6/
> > commons-beanutils-1.6.pom.sha1
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.0/commons-collections-2.0.jar
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.0/commons-collections-2.0.jar.sha1
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.0/commons-collections-2.0.pom
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.0/commons-collections-2.0.pom.sha1
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.1/commons-collections-2.1.jar.sha1
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.1/commons-collections-2.1.pom
> > /Users/rmann/.m2/repository/commons-collections/commons-collections/
> > 2.1/commons-collections-2.1.pom.sha1
> > /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/
> > commons-digester-1.7.jar.sha1
> > /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/
> > commons-digester-1.7.pom
> > /Users/rmann/.m2/repository/commons-digester/commons-digester/1.7/
> > commons-digester-1.7.pom.sha1
> > /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/
> > commons-logging-1.0.jar.sha1
> > /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/
> > commons-logging-1.0.pom
> > /Users/rmann/.m2/repository/commons-logging/commons-logging/1.0/
> > commons-logging-1.0.pom.sha1
> > /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet-
> > api-2.4.jar
> > /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet-
> > api-2.4.jar.sha1
> > /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet-
> > api-2.4.pom
> > /Users/rmann/.m2/repository/javax/servlet/servlet-api/2.4/servlet-
> > api-2.4.pom.sha1
> > /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.jar
> > /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.jar.sha1
> > /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.pom
> > /Users/rmann/.m2/repository/junit/junit/3.7/junit-3.7.pom.sha1
> > /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar.sha1
> > /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.pom
> > /Users/rmann/.m2/repository/junit/junit/3.8.1/junit-3.8.1.pom.sha1
> > /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar.sha1
> > /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.pom
> > /Users/rmann/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.pom.sha1
> > /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.jar.sha1
> > /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.pom
> > /Users/rmann/.m2/repository/struts/struts/1.2.7/struts-1.2.7.pom.sha1
> > /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-
> > apis-1.0.b2.jar.sha1
> > /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-
> > apis-1.0.b2.pom
> > /Users/rmann/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-
> > apis-1.0.b2.pom.sha1
> > /Developer/Java/Ant/lib/ant-launcher.jar
> > /Developer/Java/Ant/lib/ant-antlr.jar
> > /Developer/Java/Ant/lib/ant-apache-bcel.jar
> > /Developer/Java/Ant/lib/ant-apache-bsf.jar
> > /Developer/Java/Ant/lib/ant-apache-log4j.jar
> > /Developer/Java/Ant/lib/ant-apache-oro.jar
> > /Developer/Java/Ant/lib/ant-apache-regexp.jar
> > /Developer/Java/Ant/lib/ant-apache-resolver.jar
> > /Developer/Java/Ant/lib/ant-commons-logging.jar
> > /Developer/Java/Ant/lib/ant-commons-net.jar
> > /Developer/Java/Ant/lib/ant-icontract.jar
> > /Developer/Java/Ant/lib/ant-jai.jar
> > /Developer/Java/Ant/lib/ant-javamail.jar
> > /Developer/Java/Ant/lib/ant-jdepend.jar
> > /Developer/Java/Ant/lib/ant-jmf.jar
> > /Developer/Java/Ant/lib/ant-jsch.jar
> > /Developer/Java/Ant/lib/ant-junit.jar
> > /Developer/Java/Ant/lib/ant-netrexx.jar
> > /Developer/Java/Ant/lib/ant-nodeps.jar
> > /Developer/Java/Ant/lib/ant-starteam.jar
> > /Developer/Java/Ant/lib/ant-stylebook.jar
> > /Developer/Java/Ant/lib/ant-swing.jar
> > /Developer/Java/Ant/lib/ant-trax.jar
> > /Developer/Java/Ant/lib/ant-vaj.jar
> > /Developer/Java/Ant/lib/ant-weblogic.jar
> > /Developer/Java/Ant/lib/ant-xalan1.jar
> > /Developer/Java/Ant/lib/ant-xslp.jar
> > /Developer/Java/Ant/lib/ant.jar
> > /Developer/Java/Ant/lib/junit.jar
> > /Developer/Java/Ant/lib/xercesImpl.jar
> > /Developer/Java/Ant/lib/xml-apis.jar
>
>
> --
> Rick
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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