maven - Detekt 插件无法从 Maven 中心下载
问题描述
我正在使用 Kotlin 并希望使用 Detekt 插件进行静态分析。我的问题是,当我想从 Maven 中央存储库下载它时,它给了我以下错误。但是当我使用公司的存储库(Nexus)时,它不会给我任何错误并且可以顺利下载。我不明白这一点。
有人能告诉我为什么会这样吗?我想使用这个插件,还没有找到任何其他选择。
以下是我的错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (detekt) on project agathe: Execution detekt of goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.8 or one of its dependencies could not be resolved: Could not find artifact com.beust:jcommander:jar:1.74 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
请在下面找到我的 POM 文件。
<properties>
..
<sonar.kotlin.detekt.reportPaths>${project.build.directory}/detekt.xml</sonar.kotlin.detekt.reportPaths>
..
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<!-- This can be run separately with mvn antrun:run@detekt -->
<id>detekt</id>
<phase>verify</phase>
<configuration>
<target name="detekt">
<java taskname="detekt" dir="${basedir}"
fork="true"
failonerror="false"
classname="io.gitlab.arturbosch.detekt.cli.Main"
classpathref="maven.plugin.classpath">
<arg value="--input"/>
<arg value="${basedir}/src"/>
<arg value="--filters"/>
<arg value=".*/target/.*,.*/resources/.*"/>
<arg value="--report"/>
<arg value="xml:${project.build.directory}/detekt.xml"/>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
<artifactId>detekt-cli</artifactId>
<version>1.0.0-RC14</version>
</dependency>
</dependencies>
</plugin>
解决方案
推荐阅读
- data-structures - 迭代快速排序的时间复杂度
- jupyter-notebook - “ipython 2.4.1 没有额外的功能‘全部’”
- flutter - 如何有效地从飞镖地图中检索地图?
- salesforce - 未找到名为 markup://lgc:bg 的模块:[markup://c:accountManagerApex]
- python - 熊猫随机读取 df
- java - 我想获取该月的最后一个日期并添加 n 个月,但日历实例在 Java 中只需要 30 天
- python - 如何在烧瓶 sql 炼金术中使用 group by
- ionic-framework - Ionic-Vue Ionicons 5.xx 不显示图标
- python-3.x - 从 HTML 页面读取值 - nseindia
- python-3.x - 在 VTK 中创建图形