作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用的是 Maven 3.2.3。我曾经能够在我的 WAR 项目上运行“mvn clean install”,并且 WAR 将被安装到我的本地存储库中。然而,我最近添加了一个配置,以便我的 WAR 可以就地构建(配置如下)。现在,当我运行时
mvn clean install
我收到错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (install) on project myproject: The packaging for this project did not assign a file to the build artifact -> [Help 1]
我该如何解决这个问题?我尝试将 maven-install-plugin 的“安装”目标设置为默认目标,但这没有帮助。下面是我的 Maven 配置...
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/src/main/webapp/WEB-INF/classes</directory>
</fileset>
<fileset>
<directory>${project.basedir}/src/main/webapp/WEB-INF/lib</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<useCache>true</useCache>
<workDirectory>/tmp/${project.artifactId}/war/work</workDirectory>
</configuration>
<executions>
<execution>
<id>default-war</id>
<phase>none</phase>
</execution>
<execution>
<id>war-inplace</id>
<phase>package</phase>
<goals>
<goal>inplace</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>default-install</id>
<phase>none</phase>
</execution>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
最佳答案
添加以下 rpm 条目
%_rpmfilename noarch/%%{NAME}-%%{VERSION}-%%{RELEASE}.noarch.rpm
这里提到的以下每个文件都为我解决了问题。 (从 64 到无架构)。
vim /etc/rpm/macros
vim ~/.rpmmacros
关于maven - 如何解决 Maven "The packaging for this project did not assign a file to the build artifact"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29848977/
我是一名优秀的程序员,十分优秀!