I am using MavenEmbedder 2.1 to parse my pom.xml. I have attached two files
with this mail.

One is my java program which is try to parse pom.xml and get MavenProject
out of it
Next one is my pom.xml.

My question is, how to pass runtime arguments to MavenEmbedder?

If you see in pom.xml, for one dependency I have mentioned $ variable which
will be resolved at runtime.

        <dependencies>
                <dependency>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
                        <version>${dep.version}</version>
                        <scope>compile</scope>
                </dependency>           
        </dependencies>

This ${dep.version} is available as a property within pom.xml. If you see
the properties section, you can find dep.version

        <properties>
        <dep.version>${prop.version}</dep.version>
        </properties>
        
Value for this dep.version is ${prop.version} which will be resolved only at
runtime. If we are using maven from command prompt, then we can run install
goal like this

mvn install -Dprop.version=1.2

Maven will resolve the ${prop.version} using command line parameters.

I just to want to know how to pass this in Maven Embedder.      

Actually using Configuration class we can set system properties. In this
case System property get appended to JVM System property which will affect
our multi threaded build process (Our build machine sit on top up of solaris
box where only one JVM is running and build process is a multi threaded one)
If a system property is added to JVM, then it will have an effect on all
other threads which are simulatenously running)

http://www.nabble.com/file/p15152376/pom.xml pom.xml 
http://www.nabble.com/file/p15152376/PomDetails.java PomDetails.java 
-- 
View this message in context: 
http://www.nabble.com/Maven-embedder-issue-tp15152376p15152376.html
Sent from the Maven - Issues mailing list archive at Nabble.com.

Reply via email to