【发布时间】:2018-07-23 14:11:46
【问题描述】:
我正在尝试使用程序集 maven 插件将我的项目与我的项目 .jars 和一些配置文件一起压缩。
我想要来自模块 admin batch_base_to_base batch_engine batch_generic 的 JAR 和一些文件到 misc 中
我的问题是我的程序集没有使用我的配置文件,它确实使用了我的所有 jar,包括依赖项 jar。在我的项目结构和我的 POM 和程序集描述符下方。
这是我的项目结构:
组装-dr3.xml:
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>com.mycompany.dr3:batch_engine</include>
<!-- for test but it still includes below modules
<include>com.mycompany.dr3:admin</include>
<include>com.mycompany.dr3:batch_generic</include>
<include>com.mycompany.dr3:batch_base_to_base</include>
-->
</includes>
<sources>
<fileSets>
<fileSet>
<directory>${project.basedir}/misc</directory>
<includes>
<include>configuration.json</include>
<include>environment_placeholders.json</include>
</includes>
</fileSet>
</fileSets>
</sources>
<binaries>
<outputDirectory>modules/maven-assembly-plugin</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>com.mycompany.dr3</groupId>
<artifactId>dr3</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>dr3-package</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<descriptor>assembly-dr3.xml</descriptor>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
标签: java maven jar maven-assembly-plugin