我正在使用 Maven Assembly 处理一个多模块项目,其结构如下:
在我的分发模块中,我希望打包并创建一个JAR文件,其中应该只包含module-1.war和module-2.jar文件。 我的distrib/pom.xml文件如下:
我的assembly.xml看起来像这样 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> izpack ${main.basedir} dir false
PARENT\pom.xml
--warModule
-- pom.xml
--/target/module-1.war
--configModule
--pom.xml
--target/**module-2.jar**
--distrib
--pom.xml
--src/assembly/assembly.xml
在我的分发模块中,我希望打包并创建一个JAR文件,其中应该只包含module-1.war和module-2.jar文件。 我的distrib/pom.xml文件如下:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.wellsfargo.gateway.fx</groupId>
<artifactId>distrib</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>distrib</artifactId>
<properties>
<izpack.version>5.1.2</izpack.version>
<izpack.base.dir>${project.build.directory}\${project.artifactId}-${project.version}-fx\izpack</izpack.base.dir>
<izpack.standalone.compiler.version>4.3.2</izpack.standalone.compiler.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>distrib/src/assembly/assembly.xml
</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
我的assembly.xml看起来像这样 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> izpack ${main.basedir} dir false
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>propdeploy</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>../warModule/target/module-1.war</source>
<destName>foreign-exchange-v2.war</destName>
<outputDirectory>wardeploy</outputDirectory>
</file>
<file>
<source>../configModule/target/module-2.jar</source>
<destName>module-2.jar</destName>
<outputDirectory>wardeploy</outputDirectory>
</file>
</files>
<dependencySets>
<dependencySet>
<unpack>true</unpack>
<useProjectArtifact>true</useProjectArtifact>
</dependencySet>
</dependencySets>
问题在于当前目录无法识别分发包的父目录,并且抱怨在位置 xxxx/distrib/warModule/target/module-v1.war 和 module-v2.war 中找不到 noSuchFileFound 文件。我该如何获取父文件夹子路径中的文件?
有什么好的想法吗?
mvn clean install
吗?对于你的运行配置,你的基础目录是什么?它是父项目还是分发文件夹? - jspek