eclipse-tycho / tycho

Tycho project repository (tycho)
https://tycho.eclipseprojects.io
Eclipse Public License 2.0
170 stars 191 forks source link

Error in Tycho after an Oomph setup #3082

Open vogella opened 12 months ago

vogella commented 12 months ago

Using the Oomph setup for Tycho (thanks @merks for this), results in the following error in tycho-p2-repository-plugin, this error can be seen in the Problems View.


Description Resource    Path    Location    Type
Failed to execute mojo org.apache.maven.plugins:maven-plugin-plugin:3.10.2:descriptor {execution: default-descriptor} (org.apache.maven.plugins:maven-plugin-plugin:3.10.2:descriptor:default-descriptor:process-classes)

org.eclipse.core.runtime.CoreException: Failed to execute mojo org.apache.maven.plugins:maven-plugin-plugin:3.10.2:descriptor {execution: default-descriptor}
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:340)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.lambda$0(MavenExecutionContext.java:291)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:290)
    at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:57)
    at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.lambda$2(MavenBuilderImpl.java:153)
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
    at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:133)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:164)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:109)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:228)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:100)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:83)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:192)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1079)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
    at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:594)
    at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:490)
    at org.eclipse.oomph.setup.projects.impl.ProjectsBuildTaskImpl.perform(ProjectsBuildTaskImpl.java:535)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.doPerformNeededSetupTasks(SetupTaskPerformer.java:3864)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil$1.run(SetupTaskPerformer.java:5200)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2453)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2478)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil.performNeededSetupTasks(SetupTaskPerformer.java:5193)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performNeededSetupTasks(SetupTaskPerformer.java:3798)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performTriggeredSetupTasks(SetupTaskPerformer.java:3773)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.perform(SetupTaskPerformer.java:3651)
    at org.eclipse.oomph.setup.ui.wizards.ProgressPage$9.run(ProgressPage.java:592)
    at org.eclipse.oomph.setup.ui.wizards.ProgressPage$11$1.run(ProgressPage.java:721)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.10.2:descriptor failed: Cannot invoke "String.indexOf(int)" because "s" is null
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:338)
    ... 43 more
Caused by: java.lang.NullPointerException: Cannot invoke "String.indexOf(int)" because "s" is null
    at java.base/java.util.regex.Matcher.quoteReplacement(Matcher.java:851)
    at org.apache.maven.tools.plugin.extractor.annotations.converter.JavadocInlineTagsToXhtmlConverter.convert(JavadocInlineTagsToXhtmlConverter.java:80)
    at org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor.getDescriptionFromElement(JavaAnnotationsMojoDescriptorExtractor.java:408)
    at org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor.populateDataFromJavadoc(JavaAnnotationsMojoDescriptorExtractor.java:353)
    at org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor.execute(JavaAnnotationsMojoDescriptorExtractor.java:220)
    at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:97)
    at org.apache.maven.plugin.plugin.DescriptorGeneratorMojo.generate(DescriptorGeneratorMojo.java:355)
    at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:93)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
    ... 44 more
    pom.xml /tycho-p2-repository-plugin line 16 Maven Build Problem
merks commented 12 months ago

Note that Oomph is just kicking off a build here:

    at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:490)

From that point on, it's just a regular build, nothing Oomph related. I fully expect you will see the same problem when you do a clean build from the project menu.

vogella commented 12 months ago

Note that Oomph is just kicking off a build here:

  at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:490)

From that point on, it's just a regular build, nothing Oomph related. I fully expect you will see the same problem when you do a clean build from the project menu.

Not true, if I try to do it manually I get ZILLIONS of errors, so Oomph is really helpful here and I agree that this is an regular error, the Oomph reference was just the "how to reproduce".

laeubi commented 11 months ago

There seems to be a NPE in org.apache.maven.tools.plugin so probably you want report it to maven-plugin-plugin? We can upgrade to a newer version then once published.

Beside that, it is often easier to do mvn clean install -DskipTests -T1C and only import the project of interest instead of the full "Tycho SDK" ...

Bananeweizen commented 11 months ago

I see the error annotation in my pom.xml, too. But be aware that executing the same goal via CLI does work without any issues:

cd tycho-p2-repository-plugin
mvn org.apache.maven.plugins:maven-plugin-plugin:3.10.2:descriptor@default-descriptor

Therefore this is not generally broken, but depends on some additional context.