maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Mann <>
Subject useScope in ant build script
Date Thu, 06 Dec 2012 05:16:37 GMT
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"
    <remoteRepository refid="main.repository"/>
    <dependency groupId="com.caucho" artifactId="hessian" version="4.0.7" scope="compile"/>
    <dependency groupId="" 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"/>


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



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message