我有一个具有父依赖和子依赖的多模块结构。大约有20个子模块。我想运行mvn clean verify来获得关于我的构建的快速反馈,然后安装我正在尝试使用的包: mvn install:install。下面是父pom的一段代码:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
</plugin>
</plugins>
</pluginManagement>
然而,一旦我运行mvn install:install,我就会得到以下错误:
错误无法对项目sae.domain执行目标帮助(默认-cli):此项目的打包未将文件分配给生成项目->帮助1
我是否还需要对我的pom /目标等添加/更改其他内容,或者我在这里遗漏了什么?我尝试了基于互联网上各种可用的输入的这些东西,但恐怕没有结果!
发布于 2014-04-17 14:10:39
您可以通过将模块添加到父pom文件来实现这一点。
<modules>
<module>simple-weather</module>
<module>simple-webapp</module>
</modules>
以下是构建多模块项目的教程
http://books.sonatype.com/mvnex-book/reference/multimodule-sect-simple-parent.html
上述教程中的父项目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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sonatype.mavenbook.multi</groupId>
<artifactId>simple-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>Multi Chapter Simple Parent Project</name>
<modules>
<module>simple-weather</module>
<module>simple-webapp</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
发布于 2014-04-17 16:07:56
如果您只想安装它,请运行
mvn install
而不是mvn install:install。
发布于 2014-04-19 13:50:51
我不需要添加那些额外的插件信息,并将其运行为
mvn jar:jar install:install
在我的案例中起作用了。
https://stackoverflow.com/questions/23120687
复制相似问题