maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martijn Verburg <martijnverb...@gmail.com>
Subject Failing to get -D command line parameter acknowledged when using mvn exec:java
Date Sun, 25 Mar 2012 11:09:36 GMT
Hi all,

I'm executing a Java main class with the following:

mvn compile -Prun-main

With exec plugin being run with a java goal during the compile phase
(in the run-main profile):

<profiles>
 <profile>
  <id>run-main</id>
  <build>
   <plugins>
    <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>exec-maven-plugin</artifactId>
     <version>1.2.1</version>
     <executions>
      <execution>
       <phase>compile</phase>
       <goals>
        <goal>java</goal>
       </goals>
       <configuration>
        <mainClass>com.jclarity.jmsr.Main</mainClass>
       </configuration>
      </execution>
     </executions>
    </plugin>
   </plugins>
  </build>
 </profile>
</profiles>

However I'm unable to pass through the
-Djava.library.path=${basedir}/target which contains a C++ dylib that
I need to reference.

I've tried the following in the <configuration> section:

        <arguments>
         <argument>-Djava.library.path=${basedir}/target</argument>
        </arguments>

And

        <systemProperties>
            <systemProperty>
              <key>java.library.path</key>
              <value>${basedir}/target</value>
            </systemProperty>
          </systemProperties>

And

          <commandlineArgs>-Djava.library.path=${basedir}/target</commandlineArgs>

And

          <environmentVariables>
              <key>java.library.path</key>
              <value>${basedir}/target</value>
          </environmentVariables>

But none have worked out.  Am I going about this the wrong way?

Cheers,
Martijn

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


Mime
View raw message