Skip to content

Conversation

@chrisrueger
Copy link
Contributor

@chrisrueger chrisrueger commented Sep 16, 2025

This adds support building bnd with maven via Eclipse Tycho 4.0.13 See https://tycho.eclipseprojects.io/doc/4.0.13/BndBuild.html

While the gradle build is still the official way of building bnd, this could serve as an alternative for contributors which are more familiar with Maven.

Example

e.g. build inside the repo root with:

mvn clean verify

or

mvn clean verify -fae (to skip a current error in org.bndtools.p2 which will go away after #6808 has been merged to master)

[INFO] Reactor Summary:
[INFO] 
[INFO] configurator 1.0.0-SNAPSHOT ........................ SUCCESS [  0.001 s]
[INFO] bnd-parent 7.2.0.202509162244-SNAPSHOT ............. SUCCESS [  0.000 s]
[INFO] demo 1.0.0 ......................................... SUCCESS [  1.913 s]
[INFO] biz.aQute.bnd.test 7.2.0.202509162244-SNAPSHOT ..... SUCCESS [  1.070 s]
[INFO] aQute.libg 7.2.0.202509162244-SNAPSHOT ............. SUCCESS [  6.431 s]
[INFO] biz.aQute.bnd.util 7.2.0.202509162244-SNAPSHOT ..... SUCCESS [  3.765 s]
[INFO] biz.aQute.bnd.annotation 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.433 s]
[INFO] biz.aQute.bndlib 7.2.0.202509162244-SNAPSHOT ....... SUCCESS [  9.398 s]
[INFO] biz.aQute.http.testservers 7.2.0.202509162244-SNAPSHOT SUCCESS [  2.636 s]
[INFO] biz.aQute.repository 7.2.0.202509162244-SNAPSHOT ... SUCCESS [  4.110 s]
[INFO] biz.aQute.launchpad 7.2.0.202509162244-SNAPSHOT .... SUCCESS [  2.241 s]
[INFO] biz.aQute.bnd.runtime 7.2.0.202509162244-SNAPSHOT .. SUCCESS [  2.595 s]
[INFO] bndtools.api 7.2.0.202509162244-SNAPSHOT ........... SUCCESS [  1.237 s]
[INFO] demo-fragment 1.0.0 ................................ SUCCESS [  0.051 s]
[INFO] biz.aQute.bnd.pde 7.2.0.202509162244-SNAPSHOT ...... SUCCESS [  1.207 s]
[INFO] org.bndtools.applaunch 7.2.0.202509162244-SNAPSHOT . SUCCESS [  0.996 s]
[INFO] biz.aQute.tester 7.2.0.202509162244-SNAPSHOT ....... SUCCESS [  1.651 s]
[INFO] biz.aQute.junit 7.2.0.202509162244-SNAPSHOT ........ SUCCESS [  2.884 s]
[INFO] biz.aQute.launcher 7.2.0.202509162244-SNAPSHOT ..... SUCCESS [  2.130 s]
[INFO] biz.aQute.tester.junit-platform 7.2.0.202509162244-SNAPSHOT SUCCESS [  2.014 s]
[INFO] biz.aQute.bnd.embedded-repo 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.378 s]
[INFO] biz.aQute.resolve 7.2.0.202509162244-SNAPSHOT ...... SUCCESS [  2.797 s]
[INFO] biz.aQute.remote 7.2.0.202509162244-SNAPSHOT ....... SUCCESS [  2.969 s]
[INFO] biz.aQute.bnd.javagen 7.2.0.202509162244-SNAPSHOT .. SUCCESS [  1.062 s]
[INFO] biz.aQute.bndall.tests 7.2.0.202509162244-SNAPSHOT . SUCCESS [  1.577 s]
[INFO] org.bndtools.versioncontrol.ignores.manager 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.983 s]
[INFO] org.bndtools.headless.build.manager 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.931 s]
[INFO] bndtools.utils 7.2.0.202509162244-SNAPSHOT ......... SUCCESS [  1.858 s]
[INFO] biz.aQute.bnd.ant 7.2.0.202509162244-SNAPSHOT ...... SUCCESS [  1.513 s]
[INFO] biz.aQute.bnd.exporters 7.2.0.202509162244-SNAPSHOT  SUCCESS [  1.279 s]
[INFO] biz.aQute.bnd.reporter 7.2.0.202509162244-SNAPSHOT . SUCCESS [  2.865 s]
[INFO] biz.aQute.bnd 7.2.0.202509162244-SNAPSHOT .......... SUCCESS [  5.435 s]
[INFO] org.bndtools.headless.build.plugin.ant 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.399 s]
[INFO] org.bndtools.templating 7.2.0.202509162244-SNAPSHOT  SUCCESS [  2.183 s]
[INFO] bndtools.core 7.2.0.202509162244-SNAPSHOT .......... SUCCESS [  8.980 s]
[INFO] bndtools.builder 7.2.0.202509162244-SNAPSHOT ....... SUCCESS [  2.813 s]
[INFO] biz.aQute.bnd.transform 7.2.0.202509162244-SNAPSHOT  SUCCESS [  0.249 s]
[INFO] biz.aQute.bnd.testextension 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.855 s]
[INFO] biz.aQute.bndlib.tests 7.2.0.202509162244-SNAPSHOT . SUCCESS [  3.212 s]
[INFO] biz.aQute.bndlib.comm.tests 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.694 s]
[INFO] biz.aQute.launchpad.tests 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.037 s]
[INFO] biz.aQute.tester.test 7.2.0.202509162244-SNAPSHOT .. SUCCESS [  1.713 s]
[INFO] bndtools.core.services 7.2.0.202509162244-SNAPSHOT . SUCCESS [  2.057 s]
[INFO] bndtools.jareditor 7.2.0.202509162244-SNAPSHOT ..... SUCCESS [  2.133 s]
[INFO] biz.aQute.bnd.maven 7.2.0.202509162244-SNAPSHOT .... SUCCESS [  1.811 s]
[INFO] bndtools.m2e 7.2.0.202509162244-SNAPSHOT ........... SUCCESS [  2.182 s]
[INFO] bndtools.pde 7.2.0.202509162244-SNAPSHOT ........... SUCCESS [  1.594 s]
[INFO] bndtools.release 7.2.0.202509162244-SNAPSHOT ....... SUCCESS [  2.444 s]
[INFO] org.bndtools.headless.build.plugin.gradle 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.162 s]
[INFO] org.bndtools.launch 7.2.0.202509162244-SNAPSHOT .... SUCCESS [  2.683 s]
[INFO] org.bndtools.remoteinstall 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.511 s]
[INFO] org.bndtools.versioncontrol.ignores.plugin.git 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.940 s]
[INFO] org.bndtools.templating.gitrepo 7.2.0.202509162244-SNAPSHOT SUCCESS [  1.766 s]
[INFO] org.bndtools.templates.osgi 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.087 s]
[INFO] org.bndtools.templates.template 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.107 s]
[INFO] org.bndtools.p2 7.2.0.202509162244-SNAPSHOT ........ FAILURE [  0.045 s]
[INFO] dist 7.2.0.202509162244-SNAPSHOT ................... SKIPPED
[INFO] biz.aQute.resolve.test 7.2.0.202509162244-SNAPSHOT . SUCCESS [  0.357 s]
[INFO] bndtools.core.test 7.2.0.202509162244-SNAPSHOT ..... SUCCESS [  2.516 s]
[INFO] Bnd Maven Plugins Parent 7.2.0-SNAPSHOT ............ SUCCESS [  0.500 s]
[INFO] Bnd Maven Plugin 7.2.0-SNAPSHOT .................... SUCCESS [ 34.130 s]
[INFO] Bnd Indexer Maven Plugin 7.2.0-SNAPSHOT ............ SUCCESS [ 28.055 s]
[INFO] Bnd Baseline Maven Plugin 7.2.0-SNAPSHOT ........... SUCCESS [ 18.061 s]
[INFO] Bnd Resolver Maven Plugins 7.2.0-SNAPSHOT .......... SUCCESS [ 38.502 s]
[INFO] Bnd Export Maven Plugin 7.2.0-SNAPSHOT ............. SUCCESS [  6.469 s]
[INFO] Bnd Testing Maven Plugin 7.2.0-SNAPSHOT ............ SUCCESS [ 19.435 s]
[INFO] Bnd Run Maven Plugin 7.2.0-SNAPSHOT ................ SUCCESS [  5.330 s]
[INFO] Bnd Reporter Maven Plugin 7.2.0-SNAPSHOT ........... SUCCESS [ 13.093 s]
[INFO] Bnd Generate Maven Plugin 7.2.0-SNAPSHOT ........... SUCCESS [ 17.606 s]
[INFO] Bnd Maven Plugins Reactor 1.0.0 .................... SUCCESS [  0.000 s]
[INFO] bndtools.m2e.debug.fragment 7.2.0.202509162244-SNAPSHOT SUCCESS [  0.129 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:01 min
[INFO] Finished at: 2025-09-17T00:49:39+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-bnd-plugin:4.0.13:build (build) on project org.bndtools.p2: Input file does not exist: /Users/christophrueger/Documents/development/git/bnd/org.bndtools.p2/generated/p2 -> [Help 1]

@chrisrueger
Copy link
Contributor Author

chrisrueger commented Sep 16, 2025

@reckart Could you have a look if that makes life easier for you?

@reckart
Copy link
Contributor

reckart commented Sep 17, 2025

Eclipse detects the projects when I do "import existing maven projects"

However, after the import, I have 62379 errors.

The projects contain Eclipse metadata files (.classpath, .project, .settings folder) which are typically not checked in because they tend to get dirty on import (and they do).

When I expand a module to have a look at the dependency tree in the POM, I don't see a pom.xml at the module root.

The Maven Dependencies container that should contain the project's resolved dependencies is missing from most modules.

When I mark the modules and try to right-click and Maven -> Update project..., I get more errors.

@reckart
Copy link
Contributor

reckart commented Sep 17, 2025

I think this approach is ok for adapting the build to CI systems where (for some reason) one would CI using Maven instead of Gradle, but for a local dev setup, it seems not well suited.

@chrisrueger
Copy link
Contributor Author

I think this approach is ok for adapting the build to CI systems where (for some reason) one would CI using Maven instead of Gradle, but for a local dev setup, it seems not well suited.

You are probably right. We are using this approach indeed in our own build. I am experimenting a bit more with this PR here to see if I can get it to build, but maybe I won't merge it yet.

But do I understand you correctly, that you have trouble setting up Eclipse for bndtools development / contribution?

I think you need to use "Import Existing Projects into Workspace": https://github.com/bndtools/bnd/blob/master/CONTRIBUTING.md#importing-into-eclipse

Otherwise: Have you tried the Oomph setups? https://bndtools.org/bndtools.p2.repo/
They setup a fresh Eclipse instance for you with everything installed.

Maybe this one should help contributing to bndtools/master:
image

This adds support building bnd with Eclipse Tycho 4.0.13
See https://tycho.eclipseprojects.io/doc/4.0.13/BndBuild.html

e.g. build inside the repo root with:
`mvn clean verify`

Signed-off-by: Christoph Rueger <[email protected]>
mvn clean verify -fae

-fae needed.to skip a current error in org.bndtools.p2 which will go away soon after PR 6808

Signed-off-by: Christoph Rueger <[email protected]>
we needed to rename /pom.xml to old_pom.xml because otherwise it will conflict / confuse tycho

Signed-off-by: Christoph Rueger <[email protected]>
to fix `JAXP00010003: The length of entity "[xml]" is "100,001" that exceeds the "100,000" limit set by "jdk.xml.maxGeneralEntitySizeLimit"`

Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
this ensures that tycho is only used when building in root with `mvn clean verify` but not when building with `mvn -f maven-plugins/pom.xml`
adjust CI build scripts to call `mvn -f maven-plugins/pom.xml`

Signed-off-by: Christoph Rueger <[email protected]>
@chrisrueger
Copy link
Contributor Author

The build almost passes locally, but fails with the bundle org.bndtools.p2 because it is using bnd 7.1.0 but org.bndtools.p2 requires changes of current 7.2.0-SNAPSHOT.

So expect that this passes once 7.2.0 is released and I will try again then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants