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 2012/12/06 06:16:37 UTC

useScope in ant build script

Despite reading and re-reading the docs, and googling, for the past half-hour, I can't see how useScope or scopes is useful in the maven ant task unless I use a separate POM file.

If I list all my dependencies directly in my ant build script, there appears to be no way to reference one dependency set with multiple different scopes. For example, I have:

<artifact:dependencies  pathId="runtime.classpath"
                        filesetId="runtime.fileset"
                        >
    
    <remoteRepository refid="main.repository"/>
    
    <dependency groupId="com.caucho" artifactId="hessian" version="4.0.7" scope="compile"/>
    <dependency groupId="com.google.zxing" artifactId="core" version="2.0" scope="compile"/>
...
    <dependency groupId="javax.servlet.jsp" artifactId="jsp-api" version="2.1" scope="provided"/>
    <dependency groupId="javax.servlet" artifactId="servlet-api" version="2.5" scope="provided"/>

</artifact:dependencies>

I have a compile target in ant that uses this as the classpath. But I'd like my test target to also use it as a classpath. The problem is that in the test target, I need some of my "provided"-scope dependencies to be included, so I want to use it as a useScope="test" set of dependencies. But because this can only be specified with the dependencies artifact once, there's no way to use it. That seems to make the feature rather useless.

Am I just completely missing the usage? How can I avoid completely copying the entire dependency set?

Thanks,

-- 
Rick




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