Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » m2eclipse "Could not get the value for parameter" ClassNotFoundException
m2eclipse "Could not get the value for parameter" ClassNotFoundException [message #1808703] Fri, 28 June 2019 21:10 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
UPDATE: actually I found that in 4.9 I have the same problem, but I had marked the plugin as ignored in my workspace's lifecycle mappings, hence the issue was masked. I am replicating this workaround for 4.12.

Hi all,

I upgraded from Eclipse 4.9 to Eclipse 4.11 (and then also tried 4.12) but my maven projects complain about parameter values when I import them into Eclipse. Both 4.11 and 4.12 give me the error:

Quote:
"Could not get the value for parameter X for plugin Y.


This happens for a coupld of plugin executions (see below for concrete example and stack trace as well as full POM).

Eclipse 4.9 has no problem working with the same project and it also works fine from command line with various maven 3.x versions. I updated to Maven 3.6.1 to check if there's some new syntax change but even this latest version works fine with my POM.

I'm just looking to see if there's anybody else experiencing this before I file a bug report.

Exception and sample POM below:

Could not get the value for parameter artifactItems for plugin execution copy-libraries (org.apache.maven.plugins:maven-dependency-plugin:2.8:copy:copy-libraries:validate)

org.eclipse.core.runtime.CoreException: Could not get the value for parameter artifactItems for plugin execution copy-libraries
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.getMojoParameterValue(MavenImpl.java:936)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$5(MavenImpl.java:944)
	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.getMojoParameterValue(MavenImpl.java:943)
	at com.ianbrandt.tools.m2e.mdp.core.MdpBuildParticipant.getOutputDirectories(MdpBuildParticipant.java:88)
	at com.ianbrandt.tools.m2e.mdp.core.MdpBuildParticipant.build(MdpBuildParticipant.java:69)
	at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:173)
	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:116)
	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:106)
	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:87)
	at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:201)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot determine child type
	at org.codehaus.plexus.component.configurator.converters.composite.AbstractCollectionConverter.getChildType(AbstractCollectionConverter.java:110)
	at org.codehaus.plexus.component.configurator.converters.composite.AbstractCollectionConverter.fromChildren(AbstractCollectionConverter.java:52)
	at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:68)
	at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:47)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.getMojoParameterValue(MavenImpl.java:932)
	... 30 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.dependency.fromConfiguration.Item
	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)
	at org.codehaus.plexus.component.configurator.converters.composite.AbstractCollectionConverter.getChildType(AbstractCollectionConverter.java:87)
	... 34 more


By the way, this seems trivial to reproduce. I use the wizard to create a new maven project with "simple artifact" checkbos then add the dependency plugin to copy some random artiface. This single-pom project produces the error for me:

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.eclipse.m2e</groupId>
	<artifactId>param-bug</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-libraries</id>
						<phase>validate</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<item>
									<groupId>org.jmockit</groupId>
									<artifactId>jmockit</artifactId>
									<version>1.46</version>
								</item>
							</artifactItems>
							<outputDirectory>META-INF/lib</outputDirectory>
							<stripVersion>true</stripVersion>
							<overWriteReleases>true</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

[Updated on: Sat, 29 June 2019 06:48]

Report message to a moderator

Re: m2eclipse "Could not get the value for parameter" ClassNotFoundException [message #1808988 is a reply to message #1808703] Fri, 05 July 2019 13:36 Go to previous messageGo to next message
Eclipse UserFriend
You're using an `<item>` whereas it should be `<artifactItem>`.

https://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html
Re: m2eclipse "Could not get the value for parameter" ClassNotFoundException [message #1809008 is a reply to message #1808988] Fri, 05 July 2019 17:51 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Thank you Brian! I've switched to artifactItem as you correctly pointed out and that has made m2e happy!

It does make me wonder why was this working when running maven from command line...
Re: m2eclipse "Could not get the value for parameter" ClassNotFoundException [message #1809010 is a reply to message #1809008] Fri, 05 July 2019 17:57 Go to previous message
Eclipse UserFriend
Maven is quite liberal in processing lists when injecting -- the actual tag name used (`<item>` vs `<artifactItem>`) doesn't matter when it's injecting a mojo. The m2elipse configurator for maven-dependency-plugin that you're using (com.ianbrandt.tools.m2e.mdp), on the other hand, is trying to access the maven-dependency-plugin mojo parameters dynamically which seems much more picky.
Previous Topic:Start E4 RCP app always in default perspective
Next Topic:Eclipse3.5 update to Eclipse4.12, PerspectiveBarManager is invalid
Goto Forum:
  


Current Time: Wed Apr 24 15:23:07 GMT 2024

Powered by FUDForum. Page generated in 0.05019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top