maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zilvinas Vilutis <cika...@gmail.com>
Subject java file path in exec:java
Date Wed, 20 Apr 2011 19:45:14 GMT
Hi maven users!

I'm trying to execute a java command and pass a path to a file as an argument:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <configuration>
    <executable>java</executable>
    <workingDirectory>${project.build.outputDirectory}</workingDirectory>
    <classpathScope>runtime</classpathScope>
    <arguments>
      <argument>-c
${project.build.outputDirectory}${file.separator}orm.properties</argument>
    </arguments>
    <mainClass>com.company.deploy.product.AutomatedProductDeploy</mainClass>
  </configuration>
</plugin>

And I'm using maven properties to construct the filename:
${project.build.outputDirectory}${file.separator}orm.properties

Unfortunately, I'm getting an exception from the java class I'm running:

Caused by: java.io.FileNotFoundException:  C:\<path to my
project>\target\classes\orm.properties (The filename, directory name,
or volume label syntax is incorrect)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)

Most likely the it is using the argument and does not escape slashes
to new java.io.File( filePath )

As I don't have access to source code of the class - is there any way
to enforce maven use unix style path generation on windows? ( change
slashes to "/" )

I tried to override the ${file.separator} property - but it seems to
be read-only and doesn't help.

Any ideas?

Thank you!

Žilvinas Vilutis

E-mail:   cikasfm@gmail.com

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


Mime
View raw message