Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545872

Summary: [tycho] Tycho fails to resolve on latest maven snapshot builds (3.6.1-SNAPSHOT ~0be26449fb96774be126a6ad245d1a98dc71907c)
Product: [Eclipse Project] Platform Reporter: Raymond Auge <raymond.auge>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: mat.booth, pascal.huerlimann, paul-eclipse, sravankumarl, titou10.titou10, torkildr
Version: 4.12   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Raymond Auge CLA 2019-03-27 21:55:52 EDT
I'm filling this preemptively because I happened to be testing the latest maven snapshot build and happen to run an eclipse build using it.

The project was
> eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.services/

> Maven was:
(master) org.eclipse.osgi.services]$ mvn -v
Apache Maven 3.6.1-SNAPSHOT (1f6fffe60af946beb9da16691ffc5ed21b7728c6; 2019-03-27T21:24:36-04:00)
Maven home: /home/rotty/bin/maven/apache-maven-latest
Java version: 1.8.0_202, vendor: Azul Systems, Inc., runtime: /usr/lib/jvm/zulu-8-amd64/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-16-generic", arch: "amd64", family: "unix"

> The command was:
mvn clean install

> The output was:
org.eclipse.osgi.services]$ mvn clean install
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: org.eclipse.osgi:org.eclipse.osgi.services:3.8.0-SNAPSHOT @ /home/rotty/projects/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.services/pom.xml
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository/
[INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20190226160451/repository/
[INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20190226160451/repository/
[INFO] Fetching p2.index from https://download.eclipse.org/modeling/emf/emf/builds/release/2.17/
[INFO] Adding repository https://download.eclipse.org/modeling/emf/emf/builds/release/2.17
[INFO] Adding repository http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.15.v20190215
[INFO] Fetching p2.index from http://download.eclipse.org/rt/ecf/3.14.4/site.p2/
[INFO] Fetching p2.index from http://download.eclipse.org/rt/ecf/3.14.4/site.p2/
[INFO] Adding repository http://download.eclipse.org/rt/ecf/3.14.4/site.p2
[INFO] Fetching p2.index from http://download.eclipse.org/cbi/updates/license/2.0.1.v20180423-1114/
[INFO] Adding repository http://download.eclipse.org/cbi/updates/license/2.0.1.v20180423-1114
[INFO] Fetching p2.index from http://download.eclipse.org/egit/updates-5.2/
[INFO] Fetching p2.index from http://download.eclipse.org/egit/updates-5.2/
[INFO] Adding repository http://download.eclipse.org/egit/updates-5.2
[INFO] Fetching p2.index from http://download.eclipse.org/reddeer/releases/2.4.0/
[INFO] Fetching p2.index from http://download.eclipse.org/reddeer/releases/2.4.0/
[INFO] Adding repository http://download.eclipse.org/reddeer/releases/2.4.0
[INFO] Resolving dependencies of MavenProject: org.eclipse.osgi:org.eclipse.osgi.services:3.8.0-SNAPSHOT @ /home/rotty/projects/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.services/pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.osgi.services 3.8.0.qualifier
[ERROR]   Missing requirement: org.eclipse.osgi.services 3.8.0.qualifier requires 'java.package; org.osgi.util.promise [1.0.0,2.0.0)' but it could not be found
[ERROR] 
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: org.eclipse.osgi:org.eclipse.osgi.services:3.8.0-SNAPSHOT @ /home/rotty/projects/eclipse.platform.releng.aggregator/rt.equinox.framework/bundles/org.eclipse.osgi.services/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException


It seems the build is using
> <tycho.version>1.4.0-SNAPSHOT</tycho.version>

not sure if this might be solved by the 1.5 release or some such.
Comment 1 Raymond Auge CLA 2019-03-27 21:57:51 EDT
Correction on the maven sha. It's actually 0be26449fb96774be126a6ad245d1a98dc71907c
Comment 2 Sravan Kumar Lakkimsetti CLA 2019-03-27 22:21:36 EDT
In eclipse to build individual plugins(maven projects) we need to use build-individual-bundles profile. Do you see same error with this command?

mvn clean install -Pbuild-individual-bundles
Comment 3 Raymond Auge CLA 2019-03-27 22:34:00 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #2)
> In eclipse to build individual plugins(maven projects) we need to use
> build-individual-bundles profile. Do you see same error with this command?
> 
> mvn clean install -Pbuild-individual-bundles

Nope! That didn't work, same problem.

FYI, I've never had to use -Pbuild-individual-bundles in the rt.eclipse.* projects (disclosure: I'm the maintainer of org.eclipse.equinox.http.servlet).
Comment 4 Sravan Kumar Lakkimsetti CLA 2019-03-27 22:42:39 EDT
(In reply to Raymond Auge from comment #3)
> (In reply to Sravan Kumar Lakkimsetti from comment #2)
> > In eclipse to build individual plugins(maven projects) we need to use
> > build-individual-bundles profile. Do you see same error with this command?
> > 
> > mvn clean install -Pbuild-individual-bundles
> 
> Nope! That didn't work, same problem.
> 
> FYI, I've never had to use -Pbuild-individual-bundles in the rt.eclipse.*
> projects (disclosure: I'm the maintainer of
> org.eclipse.equinox.http.servlet).

Till couple of years ago we were explicitly using build-individual-bundles profile. With some effort from Alex the profile selection is automatic now. That might be the reason why it is working for you.

Can you point me a link where I can download maven 3.6.1?
Comment 5 Raymond Auge CLA 2019-03-27 23:00:15 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #4)
> (In reply to Raymond Auge from comment #3)
> > (In reply to Sravan Kumar Lakkimsetti from comment #2)
> > > In eclipse to build individual plugins(maven projects) we need to use
> > > build-individual-bundles profile. Do you see same error with this command?
> > > 
> > > mvn clean install -Pbuild-individual-bundles
> > 
> > Nope! That didn't work, same problem.
> > 
> > FYI, I've never had to use -Pbuild-individual-bundles in the rt.eclipse.*
> > projects (disclosure: I'm the maintainer of
> > org.eclipse.equinox.http.servlet).
> 
> Till couple of years ago we were explicitly using build-individual-bundles
> profile. With some effort from Alex the profile selection is automatic now.
> That might be the reason why it is working for you.
> 
> Can you point me a link where I can download maven 3.6.1?

checkout the repo [1] and follow the quick build [2] steps, takes no more than 2 minutes to complete the whole process.

[1] https://github.com/apache/maven
[2] https://github.com/apache/maven#quick-build

Once you have a build, set your MAVEN_HOME and/or add it to your path.
Comment 6 Sravan Kumar Lakkimsetti CLA 2019-03-28 00:46:31 EDT
I see that with Maven 3.6.1 the following line is missing in the log.

Adding repository http://download.eclipse.org/eclipse/updates/4.12-I-builds

The dependencies are available at the above link. Since this repository was not added maven is not able to get the required dependencies
Comment 7 Sravan Kumar Lakkimsetti CLA 2019-03-28 01:01:16 EDT
The basic problem here is the eclipse I-builds repository is not getting added into maven reactor. 

@mat 
can you help us in this regard?
Comment 8 Torkild Resheim CLA 2019-05-03 08:51:05 EDT
I'm seeing the same issue with one of our product builds. After running "brew update" I ended up with Maven 3.6.1 (release) which failed to resolve dependencies. When downgrading to Maven 3.5.4 I was able to build the product again.

Note that for this product build I'm not using target platform configuration, but rather a list of repositories with the "p2" layout.
Comment 9 Pascal Hürlimann CLA 2019-05-10 05:13:29 EDT
I have just encountered this problem after upgrading from maven 3.6.0 to 3.6.1. Building several of our projects fails after the upgrade, with maven being unable to resolve osgi dependencies. 

> Note that for this product build I'm not using target platform
> configuration, but rather a list of repositories with the "p2" layout.

This is also what we do. See https://github.com/jazz-community/jazz-plugin-base-service for an example of how we configure all our builds.

Downgrading to 3.6.0 has solved the problem.
Comment 10 Paul Pazderski CLA 2019-05-10 05:29:42 EDT
Maven 3.6.1 broke dependency resolution for p2 repositories. Either wait for 3.6.2 or downgrade to 3.6.0.

*** This bug has been marked as a duplicate of bug 546463 ***