maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte" <apa...@sourcegrounds.com>
Subject Re: Failing to get -D command line parameter acknowledged when using mvn exec:java
Date Sun, 25 Mar 2012 17:30:53 GMT
Looks like you missed the important note on the bottom of the  
usage-page[1].

{quote}
Note: The java goal doesn't spawn a new process. Any VM specific option  
that you want to pass to the executed class must be passed to the Maven VM  
using the MAVEN_OPTS environment variable. E.g.

MAVEN_OPTS=-Xmx1024m

  Otherwise consider using the exec goal.
{quote}

-Robert

[1] http://mojo.codehaus.org/exec-maven-plugin/usage.html



Op Sun, 25 Mar 2012 13:09:36 +0200 schreef Martijn Verburg  
<martijnverburg@gmail.com>:

> 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

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


Mime
View raw message