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

Adjust Tycho build to latest Tycho version. #5

Closed
CDerksen opened this issue Sep 10, 2021 · 6 comments
Closed

Adjust Tycho build to latest Tycho version. #5

CDerksen opened this issue Sep 10, 2021 · 6 comments

Comments

@CDerksen
Copy link
Contributor

=> see https://wiki.eclipse.org/Tycho/Release_Notes

@CDerksen
Copy link
Contributor Author

@tobirobi
When I start the updated build process, I get the error stack below. Any idea what happens?

`[INFO] --------------------< org.agentgui:de.enflexit.api >--------------------
[INFO] Building [bundle] Api 1.0.0-SNAPSHOT [4/26]
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ de.enflexit.api ---
[INFO] Deleting D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\de.enflexit.api\target
[INFO]
[INFO] --- tycho-packaging-plugin:2.4.0:build-qualifier (default-build-qualifier) @ de.enflexit.api ---
[WARNING] The POM for org.eclipse.tycho:tycho-packaging-plugin:jar:2.4.0 is missing, no dependency information available
[WARNING] Working tree is dirty.
git status eclipseProjects/org.agentgui/bundles/de.enflexit.api:

Untracked files:
eclipseProjects/org.agentgui/bundles/de.enflexit.api/.polyglot.META-INF

[WARNING] Fallback to default timestamp provider
[INFO] The project's OSGi version is 1.0.0.202109201056
[INFO]
[INFO] --- tycho-packaging-plugin:2.4.0:validate-id (default-validate-id) @ de.enflexit.api ---
[INFO]
[INFO] --- tycho-packaging-plugin:2.4.0:validate-version (default-validate-version) @ de.enflexit.api ---
[INFO]
[INFO] --- target-platform-configuration:2.4.0:target-platform (default-target-platform) @ de.enflexit.api ---
[WARNING] The POM for org.eclipse.tycho:target-platform-configuration:jar:2.4.0 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ de.enflexit.api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\de.enflexit.api\src\main\resources
[INFO]
[INFO] --- tycho-compiler-plugin:2.4.0:compile (default-compile) @ de.enflexit.api ---
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.pom (861 B at 6.3 kB/s)
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-compiler/2.8.8/plexus-compiler-2.8.8.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.8.8/plexus-compiler-2.8.8.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.8.8/plexus-compiler-2.8.8.pom (7.2 kB at 52 kB/s)
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-components/6.4/plexus-components-6.4.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/6.4/plexus-components-6.4.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/6.4/plexus-components-6.4.pom (2.6 kB at 15 kB/s)
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus/6.4/plexus-6.4.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/6.4/plexus-6.4.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/6.4/plexus-6.4.pom (26 kB at 184 kB/s)
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.pom
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.pom (865 B at 6.8 kB/s)
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.jar
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.8/plexus-compiler-manager-2.8.8.jar (4.6 kB at 21 kB/s)
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.8/plexus-compiler-api-2.8.8.jar (27 kB at 99 kB/s)
[INFO] Compiling 5 source files to D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\de.enflexit.api\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ de.enflexit.api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\de.enflexit.api\src\test\resources
[INFO]
[INFO] --- tycho-compiler-plugin:2.4.0:testCompile (default-testCompile) @ de.enflexit.api ---
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ de.enflexit.api ---
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
[INFO] Downloading from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[INFO] Downloaded from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar (51 kB at 85 kB/s)
[INFO] Downloaded from : http://maven.repository.redhat.com/techpreview/all/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar (228 kB at 263 kB/s)
[INFO] No tests to run.
[INFO]
[INFO] --- tycho-source-plugin:2.4.0:plugin-source (plugin-source) @ de.enflexit.api ---
[INFO] Building jar: D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\de.enflexit.api\target\de.enflexit.api-1.0.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- tycho-packaging-plugin:2.4.0:package-plugin (default-package-plugin) @ de.enflexit.api ---
[WARNING] Error injecting: org.eclipse.tycho.packaging.PackagePluginMojo
java.lang.NoClassDefFoundError: org/codehaus/plexus/archiver/FileSet
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:115)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:706)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:930)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:852)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:291)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:222)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1040)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1071)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1034)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:85)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:66)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:112)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:127)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:520)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:124)
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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.FileSet
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 52 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Agent.Workbench 1.0.0-SNAPSHOT ..................... SUCCESS [ 4.861 s]
[INFO] org.agentgui.root 1.0.0-SNAPSHOT ................... SUCCESS [ 0.024 s]
[INFO] org.agentgui.bundles 1.0.0-SNAPSHOT ................ SUCCESS [ 0.020 s]
[INFO] [bundle] Api 1.0.0-SNAPSHOT ........................ FAILURE [ 8.412 s]
[INFO] [bundle] JAXB 2.3.2-SNAPSHOT ....................... SKIPPED
[INFO] [bundle] Jade 4.5.1-SNAPSHOT ....................... SKIPPED
[INFO] [bundle] Common 1.2.5-SNAPSHOT ..................... SKIPPED
[INFO] [bundle] OIDC 5.17.2 ............................... SKIPPED
[INFO] [bundle] OIDC 1.0.0-SNAPSHOT ....................... SKIPPED
[INFO] [bundle] Hibernate 5.3.6-SNAPSHOT .................. SKIPPED
[INFO] [bundle] MySQL - JDBC Connector 5.1.46-SNAPSHOT .... SKIPPED
[INFO] [bundle] Geography-Bundle 1.0.0-SNAPSHOT ........... SKIPPED
[INFO] [bundle] OSHI 5.7.6 ................................ SKIPPED
[INFO] [bundle] Scimark 2.0.1 ............................. SKIPPED
[INFO] [bundle] JFreeChart 1.5.3 .......................... SKIPPED
[INFO] [bundle] Agent.Workbench - Core Bundle 2.1.19-SNAPSHOT SKIPPED
[INFO] [bundle] Jung 2.0.2 ................................ SKIPPED
[INFO] [bundle] Agent.Workbench - Graph and Network Environment 2.1.18-SNAPSHOT SKIPPED
[INFO] org.agentgui.help 2.1.19-SNAPSHOT .................. SKIPPED
[INFO] org.agentgui.features 1.0.0-SNAPSHOT ............... SKIPPED
[INFO] [feature] EnFlex.IT common interfaces and classes 2.1.7-SNAPSHOT SKIPPED
[INFO] [feature] Agent.Workbench - Core Feature 2.1.19-SNAPSHOT SKIPPED
[INFO] org.agentgui.releng 1.0.0-SNAPSHOT ................. SKIPPED
[INFO] org.agentgui.update 2.1.19-SNAPSHOT ................ SKIPPED
[INFO] org.agentgui.product 2.1.19-SNAPSHOT ............... SKIPPED
[INFO] org.agentgui.target 4.18.0-SNAPSHOT ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.724 s
[INFO] Finished at: 2021-09-20T12:57:47+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:2.4.0:package-plugin (default-package-plugin) on project de.enflexit.api: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:2.4.0:package-plugin failed: A required class was missing while executing org.eclipse.tycho:tycho-packaging-plugin:2.4.0:package-plugin: org/codehaus/plexus/archiver/FileSet
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.eclipse.tycho:tycho-packaging-plugin:2.4.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/Christian/.m2/repository/org/eclipse/tycho/tycho-packaging-plugin/2.4.0/tycho-packaging-plugin-2.4.0.jar
[ERROR] urls[1] = file:/C:/Users/Christian/.m2/repository/org/eclipse/tycho/extras/tycho-buildtimestamp-jgit/2.4.0/tycho-buildtimestamp-jgit-2.4.0.jar
[ERROR] urls[2] = file:/C:/Users/Christian/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/5.12.0.202106070339-r/org.eclipse.jgit-5.12.0.202106070339-r.jar
[ERROR] urls[3] = file:/C:/Users/Christian/.m2/repository/com/googlecode/javaewah/JavaEWAH/1.1.7/JavaEWAH-1.1.7.jar
[ERROR] urls[4] = file:/C:/Users/Christian/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>org.agentgui:org.agentgui.root:1.0.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.archiver.FileSet
[ERROR] -> [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/PluginContainerException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :de.enflexit.api
`

@TBrandhorst
Copy link
Contributor

Maybe because I didn't push api_docs.html?

@CDerksen
Copy link
Contributor Author

CDerksen commented Sep 21, 2021

I could solve the above build problem by completely deleting the local maven repository (in USER_DIR/.m2/repository/). It seems that some maven downloaded jar-files were corrupted and thus the build process failed.

Instead I have a new problem during the build process with the creation of the JavaDoc, the following error occurs:

Failed to execute goal org.eclipse.tycho.extras:tycho-document-bundle-plugin:2.4.0:javadoc (eclipse-javadoc) on project org.agentgui.help: Failed to run javadoc: Failed to generate toc file: D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\org.agentgui.help\help\api-docs\javadoc\element-list (File could not be found)

... which indictates that the element-list dir of file could not be found

Any idea?

@TBrandhorst
Copy link
Contributor

TBrandhorst commented Sep 27, 2021

If you used OpenJDK 11 maybe, because of this bug? These developers had a similiar problem, but with gradle.

@TBrandhorst
Copy link
Contributor

I could solve the above build problem by completely deleting the local maven repository (in USER_DIR/.m2/repository/). It seems that some maven downloaded jar-files were corrupted and thus the build process failed.

Instead I have a new problem during the build process with the creation of the JavaDoc, the following error occurs:

Failed to execute goal org.eclipse.tycho.extras:tycho-document-bundle-plugin:2.4.0:javadoc (eclipse-javadoc) on project org.agentgui.help: Failed to run javadoc: Failed to generate toc file: D:\20_GIT\01_AWB\eclipseProjects\org.agentgui\bundles\org.agentgui.help\help\api-docs\javadoc\element-list (File could not be found)

... which indictates that the element-list dir of file could not be found

Any idea?

The problem occurs because Maven does not use the default JDK of the Eclipse environment for creating JavaDoc. Instead, it uses the JDK defined in the JAVA_HOME variable. To solve this problem, Maven toolchains are required. With Maven Toolchains applied to JDK toolchain, a project can now be built using a specific version of JDK independent from the one Maven is running with.

The disadvantages of this solution is, that a toolchain.xml is with the path of the different jdks is required. The toolchain.xml file should look like this:
grafik

The vendor and version of the JDK must be specified within the configuration of the maven-toolchains-plugin, which lies in the configuration pom of the project.

@CDerksen
Copy link
Contributor Author

CDerksen commented Oct 4, 2021

Ok, the above is one solution, but it would require a customization on each system, which I definitely would not prefer.

The solution that finally worked for me:

Problem:
During the build process, Maven calls the javadoc-executalbe via system call. In my system Java 8 JRE was configured as systems default. Since this is no JDK, a javadoc.exe can not be found.

Solution:

  • Based on this post, I reconfigured my systems Java settings and switched my environment variables to Java 11.
  • This, however, did not work immediately. Starting Eclipse, Eclipse reminds the environment variables and (somehow) uses them during an execution (see screenshot below). Only with a complete restart of Eclipse, the environment variables will be synchronized with the system again and thus, the build process and the JavaDoc generation worked.

grafik

@CDerksen CDerksen closed this as completed Oct 4, 2021
TBrandhorst added a commit that referenced this issue Oct 5, 2021
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

No branches or pull requests

2 participants