apache maven build failure - Failed to execute goal org.apache.felix:maven-bundle-plugin:4.2.0:manifest
Asked Answered
T

3

5

I want to install "iText RUPS" by following article from below location

https://github.com/itext/i7j-rups

After entering: "mvn clean package" in the command prompt I get:

[INFO] --- maven-bundle-plugin:4.2.0:manifest (bundle-manifest) @ itext-rups ---

[ERROR] An internal error occurred java.util.ConcurrentModificationException

at java.util.TreeMap.callMappingFunctionWithCheck (TreeMap.java:742)
at java.util.TreeMap.computeIfAbsent (TreeMap.java:558)
at aQute.bnd.osgi.Jar.putResource (Jar.java:288)
at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:202)
at aQute.bnd.osgi.Jar$1.visitFile (Jar.java:177)
at java.nio.file.Files.walkFileTree (Files.java:2804)
at aQute.bnd.osgi.Jar.buildFromDirectory (Jar.java:176)
at aQute.bnd.osgi.Jar.<init> (Jar.java:119)
at aQute.bnd.osgi.Jar.<init> (Jar.java:172)
at org.apache.felix.bundleplugin.BundlePlugin.getOSGiBuilder (BundlePlugin.java:603)
at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer (ManifestPlugin.java:285)
at org.apache.felix.bundleplugin.ManifestPlugin.execute (ManifestPlugin.java:111)
at org.apache.felix.bundleplugin.BundlePlugin.execute (BundlePlugin.java:364)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 4.546 s

[INFO] Finished at: 2020-11-07T15:07:40+01:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:4.2.0:manifest (bundle-manifest) on project itext-rups: Internal error in maven-bundle-plugin: ConcurrentModificationException -> [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/MojoExecutionException

How can I solve the problem?

Trixy answered 7/11, 2020 at 14:59 Comment(1)
Is there a reason why using such an old version of a plugin? search.maven.org/artifact/org.apache.felix/maven-bundle-plugin. Upgrade to most recent version of the plugin.Electioneer
J
8

Based on: https://github.com/FasterXML/oss-parent/issues/27

You need a newer version of the maven bundle plugin.

Try to add this to the plugins section of your POM file:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
</plugin>
Joli answered 1/1, 2021 at 20:1 Comment(0)
O
3

For me this was caused by using Java 17 by default, while the source repo I tried to build uses Java 11. Setting JAVA_HOME to 11 made Maven work again. E.g. on Linux:

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Overanxious answered 21/10, 2022 at 7:24 Comment(1)
I was able to build the master branch at 2.3.0-SNAPSHOT with JDK 17, but had to downgrade to 11 to build 1.5.Manutius
M
1

Ran into the same issue building RUPS on Windows 10. Using Java SDK 16.0.1, Apache Maven 3.8.1. I used the plugin POM code suggested by Archi for maven-bundle-plugin. But also wound up updating plugin launch4j (also in the POM file) from 1.7.25 to 2.1.1. This successfully created the RUPS jar. (Even a blind squirrel finds a nut once in a while.)

Mchugh answered 19/5, 2021 at 20:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.