0
我正在創建一個非java的Maven工件。在pom.xml
中,我解決了一些依賴關係,然後使用exec
插件運行自定義腳本。有些文件是在一個目錄中創建的,但Maven在將它們打包到jar中時看不到它們。Maven包只包含第二次運行的文件
當我運行mvn package
兩次時,第二次運行確實包含jar中的資源文件。
任何想法爲什麼會發生這種情況?該腳本在compile
階段運行,因此在package
階段創建jar時已創建文件。
這是我pom.xml
配置的相關(希望)部分:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>build-plugin</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>build_plugin.sh</argument>
<argument>${workspace}</argument>
<argument>${plugin}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${project.basedir}/${outputPath}</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>target/**</exclude>
</excludes>
</resource>
</resources>
所有的變量和路徑是有效的,對我越來越有預期的內容的罐子第二輪。但不是在第一次。