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

fails in eclipse #59

Closed
Andrei-Pozolotin opened this issue Oct 30, 2017 · 6 comments
Closed

fails in eclipse #59

Andrei-Pozolotin opened this issue Oct 30, 2017 · 6 comments

Comments

@Andrei-Pozolotin
Copy link

https://wiki.eclipse.org/M2E_compatible_maven_plugins

  1. any attempt to enable flatten in eclipse:
<pluginExecution>
	<pluginExecutionFilter>
		<groupId>org.codehaus.mojo</groupId>
        	<artifactId>flatten-maven-plugin</artifactId>
		<versionRange>[0,)</versionRange>
		<goals>
			<goal>flatten</goal>
		</goals>
	</pluginExecutionFilter>
	<action>
		<execute>
			<runOnIncremental>false</runOnIncremental>
                        <runOnConfiguration>true></runOnConfiguration>
		</execute>
	</action>
</pluginExecution>
  1. results in plugin error java.lang.NullPointerException:
Description	Resource	Path	Location	Type
Execution flatten of goal org.codehaus.mojo:flatten-maven-plugin:1.0.1:flatten failed. (org.codehaus.mojo:flatten-maven-plugin:1.0.1:flatten:flatten:package)

org.apache.maven.plugin.PluginExecutionException: Execution flatten of goal org.codehaus.mojo:flatten-maven-plugin:1.0.1:flatten failed.
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
	at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
	at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.NullPointerException
	at org.codehaus.mojo.flatten.model.resolution.ReactorModelPool.addProjects(ReactorModelPool.java:46)
	at org.codehaus.mojo.flatten.model.resolution.FlattenModelResolver.<init>(FlattenModelResolver.java:70)
	at org.codehaus.mojo.flatten.FlattenMojo.createModelBuildingRequest(FlattenMojo.java:684)
	at org.codehaus.mojo.flatten.FlattenMojo.createFlattenedPom(FlattenMojo.java:447)
	at org.codehaus.mojo.flatten.FlattenMojo.execute(FlattenMojo.java:313)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 31 more

@famod
Copy link
Contributor

famod commented Nov 18, 2017

Same here, Eclipse Neon.3 with m2e 1.7.1.

@hohwille
Copy link
Member

I am using flatten plugin in all my projects since years with Eclipse and m2e without issues.
Sorry that you are facing problems.

@hohwille
Copy link
Member

So your list of maven projects is null? This seems to me like a core bug in Eclipse/m2e rather than flatten. WDYT?
@Andrei-Pozolotin you have already found the bug and resolved it? Not interested in contributing and joining forces?

@famod
Copy link
Contributor

famod commented Apr 30, 2019

Still a problem with plugin version 1.1.0, Eclipse 2019-03 (4.11.0) and m2e 1.11.0.

@famod
Copy link
Contributor

famod commented May 2, 2019

It turns out that (although a null allProjects list is indeed strange) a simple null check is enough to make flattening work in eclipse. I will create a PR for this soon.

PS: m2e doesn't seem to need a "ci friendly" flattening because it is able to resolve ${revision} on its own. It probably needs the relativePath info, but I haven't tried without that.

famod added a commit to famod/flatten-maven-plugin that referenced this issue May 2, 2019
famod added a commit to famod/flatten-maven-plugin that referenced this issue May 7, 2019
@creamteam-de
Copy link

With plugin version 1.1.0, 2019-06 (4.12.0) and m2e 1.12.0.20190529-1916 error occurs too, is there any plan to have a new release with PR? Thanks!

famod added a commit to famod/flatten-maven-plugin that referenced this issue Sep 17, 2019
famod added a commit to famod/flatten-maven-plugin that referenced this issue Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants