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

Bug 552704

Summary: Use pomless builds in eclipse.platform.text
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: TextAssignee: Christoph Laeubrich <laeubi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtako, akurtakov, laeubi, Lars.Vogel
Version: 4.14   
Target Milestone: 4.14 M3   
Hardware: PC   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=550609
https://git.eclipse.org/r/152105
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=159deab97eeaad26f99a9234460f9ec87aac745f
Whiteboard:

Description Lars Vogel CLA 2019-11-05 10:51:45 EST
With Tycho providing better support for pomless build, I suggest to convert more platform repos to use it.
Comment 1 Lars Vogel CLA 2019-11-05 10:52:16 EST
Christoph, something for you?
Comment 2 Christoph Laeubrich CLA 2019-11-06 00:36:50 EST
(In reply to Lars Vogel from comment #1)
> Christoph, something for you?

I can take a look at it, but there is one big problem with most of the platform repos, it seems they are not self-contained, so I need to know how to build the repo from commandline, what I did is:

- cloned git://git.eclipse.org/gitroot/platform/eclipse.platform.text.git
- run mvn clean install

> [FATAL] Non-resolvable parent POM for eclipse.platform.text:eclipse.platform.text:4.14.0-SNAPSHOT: Could not find artifact org.eclipse:eclipse-platform-parent:pom:4.14.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 15, column 11

The relative path points to 

> <relativePath>../eclipse-platform-parent</relativePath>

what is a wrong reference anyways (or at least confusing) as one would expect a reference to a pom not a folder.

So I now googled around and found there is a file in the releng repro that seems to fit and changed the reference to

> <relativePath>../eclipse.platform.releng.aggregator/eclipse-platform-parent/pom.xml</relativePath>

Now the build starts but fails with 

> ERROR] Internal error: java.lang.RuntimeException:
> Could not resolve target platform specification artifact 
> org.eclipse:eclipse-sdk-prereqs:target:4.14.0-SNAPSHOT

okay so next one installing eclipse.platform.releng.aggregator/eclipse.platform.releng.prereqs.sdk/pom.xml into my local maven repository.

Now build gets further but fails sometimes later with:

> [ERROR] Cannot resolve project dependencies:
> [ERROR]   Software being installed: org.eclipse.core.filebuffers.tests 3.11.500.qualifier
> [ERROR]   Missing requirement: org.eclipse.core.filebuffers.tests 3.11.500.qualifier requires 'osgi.bundle; org.eclipse.core.runtime [3.5.0,4.0.0)' but it could not be found

I reported a similar problem in Bug 550609, but never got feedback again. So maybe one can't build that stuff under Linux (can't find a hint about it anywhere), any special setup is needed (and maybe documented but I can't found it).

Maybe this is a trivial problem for long-time platform developers but for newcommers its really hard to setup/run stuff and yes I used oompf to setup an Eclipse-IDE for Developers, even though I'm then hit by Bug 550400 sadly it seems no one is really feeling responsible for this, this does not really helps, beside that it should be possible to run that stuff from console anyways.

So if you could give me a hint how to actually build the repo from commandline (or eclipse) so I can actually test my changes without submitting them to gerrit first I think I can provide a patch for this :-)
Comment 3 Lars Vogel CLA 2019-11-06 01:12:05 EST
Does text not state it in its Readme? I added the build command to several repos sounds like I forgot to add it here.

You need to add the profile:

mvn clean verify -Pbuild-individual-bundles
Comment 4 Christoph Laeubrich CLA 2019-11-06 01:18:18 EST
~/git/eclipse.platform.text/org.eclipse.text.tests$ mvn clean verify -Pbuild-individual-bundles
...
[INFO] Resolving dependencies of MavenProject: org.eclipse.text:org.eclipse.text.tests:3.12.400-SNAPSHOT @ eclipse.platform.text/org.eclipse.text.tests/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.text.tests 3.12.400.qualifier
[ERROR]   Missing requirement: org.eclipse.text.tests 3.12.400.qualifier requires 'osgi.bundle; org.eclipse.core.commands [3.5.0,4.0.0)' but it could not be found
Comment 5 Lars Vogel CLA 2019-11-06 01:25:42 EST
I get another error. Alex, something wrong with our build?

