我正在尝试通过在pom.xml中使用以下插件配置来集中Java的Checkstyle配置:
<!-- Checkstyle Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<dependencies>
<dependency>
<groupId>me.myorganization</groupId>
<artifactId>checkstyle-config</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation>
<linkXRef>false</linkXRef>
</configuration>
<executions>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
checkstyle-config依赖项是一个简单的maven项目,具有checkstyle.xml配置作为资源,但是问题在于此项目位于自定义/私有存储库中,并且如果未在本地缓存,则不会工作。如果我进入我的checkstyle-config项目并运行mvn install
,它应该可以正常工作,但是如果我清除缓存并在我的主项目中运行mvn verify
,则无法解决配置依赖项。>
有什么想法吗?
Obs1:我创建了另一个测试项目,并将配置项目添加为依赖项(不使用checkstyle插件),并且已解决并下载。
Obs2:我。myorganization只是保护原始地址的占位符。
Obs3:我已经尝试过在两个位置,插件的依赖项和普通pom依赖项中添加依赖项,但仍然无法正常工作。
谢谢