Non-resolvable parent POM

落爺英雄遲暮 提交于 2020-03-18 05:09:10

问题


I am trying to develop a custom connector for mule by following http://www.mulesoft.org/documentation/display/current/Creating+a+Connector+Project tutorial. As shown in the tutorial, I am creating the project through command line by executing

mvn archetype:generate
    -DarchetypeGroupId=org.mule.tools.devkit
    -DarchetypeArtifactId=mule-devkit-archetype-cloud-connector
    -DarchetypeVersion=3.4.3
    -DgroupId=org.hello
    -DartifactId=hello-connector
    -Dversion=1.0-SNAPSHOT
    -DmuleConnectorName=Hello
    -Dpackage=org.hello
    -DarchetypeRepository=http://repository.mulesoft.org/releases

After importing the project to mule studio I am getting following error in my pom.xml file near the parent tag.

Project build error: Non-resolvable parent POM:
        Could not transfer artifact
        org.mule.tools.devkit:mule-devkit-parent:pom:3.4.3 from/to
        mulesoft-releases (http://repository.mulesoft.org/releases/):
        connection timed out to
        http://repository.mulesoft.org/releases/org/mule/tools/devkit/mule-devkit-parent/3.4.3/mule-devkit-parent-3.4.3.pom
        and 'parent.relativePath' points at wrong local POM.

Here is my pom.xml file.

<?xml version="1.0" encoding="UTF-8"?>
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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.hello</groupId>
    <artifactId>hello-connector</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>mule-module</packaging>
    <name>Hello Connector</name>

    <parent>
        <groupId>org.mule.tools.devkit</groupId>
        <artifactId>mule-devkit-parent</artifactId>
        <version>3.4.3</version>
    </parent>

    <properties>
        <junit.version>4.9</junit.version>
        <mockito.version>1.8.2</mockito.version>
        <jdk.version>1.7</jdk.version>
        <category>Community</category>
        <licensePath>LICENSE.md</licensePath>
        <devkit.studio.package.skip>false</devkit.studio.package.skip>
    </properties>

    <scm>
        <connection>scm:git:git://github.com:mulesoft/hello-connector.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/hello-connector.git</developerConnection>
        <url>http://github.com/mulesoft/hello-connector</url>
    </scm>

    <repositories>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshots Repository</name>
            <url>http://repository.mulesoft.org/snapshots/</url>
            <layout>default</layout>
        </repository>
    </repositories>

</project>

I have changed the jdk version to 1.7. it was 1.6 in the auto generated pom. ignore any error in the heading, some formatting issue. I have tried various solutions mentioned on here but am not able to resolve the issue.


回答1:


There is probably a firewall between your computer and the internet. You either have to configure Java to use this proxy.

Or you must download the parent POM manually and install it yourself into the local m2 repo. See this question how to do that: How to manually install an artifact in Maven 2?

Since you only need to install a POM, you need to trick mvn install:install-file:

mvn install:install-file -Dfile=<path-to-pomfile> -Dpackaging=pom -DpomFile=<path-to-pomfile>

This command will just install the POM itself.



来源:https://stackoverflow.com/questions/23735976/non-resolvable-parent-pom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!