我正在嘗試將 pom 文件的所有傳遞依賴(lài)項(xiàng)和插件下載到本地文件夾中,然后使用它離線(xiàn)運(yùn)行 sonarqube。我對(duì) Maven 相當(dāng)陌生,所以我可能在這里做錯(cuò)了,但我認(rèn)為 maven maven-dependency-plugin:3.1.1:go-offline 沒(méi)有下載運(yùn)行 sonarqube 所需的所有插件,這會(huì)導(dǎo)致錯(cuò)誤。這是我嘗試過(guò)的。將所有依賴(lài)項(xiàng)下載到新文件夾mvn -D"maven.repo.local"="c:\test\test" org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline運(yùn)行聲納mvn -o -D"maven.repo.local"="c:\test\test" sonar:sonar然而,這給了我以下錯(cuò)誤[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
1 回答

慕的地10843
TA貢獻(xiàn)1785條經(jīng)驗(yàn) 獲得超8個(gè)贊
sonar-maven-plugin應(yīng)該聲明為插件而不是依賴(lài)項(xiàng)。
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
</plugin>
</plugins>
</pluginManagement>
</build>
添加回答
舉報(bào)
0/150
提交
取消