我有一个非常奇怪的问题 - 我创建了多模块java项目,它创建了" fat-jar"。不幸的是"前端"在jenkins(linux)上启动时,模块jar没有资源 - 由于某些原因它在Windows上运行:
这是"前端" POM:
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/>
</parent>
<groupId>com.frontend</groupId>
<artifactId>frontend-app</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>node build app</id>
<phase>prepare-package</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我尝试过:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
但这并没有帮助。
默认的npm构建目标是
ng build --output-path dist/META-INF/resources
目标中的Jar文件不包含来自&#34; dist&#34;的文件 - &GT;当我在默认位置src/main/resources
maven日志输出包括:
[WARNING] JAR will be empty - no content was marked for inclusion!
在构建期间创建并填充dist目录。 Maven在Windows上查找文件但在Jenkins上没有。
编辑:
maven目标是一样的。