I'm using Intellij Idea 14 and start learning embedded Maven installation. At now Maven compile sources, generate JAR with MANIFEST.MF inside (with 'lib/' prefixes in 'Class-Path') to 'target/', copy dependencies at 'target/lib/' folder, copy folder 'src/main/resources/cfg' to 'target/cfg'. If i manually go to folder 'target' and start app with 'java -jar app.jar' then it works fine and successfully find folder 'cfg', but if i start app from Idea then app triyng to search folder 'cfg' in base project folder. There is some POM piece:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<workingDirectory>${project.build.directory}\</workingDirectory>
<mainClass>app.Main</mainClass>
</configuration>
</plugin>
I looked at workingDirectory parameter [ http://www.mojohaus.org/exec-maven-plugin/exec-mojo.html ]. This won't work. How can i change working folder to 'target'? This is for comfort app develop and run/debug right from Idea. I need to get that result application structure:
- /app.jar
- /cfg
- /cfg/application.cfg