Maven未能找到codehaus artifact org.codehaus:codehaus-parent [英] Maven failure to find codehaus artifact org.codehaus:codehaus-parent
问题描述
现在它在这里表示Maven:所有存储库都镜像到Central,我们的Nexus由Sonatype托管。如果我正确阅读这篇文章,这意味着它应该继续工作(并且因为Central是默认存储库,所以我甚至不应该做任何更改)。
然而,我遇到了一个Maven项目的问题,它曾经被编译过(关闭之前),但现在失败了:
[INFO ]建立POM时出错(可能不是这个项目的POM)。
项目ID:org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01
原因:无法找到父项:org.codehaus:codehaus-parent for project:org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01 for project org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01
这是我的pom.xml的一个精简版本:
< project xmlns =http://maven.apache.org/POM/4.0.0
xmlns:xsi =http://www.w3。 org / 2001 / XMLSchema-instance
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> com.hp< / groupId>
< artifactId>设备状态服务< / artifactId>
<包装>战争< / packaging>
< version> 1.0.0< / version>
<名称>设备状态服务< /名称>
<属性>
< spring.version> 3.2.0.RELEASE< /spring.version>
< groovy-all.version> 2.3.7< /groovy-all.version>
< spock-core.version> 0.7-groovy-2.0< /spock-core.version>
< lombok.version> 1.12.2< /lombok.version>
...
< / properties>
<依赖关系>
...
< dependency>
< groupId> org.codehaus.groovy< / groupId>
< artifactId> groovy-all< / artifactId>
< version> $ {groovy-all.version}< / version>
< /依赖关系>
...
< dependency>
< groupId> org.projectlombok< / groupId>
< artifactId> lombok< / artifactId>
< version> $ {lombok.version}< / version>
< scope>提供< / scope>
< /依赖关系>
...
< dependency>
< groupId> org.spockframework< / groupId>
< artifactId> spock-core< / artifactId>
< version> $ {spock-core.version}< / version>
< scope> test< / scope>
< /依赖关系>
...
< dependency>
< groupId> org.codehaus.groovy.modules.http-builder< / groupId>
< artifactId> http-builder< / artifactId>
< version> 0.7< / version>
< scope> test< / scope>
< /依赖关系>
...
< /依赖关系>
< build>
< finalName> dss< / finalName>
<资源>
< resource>
<目录> src / main / resources< /目录>
< / resource>
< /资源>
< testResources>
< testResource>
<目录> src / test / resources< /目录>
< / testResource>
< / testResources>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-resources-plugin< / artifactId>
< version> 2.6< / version>
<配置>
<编码> UTF-8< /编码>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 3.1< / version>
<配置>
< compilerId> groovy-eclipse-compiler< / compilerId>
< verbose> false< /详细>
< compilerArguments>
< javaAgentClass> lombok.core.Agent< / javaAgentClass>
< / compilerArguments>
< fork> true< / fork>
< source> 1.6< / source>
< target> 1.6< / target>
<编码> UTF-8< /编码>
< / configuration>
<依赖关系>
< dependency>
< groupId> org.codehaus.groovy< / groupId>
< artifactId> groovy-eclipse-compiler< / artifactId>
< version> 2.9.1-01< / version>
< /依赖关系>
< dependency>
< groupId> org.codehaus.groovy< / groupId>
< artifactId> groovy-eclipse-batch< / artifactId>
< version> 2.3.7-01< / version>
< /依赖关系>
< dependency>
< groupId> org.projectlombok< / groupId>
< artifactId> lombok< / artifactId>
< version> $ {lombok.version}< / version>
< /依赖关系>
< /依赖关系>
< / plugin>
...
< / plugins>
< / build>
<个人资料>
<个人资料>
< id> dss< / id>
<激活>
< activeByDefault> false< / activeByDefault>
<属性>
<名称>可交付物< /名称>
<值> dss< /值>
< / property>
< / activation>
< build>
< plugins>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> rpm -maven-plugin< / artifactId>
< version> 2.1-alpha-1< / version>
<执行次数>
<执行>
<目标>
< goal> rpm< / goal>
< /目标>
< /执行>
< /执行次数>
<配置>
...
<名称> $ {交付物}< /名称>
< projversion> $ {pom.version}< / projversion>
< release> $ {BUILD_NUMBER}< / release>
< description>搜索:RPM包< / description>
< mappings>
<映射>
< directory> $ {tomcatInstallationDir}< / directory>
< filemode> 755< / filemode>
< username> tomcat< / username>
< groupname> tomcat< / groupname>
< sources>
< source>
< location> ../ Tomcat /< / location>
< / source>
< / sources>
< / mapping>
<映射>
< directory> $ {tomcatInstallationDir} / webapps< / directory>
< filemode> 755< / filemode>
< username> tomcat< / username>
< groupname> tomcat< / groupname>
< sources>
< source>
< location> target / $ {deliverfact} .war
< / location>
< destination> $ {deliverulat} .war< / destination>
< / source>
< / sources>
< / mapping>
< /映射>
<要求>
< require> palm-jre& gt; = 1.6.0_27-fcs< /要求>
< /要求>
< prefix> $ {tomcatInstallationDir}< / prefix>
< preinstallScriptlet>
< scriptFile> ../ PlatformEngine / rpm_scripts / pre_install.sh< / scriptFile>
< fileEncoding> utf-8< / fileEncoding>
< / preinstallScriptlet>
< postinstallScriptlet>
< scriptFile> ../ PlatformEngine / rpm_scripts / post_install.sh< / scriptFile>
< fileEncoding> utf-8< / fileEncoding>
< / postinstallScriptlet>
< preremoveScriptlet>
< scriptFile> ../ PlatformEngine / rpm_scripts / pre_uninstall.sh< / scriptFile>
< fileEncoding> utf-8< / fileEncoding>
< / preremoveScriptlet>
< postremoveScriptlet>
< scriptFile> ../ PlatformEngine / rpm_scripts / post_uninstall.sh< / scriptFile>
< fileEncoding> utf-8< / fileEncoding>
< / postremoveScriptlet>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / profile>
< / profiles>
< / project>
现在,在我的.m2目录中找到 groovy-all
项目一个pom / sha1和一个jar文件。但对于> groovy-eclipse-compiler
,我看到了pom / sha1,但没有jar文件。
我做错了什么? Codehaus迁移中的某些内容会以某种方式被搞砸了吗?或者(更糟糕的是)呢?
Maven工件已经存在很长时间了,没有迁移可能已经搞砸了。
既然我不是maven专家,我只能给你我所认为的原因。查看 groovy-eclipse-compiler 我看到
<库>
< repository>
< id> codehaus.org< / id>
< url> http://repository.codehaus.org< / url>
< / repository>
< / repositories>
我的假设是,这会导致maven查看该存储库,而这个存储库不再存在。如果这是真的,那么我对解决方案的建议是手动安装构件(它们都在maven中心)或使用像gradle这样的其他工具(尽管这可能超出了您的范围)来执行构建。
配置有这样的模式: < repositories>
< repository>
< id> codehaus.org< / id>
< url> http://nexus.codehaus.org/<一些郊区>< / url>
< / repository>
< / repositories>
使用 http://mvnrepository.com/artifact 例如可能会工作,但我还没有测试过。
So codehaus shut down (over the weekend, apparently): https://www.codehaus.org/
Now it says here that "Maven: All repositories are mirrored into Central, and our Nexus is hosted by Sonatype". If I am reading this correctly, this means that it should continue to work (and because Central is the default repository, I shouldn't even have any changes to make).
Yet I am having trouble with a Maven project that used to compile (before the shutdown), but now fails:
[INFO] Error building POM (may not be this project's POM).
Project ID: org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01
Reason: Cannot find parent: org.codehaus:codehaus-parent for project: org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01 for project org.codehaus.groovy:groovy-eclipse-compiler:maven-plugin:2.9.1-01
Here's a trimmed-down version of my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hp</groupId>
<artifactId>device-state-service</artifactId>
<packaging>war</packaging>
<version>1.0.0</version>
<name>device-state-service</name>
<properties>
<spring.version>3.2.0.RELEASE</spring.version>
<groovy-all.version>2.3.7</groovy-all.version>
<spock-core.version>0.7-groovy-2.0</spock-core.version>
<lombok.version>1.12.2</lombok.version>
...
</properties>
<dependencies>
...
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy-all.version}</version>
</dependency>
...
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
...
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>${spock-core.version}</version>
<scope>test</scope>
</dependency>
...
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7</version>
<scope>test</scope>
</dependency>
...
</dependencies>
<build>
<finalName>dss</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<verbose>false</verbose>
<compilerArguments>
<javaAgentClass>lombok.core.Agent</javaAgentClass>
</compilerArguments>
<fork>true</fork>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.1-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.3.7-01</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
</plugin>
...
</plugins>
</build>
<profiles>
<profile>
<id>dss</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>deliverable</name>
<value>dss</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1-alpha-1</version>
<executions>
<execution>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
...
<name>${deliverable}</name>
<projversion>${pom.version}</projversion>
<release>${BUILD_NUMBER}</release>
<description>Search: RPM package</description>
<mappings>
<mapping>
<directory>${tomcatInstallationDir}</directory>
<filemode>755</filemode>
<username>tomcat</username>
<groupname>tomcat</groupname>
<sources>
<source>
<location>../Tomcat/</location>
</source>
</sources>
</mapping>
<mapping>
<directory>${tomcatInstallationDir}/webapps</directory>
<filemode>755</filemode>
<username>tomcat</username>
<groupname>tomcat</groupname>
<sources>
<source>
<location>target/${deliverable}.war
</location>
<destination>${deliverable}.war</destination>
</source>
</sources>
</mapping>
</mappings>
<requires>
<require>palm-jre >= 1.6.0_27-fcs</require>
</requires>
<prefix>${tomcatInstallationDir}</prefix>
<preinstallScriptlet>
<scriptFile>../PlatformEngine/rpm_scripts/pre_install.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preinstallScriptlet>
<postinstallScriptlet>
<scriptFile>../PlatformEngine/rpm_scripts/post_install.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
<preremoveScriptlet>
<scriptFile>../PlatformEngine/rpm_scripts/pre_uninstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</preremoveScriptlet>
<postremoveScriptlet>
<scriptFile>../PlatformEngine/rpm_scripts/post_uninstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postremoveScriptlet>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Now, in my .m2 directory I find for the groovy-all
project a pom/sha1, and a jar file. But for groovy-eclipse-compiler
, I see the pom/sha1, but no jar file.
Am I doing something wrong? Did something in the Codehaus migration itself get screwed up somehow? Or (worse) both?
The maven artifacts are in central for a long time already, there is no migration that could have been screwed up for those.
Since I am no maven expert I can give you only what I assume is the cause. Looking at the pom for version 2.9.1-01 of the groovy-eclipse-compiler I see
<repositories>
<repository>
<id>codehaus.org</id>
<url>http://repository.codehaus.org</url>
</repository>
</repositories>
ans my assumption is, that this will cause maven to look in that repository, which does not exist anymore. If that is true, then my suggestion for a solution would be to manually install the artifacts (they are all on maven central) or to use a different tool like gradle (though that might be out of scope for you) to do the build.
EDIT: I have been told that you could change your settings.xml to fix repository configurations with a pattern like this:
<repositories>
<repository>
<id>codehaus.org</id>
<url>http://nexus.codehaus.org/<some suburl></url>
</repository>
</repositories>
Using http://mvnrepository.com/artifact for example might then work, but I have not tested this.
这篇关于Maven未能找到codehaus artifact org.codehaus:codehaus-parent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!