Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Maven import not recognizing Java projects

The culprit is <compilerId>hubspot-javac</compilerId>
m2e doesn't know anything about this compiler, so doesn't configure JDT accordingly.

You need to add the following to your (parent) pom.xml:
<build>
...
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionRange>[3.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<parameters>
<compilerId>hubspot-javac</compilerId>
</parameters>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.eclipse.m2e.jdt.javaConfigurator</id>
</configurator>
</action>
</pluginExecution>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

It basically tells m2e to configure JDT for the hubspot-javac compiler. However, keep in mind ECJ is the compiler used in Eclipse, not hubspot, javac, or anything else.

HIH


On Wed, Dec 4, 2019 at 6:42 PM Whitney Sorenson <wsorenson@xxxxxxxxxxx> wrote:
Here are the 2 sections tagged maven-compiler-plugin:





On Wed, Dec 4, 2019 at 12:26 PM Fred Bricon <fbricon@xxxxxxxxx> wrote:
The Java nature is added automatically and the Java configuration done according to the maven-compiler-plugin configuration.
Can you share the content of you maven-compiler-plugin config, from running mvn help:effective-pom?

On Wed, Dec 4, 2019 at 6:19 PM Whitney Sorenson <wsorenson@xxxxxxxxxxx> wrote:
Hello,

I've been using m2e successfully for many years and I am abruptly running into an issue where m2e no longer recognizes imported maven projects as Java projects and thus doesn't add the Java nature.

I tried a new workspace, new version of Eclipse (2019-09) and the problem has persisted.

Perhaps something in our POMs changed, I guess my question is there some way to force the Java nature or is there some critical part of the POM that must be recognized? If I add the Java project nature manually, my build path is not configured correctly.

Thank you.

- Whitney



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-users


--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/m2e-users


--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5

Back to the top