Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350138 - [mojo] reconcile maven-jar-support from m2e/wtp and mavenarchiver.pomproperties
Summary: [mojo] reconcile maven-jar-support from m2e/wtp and mavenarchiver.pomproperties
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-23 08:57 EDT by Igor Fedorenko CLA
Modified: 2021-04-19 13:25 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Fedorenko CLA 2011-06-23 08:57:03 EDT
As discussed on m2e-dev mailing list (http://dev.eclipse.org/mhonarc/lists/m2e-dev/msg00557.html) both m2e-wtp and mavenarchiver.pomproperties provide mapping for maven-jar-plugin jar goal but deal with different aspects of jar packaging (manifest vs pom.properties generation). As a result, these two m2e extensions cannot be installed simultaneously and we had to pull one from m2e marketplace catalog to avoid confusion.

To solve this properly, we need to move maven-jar-plugin integration to a separate standalone extension
Comment 1 Fred Bricon CLA 2011-06-23 09:56:38 EDT
The manifest generation is not limited to the maven-jar-plugin. Current m2e-wtp implementation reads the archive configuration from maven-jar-plugin, maven-ear-plugin, maven-ejb-plugin, maven-war-plugin and so on.

Hence the need to provide different implementations for different packages/plugins. See  :

https://github.com/sonatype/m2eclipse-wtp/tree/0.13.0.20110623-0455/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/manifest

https://github.com/sonatype/m2eclipse-wtp/blob/0.13.0.20110623-0455/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/manifest/EarManifestConfigurator.java
Comment 2 Igor Fedorenko CLA 2011-07-02 01:02:51 EDT
Unfortunately, I have to pull m2e-wtp out of m2e marketplace catalog. maven-jar-plugin mapping means that m2e-wtp will be installed by default for all projects that use maven-jar-plugin and this is a show-stopper.
Comment 3 Fred Bricon CLA 2011-07-04 04:32:10 EDT
Since the archiver configuration needs to be extracted from different plugins AND the generated manifest needs to be put in a different location depending on the package, what I think we should do is :

- rename the org.sonatype.m2e.mavenarchiver.pomproperties plugin into org.sonatype.m2e.mavenarchiver
- move (and rename) m2e-wtp's AbstractManifestCofigurator to org.sonatype.m2e.mavenarchiver AbstractMavenArchiverConfigurator 
- Add the pom properties generation logic to  AbstractMavenArchiverConfigurator
- move (and rename) m2e-wtp's JarManifestConfigurator to org.sonatype.m2e.mavenarchiver JarMavenArchiverconfigurator
- declare the JarMavenArchiverconfigurator as primary configurator for the maven-jar-plugin

In m2e-wtp : 
- add a hard dependency to org.sonatype.m2e.mavenarchiver
- refactor existing configurators for WAR, EJB, EAR and RAR packages according to previous changes
- declare the org.sonatype.m2e.mavenarchiver update site into m2e-wtp for p2 resolution
Comment 4 Igor Fedorenko CLA 2011-07-04 06:39:04 EDT
Looks reasonable. Let me know if you need any help.
Comment 5 Fred Bricon CLA 2011-07-05 20:34:32 EDT
(In reply to comment #4)
> Looks reasonable. Let me know if you need any help.

Created a pull request : https://github.com/sonatype/m2eclipse-extras/pull/1

(or https://github.com/sonatype/m2eclipse-extras/pull/1.patch for the plain text patch version)
Comment 6 Fred Bricon CLA 2011-07-06 04:16:00 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Looks reasonable. Let me know if you need any help.
> 
> Created a pull request : https://github.com/sonatype/m2eclipse-extras/pull/1
> 
> (or https://github.com/sonatype/m2eclipse-extras/pull/1.patch for the plain
> text patch version)

Unfortunately an error in the site.xml slipped through, which prevents proper publishing of the plugin. The fix is available at https://github.com/sonatype/m2eclipse-extras/pull/2
Comment 7 Fred Bricon CLA 2011-07-15 19:35:17 EDT
Can you review / apply the aforementioned (and updated) pull request, then update the m2e-extras forge-sites please ?
Once it's done I'll tag m2e-wtp 0.13.1 for release.
Thx
Comment 8 Igor Fedorenko CLA 2011-07-26 02:49:53 EDT
git would not apply the second pull request for some reason, so I cherry-picked comming f410d5df730156a1feeb (Catch nasty IllegalArgumentException on resource refresh). let me know if I missed anything.
Comment 10 Denis Roy CLA 2021-04-19 13:25:15 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/