[INFO] Resolving dependencies of MavenProject: org.eclipse.core:org.eclipse.core.filebuffers.tests:3.11.500-SNAPSHOT @ /home/vogella/git/eclipse.platform.text/org.eclipse.core.filebuffers.tests/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.core.filebuffers.tests 3.11.500.qualifier
[ERROR]   Missing requirement: org.eclipse.core.filebuffers.tests 3.11.500.qualifier requires 'osgi.bundle; org.eclipse.core.runtime [3.5.0,4.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.core:org.eclipse.core.filebuffers.tests:3.11.500-SNAPSHOT @ /home/vogella/git/eclipse.platform.text/org.eclipse.core.filebuffers.tests/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
Comment 6 Lars Vogel CLA 2019-11-06 01:28:30 EST
Ah, always the same, I tend to forget this.

Do not use Maven 3.6.1 or 3.6.2, as they are buggy. For example, 3.5.0 works (continues at the moment over my error).
Comment 7 Lars Vogel CLA 2019-11-06 01:32:26 EST
Maven 3.5.4. is required.
Comment 8 Christoph Laeubrich CLA 2019-11-06 01:35:01 EST
(In reply to Lars Vogel from comment #6)
> Ah, always the same, I tend to forget this.
> 
> Do not use Maven 3.6.1 or 3.6.2, as they are buggy. For example, 3.5.0 works
> (continues at the moment over my error).

Thanks it now starts building, it might be good to remove Maven 3.6.1 from the "For Eclipse-Contributors" Edition then as it seems to be the default Embeeded Version there.
Comment 9 Christoph Laeubrich CLA 2019-11-06 01:56:40 EST
One problem with transforming this to pomless build:

The parent uses <groupId>eclipse.platform.text</groupId>
But individual bundles using <groupId>org.eclipse.ui</groupId> or <groupId>org.eclipse.jface</groupId> ...

As pomless inherits the groupId from parent this would result in change of groupId in modules to eclipse.platform.text, don't know if this is an issue for you?
Comment 10 Eclipse Genie CLA 2019-11-06 02:10:41 EST
New Gerrit change created: https://git.eclipse.org/r/152105
Comment 11 Christoph Laeubrich CLA 2019-11-06 02:14:04 EST
I created a gerrit for the trivial cases, the test uses individual properties and configurations that are currently not supported by pomless-builds see Bug 552370

Beside this, I wonder if it would not be a good idea to enable the build-individual-bundles by default (what are the cases where it should not be used?) and provide option to DISABLE it and remove the parent-pom relative path as it does not seem to server any useful path.
Comment 12 Lars Vogel CLA 2019-11-06 02:22:07 EST
(In reply to Christoph Laeubrich from comment #11)

> Beside this, I wonder if it would not be a good idea to enable the
> build-individual-bundles by default (what are the cases where it should not
> be used?) and provide option to DISABLE it and remove the parent-pom
> relative path as it does not seem to server any useful path.

Please open a bug for that, IIRC there were some issues with it, as the aggregator build were not allowed to use this profile.
Comment 13 Lars Vogel CLA 2019-11-06 02:23:27 EST
Christoph, can you set the metadata of the bug (assign it to you, set milestone). You are on the path to become a platform committer :-) and should start doing this yourself.
Comment 14 Alexander Kurtakov CLA 2019-11-06 02:46:23 EST
(In reply to Christoph Laeubrich from comment #11)
> I created a gerrit for the trivial cases, the test uses individual
> properties and configurations that are currently not supported by
> pomless-builds see Bug 552370
> 
> Beside this, I wonder if it would not be a good idea to enable the
> build-individual-bundles by default (what are the cases where it should not
> be used?) and provide option to DISABLE it and remove the parent-pom
> relative path as it does not seem to server any useful path.

build-individual-bundles is enabled by default for each repo - it doesn't download eclipse-platform-parent and target. Aka if you once run 'mvn clean verify -Pbuild-individual-bundles' after that you can just run 'mvn clean verify'. This is the automation level I got to few years ago. If you make it fetch the additional artifacts that would be nice.
Comment 15 Alexander Kurtakov CLA 2019-11-06 02:48:12 EST
Regarding groupId - publishing to maven central is not using these poms but  generates new one and uses 3 groupIds only e.g. https://mvnrepository.com/artifact/org.eclipse.platform/org.eclipse.text so this change of groupId shouldn't be a problem.
Comment 17 Christoph Laeubrich CLA 2019-11-06 03:32:04 EST
Thanks for clarification, I assigned that to me now but how do I know the Target milestone? Is it always the highest in the list?
Comment 18 Lars Vogel CLA 2019-11-06 03:34:08 EST
(In reply to Christoph Laeubrich from comment #17)
> Thanks for clarification, I assigned that to me now but how do I know the
> Target milestone? Is it always the highest in the list?

No, we are currently developing 4.14 M3. Announcements are send to the eclipse-dev@eclipse.org mailing list to which you should register.