[jbosstools-dev] Maven WTP Integration

Rob Cernich rcernich at redhat.com
Mon Jan 9 09:05:45 EST 2012


Hey Fred,

Thanks for the info.  Helps a lot.

> adding the utility facet always creates a MANIFEST.MF, this is a WTP
> thing. I opened this request upstream :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=349575
> In m2e-wtp, we have this ugly hack where MANIFESTS added by project
> facets are "manually" deleted :
> https://github.com/sonatype/m2eclipse-wtp/blob/master/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/AbstractProjectConfiguratorDelegate.java#L185

I'll pursue this if it becomes a big issue.

> The Utility project configurator only works on maven projects that
> already have the utility facet set, so their configuration can be
> updated.  Initial configuration is triggered by depending projects
> (war
> or ear).
> If you install the Utility facet in your SYconfigurator and it runs
> after the Utility configurator(assuming you can't change the maven
> phase
> in which it's called), I suggest you copy what's done in
> https://github.com/sonatype/m2eclipse-wtp/blob/master/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/AbstractProjectConfiguratorDelegate.java#L107
> and
> https://github.com/sonatype/m2eclipse-wtp/blob/master/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/UtilityProjectConfigurator.java#L56
> , i.e. call WTPProjectsUtil.removeWTPClasspathContainer(),
> WTPProjectsUtil.removeTestFolderLinks(),
> WTPProjectsUtil.setNonDependencyAttributeToContainer(). There is
> obviously some duplication between
> UtilityProjectConfigurator.configure() and
> AbstractProjectConfiguratorDelegate.configureWtpUtil () and hopefully
> I'll be able to refactor that at a later date (quality patches
> accepted).

Sounds good.  Once again, if it becomes an issue for folks, I'll look into this.  (We're basically pre-alpha, so warts are expected. ;))

> About setting the proper maven configuration when setting the Maven
> facet, it seemed to work last time I checked, please open a ticket in
> JIRA with some steps to reproduce, so I can take a look.

Sorry, I think you misunderstood me (or I've misunderstood your reply).  There is no problem with the Maven configuration.  It is the configuration for the other facets.  For example, the Java facet defaults to source=src, output=build/classes; the web facet defaults web resources=WebResources.  I was wondering if those could be set more appropriately when the Maven facet is selected in the new faceted project wizard.  It's not a big deal for me, just something I noticed.

> Also, please note that I'm trying to add a conversion API directly in
> m2e-core : https://bugs.eclipse.org/bugs/show_bug.cgi?id=359340

Something like this in reverse is what I was thinking regarding the wizard (i.e. Maven setting the initial settings for Java source/output, web resources, etc.).  I certainly wouldn't put a high priority on it (not sure how many people use the faceted project wizard).  I just notice it when testing the facet stuff.

Thanks again,
Rob

> HIH. Regards,
> 
> Fred Bricon
> 
> Le 07/01/2012 23:17, Rob Cernich a écrit :
> > Hey all,
> >
> > I just finished adding some basic WTP support for SwitchYard and
> > had a couple of questions regarding WTP and Maven integration.
> >  The SwitchYard facet can be added to any JEE type (although it is
> > not currently constrained in this fashion).  If the project is not
> > already a JEE type project, the Utility Module facet is added.
> >  This effectively allows SY applications to be deployed to any JEE
> > server.
> >
> > Some of the issues:
> > Adding the Utility Module facet causes the module nature to be
> > added, which always creates a META-INF/MANIFEST.MF file within the
> > project.  Is there a way to disable this behavior for Maven
> > projects (e.g. where Maven may be generating the manifest)?
> >
> > Maven project configurators run in the order they appear in the
> > lifecycle processing.  There is a Utility Module configurator that
> > configures projects containing the Utility Module facet.  However,
> > this is executed during the compile phase and the SY configurator,
> > which adds the Utility Module facet, runs during the
> > process-classes phase.  Because of this, the "deployables" are not
> > configured correctly on the project (i.e. the test sources and
> > resources are included).  The current workaround is to run
> > Maven->Update Project Configuration after the project is created
> > or imported.  Is there a way to fix this?  (FYI, this is not a
> > problem if the project is based on another JEE technology, e.g.
> > WAR, EJB, etc.)
> >
> > When running the new faceted project wizard and including the Maven
> > facet, it would be nice if the other facets' configurations were
> > defaulted appropriately (e.g. Java source and output folders, web
> > resources, etc.).  Is there a way to provide more useful defaults?
> >
> > Sorry for the barrage of questions.
> >
> > Thanks in advance,
> > Rob
> > _______________________________________________
> > jbosstools-dev mailing list
> > jbosstools-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/jbosstools-dev
> 
> 



More information about the jbosstools-dev mailing list