Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353781 - m2eclipse fails when maven-compiler-plugin targets "5", "6", or "7"
Summary: m2eclipse fails when maven-compiler-plugin targets "5", "6", or "7"
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 350353 357364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-03 11:06 EDT by Tim O'Brien CLA
Modified: 2021-04-19 13:26 EDT (History)
3 users (show)

See Also:


Attachments
Patch for ./src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java (2.18 KB, patch)
2011-08-03 11:07 EDT, Tim O'Brien CLA
no flags Details | Diff
Patch for m2e-core, small change to AbstractJavaProjectConfigurator (2.59 KB, patch)
2011-08-03 15:10 EDT, Tim O'Brien CLA
igor: iplog+
Details | Diff
Patch for m2e-core-tests (3.77 KB, patch)
2011-08-03 15:11 EDT, Tim O'Brien CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim O'Brien CLA 2011-08-03 11:06:53 EDT
The Java compiler's documentation states that -source and -target accept the following values:

"5" as a synonym for "1.5", "6" as a synonym for "1.6", and (assumption) "7" as a synonym for "1.7".

In the current release of m2eclipse, if your pom.xml contains the configuration:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <source>6</source>
    <target>6</target>
  </configuration>
</plugin>

m2eclipse will ignore this setting and use a different source and target level.   This will lead to inconsistent results from the same build run via the command-line vs. m2eclipse.   

I've attached a patch for ./src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java which adds the synonyms to SOURCES and TARGETS and which adds some logic to catch the synonyms for source and taget.
Comment 1 Tim O'Brien CLA 2011-08-03 11:07:25 EDT
Created attachment 200821 [details]
Patch for ./src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
Comment 2 Igor Fedorenko CLA 2011-08-03 11:24:04 EDT
*** Bug 350353 has been marked as a duplicate of this bug. ***
Comment 3 Tim O'Brien CLA 2011-08-03 15:10:42 EDT
Created attachment 200847 [details]
Patch for m2e-core, small change to AbstractJavaProjectConfigurator
Comment 4 Tim O'Brien CLA 2011-08-03 15:11:16 EDT
Created attachment 200848 [details]
Patch for m2e-core-tests
Comment 5 Igor Fedorenko CLA 2011-08-03 21:57:49 EDT
Applied the patches. Thank you.
Comment 6 Igor Fedorenko CLA 2011-09-12 07:26:38 EDT
*** Bug 357364 has been marked as a duplicate of this bug. ***
Comment 7 Denis Roy CLA 2021-04-19 13:26:35 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/