jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Integration for Eclipse
  • MNGECLIPSE-1057

Streamlining separate output folders

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 0.9.7
  • Fix Version/s: None
  • Component/s: Maven Embedder, Maven Launcher
  • Labels:
    None

Description

Separate output folders are necessary in our environment because developers may sometimes do a manual build. Mixing classes built by Maven and Eclipse is considered bad because both Maven and Eclipse can use their own javac settings (e.g. by compiling for Java 1.6 when Maven compiles 1.5 bytecode).

Currently, the only way to use separate output folders is by altering the build directory, general output directory and test output directory. The workaround Eugene suggested in his blog-post titled Configuring separate Maven output folders requires a profile to be added to the POM (be it a regular, or even better, a parent POM).

While this approach using profiles works well for most use-cases, users always need to add the profile to a POM and make sure the profile gets activated. If it was specified in a parent POM, all child projects need to be configured as well.

It would be great if the plugin could "automatically" enhance the POM to alter the default Maven conventions.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Java Archive File
    m2e-super-pom.jar
    12/Nov/08 9:40 AM
    3 kB
    Bert Jacobs
    1. File
      META-INF/MANIFEST.MF 0.1 kB
    2. XML File
      org/apache/maven/project/pom-4.0.0.xml 7 kB
    Download Zip
    Show
    Java Archive File
    m2e-super-pom.jar
    12/Nov/08 9:40 AM
    3 kB
    Bert Jacobs

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-676 JVM always uses target/classes instead of configured output folder

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Bert Jacobs added a comment - 12/Nov/08 8:04 AM

Issue 676 talks about the problem as if it were a bug.

Show
Bert Jacobs added a comment - 12/Nov/08 8:04 AM Issue 676 talks about the problem as if it were a bug.
Hide
Permalink
Bert Jacobs added a comment - 12/Nov/08 9:40 AM

A custom "super pom", see following comment.

Show
Bert Jacobs added a comment - 12/Nov/08 9:40 AM A custom "super pom", see following comment.
Hide
Permalink
Bert Jacobs added a comment - 12/Nov/08 9:41 AM

In the mean time, I thought of and tested a few solutions myself:

  • Create a custom implementation of org.apache.maven.project.MavenProjectBuilder to alter the MavenProject object's Build settings in-memory by including it at the start of the classpath.
    • It works, but it is not version-agnostic towards Maven.
    • Configuration can happen by scanning the POM for settings of the Eclipse plugin (which would require a discussion with the Eclipse plugin's team - currently the buildOutputDirectory setting is pretty retarded).
  • Create and package an M2Eclipse "Super POM" which alters the settings. To make sure the settings actually override intermediate settings, it should also include a profile which resets the directory setting.
    • It works as well, but due to POM inheritance and override mechanisms, the settings may not end up being enforced. If the user wants separate output folders, he should make sure he sets his output and test-output folder using ${project.build.directory}.
    • This solution is better than the previous one, although we are messing with the super pom, and hence with all the settings added to it over different versions. This may cause trouble for default plugin versions and the like, but it works for my Maven 2.0.5 and 2.1 M1 installs.
    • Configuration happens by setting properties like maven.ide.eclipse.build (to toggle the profile) or maven.ide.eclipse.dir (to set the result directory containing the classes and test-classes folders). It is pretty flexible.

I've added my experimental "super POM jar" as an attachment. Add it at the start of the classpath to see it in effect, and play with the mentioned properties.

Show
Bert Jacobs added a comment - 12/Nov/08 9:41 AM In the mean time, I thought of and tested a few solutions myself:
  • Create a custom implementation of org.apache.maven.project.MavenProjectBuilder to alter the MavenProject object's Build settings in-memory by including it at the start of the classpath.
    • It works, but it is not version-agnostic towards Maven.
    • Configuration can happen by scanning the POM for settings of the Eclipse plugin (which would require a discussion with the Eclipse plugin's team - currently the buildOutputDirectory setting is pretty retarded).
  • Create and package an M2Eclipse "Super POM" which alters the settings. To make sure the settings actually override intermediate settings, it should also include a profile which resets the directory setting.
    • It works as well, but due to POM inheritance and override mechanisms, the settings may not end up being enforced. If the user wants separate output folders, he should make sure he sets his output and test-output folder using ${project.build.directory}.
    • This solution is better than the previous one, although we are messing with the super pom, and hence with all the settings added to it over different versions. This may cause trouble for default plugin versions and the like, but it works for my Maven 2.0.5 and 2.1 M1 installs.
    • Configuration happens by setting properties like maven.ide.eclipse.build (to toggle the profile) or maven.ide.eclipse.dir (to set the result directory containing the classes and test-classes folders). It is pretty flexible.
I've added my experimental "super POM jar" as an attachment. Add it at the start of the classpath to see it in effect, and play with the mentioned properties.

People

  • Assignee:
    Unassigned
    Reporter:
    Bert Jacobs
Vote (0)
Watch (1)

Dates

  • Created:
    12/Nov/08 8:01 AM
    Updated:
    12/Nov/08 9:41 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.