Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT #537

Closed
devsohi opened this issue Dec 18, 2017 · 5 comments
Closed

Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT #537

devsohi opened this issue Dec 18, 2017 · 5 comments

Comments

@devsohi
Copy link

devsohi commented Dec 18, 2017

Hi ,
This might be duplicate of #490 But for me its not working .
I am trying to build KSQL Module

Details


Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-84-generic", arch: "amd64", family: "unix"

Project Details :

On branch 4.0.x
Your branch is up-to-date with 'origin/4.0.x'.
nothing to commit, working directory clean

Getting following error :

[DEBUG] Using local repository at /home/sohanvir/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/sohanvir/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for central (http://central).
[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for confluent (http://packages.confluent.io/maven/).
[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for confluent-snapshots (https://s3-us-west-2.amazonaws.com/confluent-snapshots/).
[DEBUG] Could not find metadata io.confluent:common:4.0.0-SNAPSHOT/maven-metadata.xml in local (/home/sohanvir/.m2/repository)
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://artifactory.sohi.com/nexus/content/groups/public
Downloading: http://artifactory.sohi.com/nexus/content/groups/public/io/confluent/common/4.0.0-SNAPSHOT/maven-metadata.xml
[DEBUG] Writing resolution tracking file /home/sohanvir/.m2/repository/io/confluent/common/4.0.0-SNAPSHOT/resolver-status.properties
[DEBUG] Could not find metadata io.confluent:common:4.0.0-SNAPSHOT/maven-metadata.xml in nexus (http://artifactory.sohi.com/nexus/content/groups/public)
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://artifactory.sohi.com/nexus/content/groups/public
Downloading: http://artifactory.sohi.com/nexus/content/groups/public/io/confluent/common/4.0.0-SNAPSHOT/common-4.0.0-SNAPSHOT.pom
[DEBUG] Writing resolution tracking file /home/sohanvir/.m2/repository/io/confluent/common/4.0.0-SNAPSHOT/common-4.0.0-SNAPSHOT.pom.lastUpdated
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT in nexus (http://artifactory.sohi.com/nexus/content/groups/public) and 'parent.relativePath' points at wrong local POM @ line 7, column 13

	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
	at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
	at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]   
[ERROR]   The project io.confluent.ksql:ksql-parent:4.0.0-SNAPSHOT (/home/sohanvir/softwares/confluent-3.3.0/ksql/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT in nexus (http://artifactory.sohi.com/nexus/content/groups/public) and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT in nexus (http://artifactory.sohi.com/nexus/content/groups/public)
@miguno
Copy link
Contributor

miguno commented Dec 18, 2017

I just tested this on a fresh machine with the following commands, and it does work for me out-of-the-box:

$ git clone git@github.com:confluentinc/ksql.git && cd ksql/
$ git checkout 4.0.x
$ mvn clean compile install -DskipTests

I noticed though that you are apparently behind a proxy / mirror nexus -- from your output above:

[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for central (http://central).
[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for confluent (http://packages.confluent.io/maven/).
[DEBUG] Using mirror nexus (http://artifactory.sohi.com/nexus/content/groups/public) for confluent-snapshots (https://s3-us-west-2.amazonaws.com/confluent-snapshots/).

Perhaps your company's mirror isn't working properly? The following lines indicate this:

[DEBUG] Could not find metadata io.confluent:common:4.0.0-SNAPSHOT/maven-metadata.xml in nexus (http://artifactory.sohi.com/nexus/content/groups/public)
Downloading: http://artifactory.sohi.com/nexus/content/groups/public/io/confluent/common/4.0.0-SNAPSHOT/common-4.0.0-SNAPSHOT.pom
[FATAL] Non-resolvable parent POM: Could not find artifact io.confluent:common:pom:4.0.0-SNAPSHOT in nexus (http://artifactory.sohi.com/nexus/content/groups/public) and 'parent.relativePath' points at wrong local POM @ line 7, column 13

The Confluent snapshot repository does contain the common-4.0.0-SNAPSHOT.pom at the path io/confluent/common/4.0.0-SNAPSHOT/common-4.0.0-SNAPSHOT.pom:

$ curl https://s3-us-west-2.amazonaws.com/confluent-snapshots/io/confluent/common/4.0.0-SNAPSHOT/common-4.0.0-SNAPSHOT.pom

returns

<!--~
  ~ Copyright 2017 Confluent Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~-->
<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>

    <parent>
        <artifactId>common-parent</artifactId>
        <groupId>io.confluent</groupId>
        <version>4.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>common</artifactId>
    <packaging>pom</packaging>
    <name>Common</name>

    <dependencies>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>common-utils</artifactId>
        </dependency>
    </dependencies>
</project>

I also saw that your maven build complained about the following (the first line in the debug output above):

[DEBUG] Could not find metadata io.confluent:common:4.0.0-SNAPSHOT/maven-metadata.xml in nexus (http://artifactory.sohi.com/nexus/content/groups/public)

There is a maven metadata file for 4.0.0-SNAPSHOT in the Confluent snapshot repository but with a slightly different name: It's not maven-metadata.xml but maven-metadata-confluent-nexus-jenkins.xml (see http://maven.apache.org/ref/3.2.5/maven-repository-metadata/).

$ curl -s https://s3-us-west-2.amazonaws.com/confluent-snapshots/ | xmllint --format - | grep "io/confluent/common/"  | grep "maven-metadata" | grep "\.xml</Key>$"
    <Key>io/confluent/common/4.0.0-SNAPSHOT/maven-metadata-confluent-nexus-jenkins.xml</Key>
    <Key>io/confluent/common/4.1.0-SNAPSHOT/maven-metadata-confluent-nexus-jenkins.xml</Key>

@devsohi: Could you compare my output to what you are seeing locally?

Given that the build works locally for me (without a proxy/mirror in-between me and the Confluent snapshot repository) but not for you (with a proxy/mirror), I suspect the culprit is either

  1. Your proxy/mirror and e.g. how it is configured to work with the Confluent snapshot repo, or
  2. (I think this is less likely) The Confluent snapshot repository isn't published in a way that it can be mirrored properly by Artifactory.

@devsohi
Copy link
Author

devsohi commented Dec 18, 2017 via email

@devsohi
Copy link
Author

devsohi commented Dec 18, 2017

Hi,
I was able to build by following steps (mentioning in case someone else facing same problem):

  1. Build with maven bypassing company's mirror repository in pom.xml
    mvn --settings /home/sohi/.m2/non-company-settings.xml

  2. If anyone is facing enforcer plugin error during build , add following in ksql's pom.xml

  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals><goal>enforce</goal></goals>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


Thanks
Sohi

@miguno
Copy link
Contributor

miguno commented Dec 18, 2017

Thanks a lot for reporting back, @devsohi ! This will help other users that run into the same Artifactory setup problem. 👍

@miguno
Copy link
Contributor

miguno commented Dec 18, 2017

Added #538 to help other users run into the same issue.

@miguno miguno closed this as completed Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants