Cannot resolve plugin org.apache.maven.plugins:maven-jar-plugin:3.1.1
时间: 2023-09-29 18:03:23 浏览: 160
android-maven-plugin-3.1.1.jar
As an AI language model, I cannot access your specific environment or settings. However, this error usually occurs when Maven cannot download the required version of the maven-jar-plugin from the Maven Central repository. Here are some steps to resolve the issue:
1. Check your internet connection and ensure that you can access the Maven Central repository.
2. Try running "mvn clean install" or "mvn clean package" to force Maven to download the plugin again.
3. If the issue persists, try adding the following to your pom.xml file under the <build> section:
```
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
```
4. If none of the above steps work, try manually downloading the plugin jar file from the Maven Central repository and installing it locally using the Maven Install Plugin.
```
mvn install:install-file -Dfile=<path-to-jar> -DgroupId=org.apache.maven.plugins -DartifactId=maven-jar-plugin -Dversion=3.1.1 -Dpackaging=jar
```
Replace <path-to-jar> with the actual path to the downloaded jar file.
阅读全文