Hi, 

I am using the maven ant task.
I need to extract some information from the pom file.

As the documentation explains, I load the pom like this:

        <artifact:pom id="maven.project" file="pom.xml" />
        <artifact:dependencies pathId="dependency.classpath">
                <pom refid="maven.project" />
        </artifact:dependencies>

Then, I get some info from the pom like this, for example:
        <property name="srcDir" value="${maven.project.build.sourceDirectory}" 
/>
Which is also in the doucmentation.

However when trying to get some more deeply burried properties from the pom,
the documentation
suggests that I look at the 
http://maven.apache.org/ref/2.0.8/maven-model/maven.html descriptor referece
.

However, for something like the resource directory, I could not find a
direct way to get it except to hack it like this by using the srcDir and
replacing "java" by "resources". 
        <propertyregex property="resDir" input="${srcDir}" regexp="(.*)java"
replace="\1resources" />

Is there any way to get that in a cleaner way.

My hack luckily worked for that simple case but now, for example I have
parent pom that has submodules
and I am trying to access the elements under <modules/>, 
maven.project.modules is not even close.

Any ideas?

--SA


-- 
View this message in context: 
http://www.nabble.com/Maven-Ant-Tasks--Descriptor-Reference.-tp18504562p18504562.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to