[ 
https://issues.apache.org/jira/browse/MTOOLCHAINS-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Slawomir Jaranowski closed MTOOLCHAINS-47.
------------------------------------------
    Resolution: Won't Fix

> Add m2e lifecycle mapping metadata to avoid warnings on project configuration
> -----------------------------------------------------------------------------
>
>                 Key: MTOOLCHAINS-47
>                 URL: https://issues.apache.org/jira/browse/MTOOLCHAINS-47
>             Project: Maven Toolchains Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.1.0
>            Reporter: Georg Tsakumagos
>            Priority: Trivial
>
> m2e builds in eclipse do not initialize the toolchains like an CLI build. For 
> the most usecases this is no problem at all. But the maven console log out 
> failures from the toolchains plugin. This confuses and devs guess something 
> is wrong.
> h3. Desired change
> Add m2e lifecycle mapping metadata to disable the plugin execution in eclipse 
> m2e context as default.
> See: [M2Eclipse - Making Maven Plugins 
> Compatible|https://eclipse.dev/m2e/documentation/m2e-making-maven-plugins-compat.html]
> h3. Example from plugin execution during build in eclipse
> {code:none|title=maven-console.log|borderStyle=solid}
> Failed to execute mojo 
> org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain {execution: 
> default} 
> (org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain:default:validate)
> org.eclipse.core.runtime.CoreException: Failed to execute mojo 
> org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain {execution: 
> default}
>       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:45)
>       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:45)
>       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.events.AutoBuildJob.doBuild(AutoBuildJob.java:207)
>       at 
> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:300)
>       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
> Caused by: org.apache.maven.plugin.MojoFailureException: Cannot find matching 
> toolchain definitions for the following toolchain types:
> jdk [ version='11' ]
> Please make sure you define the required toolchains in your 
> ~/.m2/toolchains.xml file.
>       at 
> org.apache.maven.plugins.toolchain.ToolchainMojo.execute(ToolchainMojo.java:109)
>       at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
>       at 
> org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:338)
>       ... 32 more {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to