如何跳过在maven中部署JAR并仅部署程序集
我的项目打包到一个Spring Boot胖罐子中 我配置了2个额外的构建插件:如何跳过在maven中部署JAR并仅部署程序集,maven,Maven,我的项目打包到一个Spring Boot胖罐子中 我配置了2个额外的构建插件: 使用生成可执行文件(它获取生成的fat jar并将其嵌入到可执行文件中) 在ZIP中汇编生成的可执行文件 现在,我只想将生成的程序集zip部署到我的maven存储库中 这是我的构建部分: <build> <plugins> <plugin> <groupId>org.springframework.boot</g
- 使用生成可执行文件(它获取生成的fat jar并将其嵌入到可执行文件中)
- 在ZIP中汇编生成的可执行文件
构建
部分:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<executions>
<execution>
<id>l4j-clui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<outfile>target/${project.build.finalName}.exe</outfile>
<jar>target/${project.build.finalName}.jar</jar>
<manifest>launch4j/besser-updater.manifest</manifest>
<classPath>
<mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
</classPath>
<jre>
<minVersion>1.8.0_131</minVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>32/64</runtimeBits>
</jre>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>launch4j/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
org.springframework.boot
springbootmaven插件
真的
com.akatist.maven.plugins.launch4j
启动4J maven插件
l4j俱乐部
包裹
发射4J
安慰
target/${project.build.finalName}.exe
target/${project.build.finalName}.jar
launch4j/besser-updater.manifest
org.springframework.boot.loader.JarLauncher
1.8.0_131
首选
32/64
maven汇编插件
装配
包裹
单一的
launch4j/assembly.xml
如何将部署阶段配置为忽略jar工件,而只部署zip程序集文件?您是在使用程序集进行部署,还是在简单地避免在远程repo中安装依赖项 如果你正在谈论汇编插件,你可以很容易地用它排除JAR 您可以避免像这样部署单个工件:
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
...
</build>
org.apache.maven.plugins
希望能有帮助。我找到了解决办法。我只是忽略了默认部署
执行id
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<!-- disable standard deploy -->
<execution>
<id>default-deploy</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
org.apache.maven.plugins
maven部署插件
默认部署
没有一个
我只想调用mvn deploy
,我希望在远程存储库中看到的结果是只看到zip工件而没有jar。现在,如果我执行部署,它将上载jar和zip。这将跳过整个部署,我不想跳过整个部署,只有分类器jar的部署对我不起作用。存储库“comgithubriprasad-1048”失败[错误]规则“javadoc暂存”失败[错误]*缺少:在文件夹“/com/github/riprasad/service registry ocp安装示例/1.0.1”[错误]规则“源暂存”失败[错误]中找不到主jar工件*缺少:在文件夹“/com/github/riprasad/service registry ocp install examples/1.0.1”中找不到主jar工件