Jenkins Maven项目在Windows上运行,但不在Linux上运行



我正在尝试构建一个jenkins-maven项目作业。它从位桶repo中获取代码,并执行">清理安装依赖项:复制依赖项"。它应该在我的目标文件夹中生成一个名为"data"的目录,并将pom.xml(见下文(中给出的路径中的内容复制到数据文件夹中。这个执行当在windows系统上运行时,它正在我的目标中生成这个数据文件夹。但是当我在linux机器上执行SAME时,它正在生成目标,但里面没有数据文件夹。任何帮助都将不胜感激。提前谢谢。

xml代码的一部分如下所示:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/data</outputDirectory>
<resources>
<resource>
<directory>srcmainresourcesorgoptaplannerexamples</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

您应该在目录中使用${file.separator},而不是\。但是/应该适用于windows。

更换

<directory>srcmainresourcesorgoptaplannerexamples</directory>

通过

<directory>src${file.separator}main${file.separator}resources${file.separator}org${file.separator}optaplanner${file.separator}examples</directory>

<directory>src/main/resources/org/optaplanner/examples</directory>

最新更新