我正在尝试创建一个runnale of服务器,作为发布过程的一部分。我有一个多模块maven项目,其中有一个子模块,专门用于将服务器打包为可运行的。当我执行mvn clean package时,会产生一个可爱的可执行jar,它捆绑了其他一个子模块(war)。我面临的问题是,当我将maven部署到资产回购时,打包的服务器被上传为zip文件而不是jar文件。有人知道如何让部署插件上传jar吗?
下面是一个示例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>au.com.xxxx.xxxx</groupId>
<artifactId>xxx-backend-parent</artifactId>
<version>0.0.16-SNAPSHOT</version>
</parent>
<artifactId>xxxx-openliberty-server</artifactId>
<packaging>liberty-assembly</packaging>
<name>fusion-openliberty-server</name>
<description>Runnable Jar containing xxxxand the OpenLiberty applictaion server</description>
<dependencies>
<!-- Package xxxx-application.war with server assembly -->
<dependency>
<groupId>au.com.xxx.xxx</groupId>
<artifactId>xxxx-application</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Enable liberty-maven-plugin -->
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>2.6.1</version>
<extensions>true</extensions>
<configuration>
<assemblyArtifact>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-javaee8</artifactId>
<version>18.0.0.3</version>
<type>zip</type>
</assemblyArtifact>
<include>runnable</include>
<serverName>xxx</serverName>
<appsDirectory>apps</appsDirectory>
<serverEnv>${basedir}/src/main/resources/server.env</serverEnv>
<configFile>${basedir}/src/main/resources/server.xml</configFile>
<jvmOptionsFile>${basedir}/src/main/resources/jvm.options</jvmOptionsFile>
<bootstrapProperties>
<app.context.root>xxx-app</app.context.root>
<default.http.port>5000</default.http.port>
<default.https.port>5443</default.https.port>
</bootstrapProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>发布于 2019-02-03 14:41:00
我没有回答你的问题,但解释了为什么会发生这种情况。每个打包类型(jar、war、)都为它创建的工件定义了一个固定的扩展。自由程序集类型将zip定义为扩展。无论本地文件的名称如何,maven-install-plugin和maven-deploy-plugin都使用这个扩展名。我做了相当多的代码挖掘,但找不到改变这种情况的方法。可能是某物。只有liberty-maven-plugin才能更改/修复。
https://stackoverflow.com/questions/52866737
复制相似问题