java 警告 org.apache.maven.plugins:maven-deploy-plugin 的“build.plugins.plugin.version”丢失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36456990/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WARNING 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing
提问by Miguel Velez
I successfully deployed my Maven artifact to the Central Repository. However, I saw this warning when I ran mvn release:perform
:
我成功地将我的 Maven 工件部署到中央存储库。但是,我在运行时看到了这个警告mvn release:perform
:
[INFO] Invoking perform goals in directory /Users/miguelvelez/Documents/Programming/Java/Projects/messages/target/checkout
[INFO] Executing goals 'deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [WARNING]
[INFO] [WARNING] Some problems were encountered while building the effective settings
[INFO] [WARNING] Unrecognised tag: 'activateByDefault' (position: START_TAG seen ...<activation>\n <activateByDefault>... @261:32) @ /usr/bin/apache-maven-3.3.9/conf/settings.xml, line 261, column 32
[INFO] [WARNING]
[INFO] [INFO] Scanning for projects...
[INFO] [WARNING]
[INFO] [WARNING] Some problems were encountered while building the effective model for com.mijecu25:messages:jar:1.0.0
[INFO] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing.
[INFO] [WARNING]
[INFO] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[INFO] [WARNING]
[INFO] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] [WARNING]
The <activateByDefault>
warning has been solved. But I am not sure about the missing plugin.
该<activateByDefault>
警告已经解决。但我不确定缺少的插件。
Here is my POM.xml:
这是我的 POM.xml:
<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>
<groupId>com.mijecu25</groupId>
<artifactId>messages</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>messages</name>
<description>Library with messages for debugging</description>
<url>https://github.com/mijecu25/messages</url>
<inceptionYear>2016</inceptionYear>
<organization>
<name>Mijecu25</name>
<url>http://www.mijecu25.com</url>
</organization>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<connection>scm:git:git://github.com/mijecu25/messages.git</connection>
<developerConnection>scm:git:[email protected]:mijecu25/messages.git</developerConnection>
<url>https://github.com/mijecu25/messages</url>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<id>miguelvelezmj25</id>
<name>Miguel Velez</name>
<email>[email protected]</email>
<url>http://www.mijecu25.com/miguelvelez/</url>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus release repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>release</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<configuration>
<passphrase>${gpg.passphrase}</passphrase>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.1.0</version>
<configuration>
<sourceEncoding>UTF-8</sourceEncoding>
<repoToken>${env.coveralls_repo_token}</repoToken>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>true</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
AS you can see, I am not using the maven-deploy-plugin
. Do you know what the warning means?
如您所见,我没有使用maven-deploy-plugin
. 你知道警告是什么意思吗?
EDIT:In the comments, it was suggested that I fix the error in the settings.xml
file. This is the new output after I did so:
编辑:在评论中,有人建议我修复settings.xml
文件中的错误。这是我这样做后的新输出:
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [WARNING]
[INFO] [WARNING] Some problems were encountered while building the effective model for com.mijecu25:messages:jar:1.0.1
[INFO] [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing.
[INFO] [WARNING]
[INFO] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[INFO] [WARNING]
[INFO] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] [WARNING]
Any further ideas?
任何进一步的想法?
Thanks!
谢谢!
回答by shashikant nishad
windows -> preferences->maven->user setting-> now give correct location of settings.xml setting.xml file which present in mavenfolder C:\Program Files\apache-maven-3.5.3\conf\settings.xml
windows -> 首选项-> maven-> 用户设置-> 现在给出 settings.xml setting.xml 文件的正确位置,该文件位于 mavenfolder C:\Program Files\apache-maven-3.5.3\conf\settings.xml