Non-resolvable parent POM
Asked Answered
A

1

6

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:[email protected]: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.

Affenpinscher answered 19/5, 2014 at 10:55 Comment(3)
I can get repository.mulesoft.org/nexus/content/repositories/releases/org/… without a problem. Can you access it from browser? Is there space in url in error text in actual message or that is a copy-paste problem? In (mule/_tools)Torrlow
yes I can access the link from my browser. space in the url is copy-paste problem. the mule-devkit-parent-3.4.3 is present in my local repository. Any temporary fix for this issue?Affenpinscher
I think, as a temporary fix you may want to download source of parent project, add it to your workspace and set path to it in <parent><relativePath>...Torrlow
N
4

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.

Nozicka answered 19/5, 2014 at 13:13 Comment(5)
The parent pom is getting downloaded to my local m2 repo. The auto generated pom.xml file of my project is showing error in the <parent> tag. Path to which pom file in the command you have mentioned should I use? I tried using path to the parent pom in m2 repo but it gave a build failure.Affenpinscher
There should be no valid parent POM in your m2 repo because of the error Could not transfer artifact. Can you please check twice that Maven actually downloaded org.mule.tools.devkit:mule-devkit-parent:pom:3.4.3 from http://repository.mulesoft.org/releases/? Is the content of the file correct? Does the checksum match?Nozicka
I have a file by the name "mule-devkit-parent-3.4.3" located at path "C:\Users\sh265993\.m2\repository\org\mule\tools\devkit\mule-devkit-parent\3.4.3". Its file extension is .pom . I checked its contents and they seem correct to me.Affenpinscher
Then the metadata is outdated. Move C:\Users\sh265993\.m2\repository\org\mule\tools\devkit\mule-devkit-parent somewhere else and run Maven again.Nozicka
I cleared the .m2 repo and started again from the scratch. the error got resolved. But now I am not able to install the generated UpdateSite.zip file in my mule studio as shown in the tutorial. I have added the path "Hello-Connector - file:/D:/Mule/Examples/abc/hello-connector/target/UpdateSite.zip" but it is giving error that it can find that pathAffenpinscher

© 2022 - 2024 — McMap. All rights reserved.