Я хочу создать файл информации о сборке в конкретном месте целевой папки проекта (особенно в папке target/abc_project/META-INF) через maven-2.Как выполнить банку из pom.xml
Ниже то, что я делаю в pom.xml
<build>
<finalName>abc_project</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<id>buid-info-generator</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>xyz.jar</argument>
<argument>target/abc_project/META-INF/info.txt</argument>
<argument>date</argument>
<argument>hg summary</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugins>
</build>
, давая phase
кроме install, deploy
, я получаю следующее сообщение об ошибке -
[INFO] Exception in thread "main" java.io.FileNotFoundException: target\abc_project\META-INF\info.txt (The system cannot find the path specified)
[INFO] at java.io.FileOutputStream.open(Native Method)
[INFO] at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
[INFO] at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
[INFO] at java.io.FileWriter.<init>(FileWriter.java:73)
[INFO] at com.nbec.svn.build.info.BuildInfoGenerator.main(BuildInfoGenerator.java:30)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Result of cmd.exe /X /C "java -jar xyz.jar target/abc_project/META-INF/info.txt "date "hg summary"" execution is: '1'.
Но странно, тот же код работает для 1 проекта, а не для других 2 проектов. Есть ли альтернатива для получения того же.
Что-то странное в вашем проекте. Вы изменили настройки по умолчанию? Откуда должен прибыть target \ abc_project \ META-INF \ info.txt? –