执行代码:
mvn install:install-file -Dfile=/Users/nananer7/Library/apache-maven.1/repository/xssprotect/xssprotest/1.0/xssprotest-1.0.jar -DgroupId=net.xssprotect -DartifactId=xssprotect -Dversion=1.0 -Dpackaging=jar
错误如下:
[ERROR] No plugin found for prefix ‘install’ in the current project and in the p lugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the re positories [local ({my repository path}), central (https://repo.maven. apache.org/maven2)]
解决方法:
在maven配置文件settings.xml中添加如下代码
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<localRepository>D:\Program Files\apache-maven3.5.4\repository</localRepository>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile></profiles>
</settings>
参考:https://unnue.com/article/12