猿问

Maven Dependency Plugin 离线未下载某些插件

我正在尝试将 pom 文件的所有传递依赖项和插件下载到本地文件夹中,然后使用它离线运行 sonarqube。我对 Maven 相当陌生,所以我可能在这里做错了,但我认为 maven maven-dependency-plugin:3.1.1:go-offline 没有下载运行 sonarqube 所需的所有插件,这会导致错误。

这是我尝试过的。

  1. 将所有依赖项下载到新文件夹

mvn -D"maven.repo.local"="c:\test\test" org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline

  1. 运行声纳

mvn -o -D"maven.repo.local"="c:\test\test" sonar:sonar

然而,这给了我以下错误

[INFO] Scanning for projects...

[WARNING] The POM for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 is missing, no dependency information available

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 has not been downloaded from it before.

[WARNING] The POM for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 is missing, no dependency information available

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 has not been downloaded from it before.

[WARNING] The POM for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 is missing, no dependency information available

忽然笑
浏览 759回答 1
1回答

慕的地10843

sonar-maven-plugin应该声明为插件而不是依赖项。<build>&nbsp; <pluginManagement>&nbsp; &nbsp; <plugins>&nbsp; &nbsp; &nbsp; <plugin>&nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.sonarsource.scanner.maven</groupId>&nbsp; &nbsp; &nbsp; &nbsp; <artifactId>sonar-maven-plugin</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; <version>3.6.0.1398</version>&nbsp; &nbsp; &nbsp; </plugin>&nbsp; &nbsp; </plugins>&nbsp; </pluginManagement></build>
随时随地看视频慕课网APP

相关分类

Java
我要回答