私はmavenが初めてで、遊んでいる間に単純なbashコマンドを実行しようとしました。
ただし、exec-maven-plugin を使用してファイルに何かを追加しようとすると、常に「そのようなファイルまたはディレクトリはありません」というエラーがスローされます。
以下に pom.xml 全体を追加しました。
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.projectgroup</groupId>
<artifactId>project</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>some-execution</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>env</executable>
<workingDirectory>src/main</workingDirectory>
<arguments>
<argument> |tee -a env.properties </argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
誰でも助けてください。
ありがとう、ジェイソン