Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "M2E-WTP/New and Noteworthy/1.0.0"

(Disabled validation of build output folder)
(New API for Facet Detection for JAXRS/JSF/JPA)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== New and Noteworthy in m2e-wtp 1.0.0 ==
 
== New and Noteworthy in m2e-wtp 1.0.0 ==
  
List of all bug fixed for the current Milestone : [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=5388753&columnlist=product%2Ctarget_milestone%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&target_milestone=Kepler%20M7&product=M2E-WTP changelog]
+
List of all issues fixed for m2e-wtp 1.0.0 : [https://bugs.eclipse.org/bugs/buglist.cgi?list_id=6064081&columnlist=product%2Ctarget_milestone%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc%2Cchangeddate&query_format=advanced&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&target_milestone=Kepler%20M6&target_milestone=Kepler%20M7&target_milestone=Kepler%20RC1&target_milestone=Kepler%20RC2&target_milestone=Kepler%20RC3&target_milestone=Kepler%20RC4&product=M2E-WTP changelog]
  
 
=== Pre-Requisites ===
 
=== Pre-Requisites ===
 
m2e-wtp requires an [http://www.eclipse.org/downloads/ Eclipse JavaEE distribution], and can be installed from :
 
m2e-wtp requires an [http://www.eclipse.org/downloads/ Eclipse JavaEE distribution], and can be installed from :
* http://download.eclipse.org/m2e-wtp/releases/kepler/ for Eclipse Kepler (4.3).   
+
* http://download.eclipse.org/m2e-wtp/releases/kepler/ for Eclipse Kepler (4.3). Note the Kepler Java EE distribution now includes m2e-wtp by default.
* Juno (3.8, 4.2) version no available yet
+
* http://download.eclipse.org/m2e-wtp/releases/juno/ for Juno (3.8, 4.2)  
  
 
[http://www.eclipse.org/m2e m2e 1.4] and the Maven Archiver 0.15.0+ feature from Sonatype are required. They will be automatically discovered and installed if necessary.
 
[http://www.eclipse.org/m2e m2e 1.4] and the Maven Archiver 0.15.0+ feature from Sonatype are required. They will be automatically discovered and installed if necessary.
Line 16: Line 16:
 
m2e-wtp now supports the brand new Java EE 7 Facets introduced in WTP 3.5.0 (Kepler).  
 
m2e-wtp now supports the brand new Java EE 7 Facets introduced in WTP 3.5.0 (Kepler).  
  
*Dynamic Web Facet 3.1  
+
* Dynamic Web Facet 3.1  
*EJB Facet 3.2  
+
* EJB Facet 3.2  
*Enterprise Application (EAR) Facet 7.0 - Please note maven-ear-plugin 2.8 doesn't support <version>7</version> yet  
+
* Enterprise Application (EAR) Facet 7.0 - Please note maven-ear-plugin 2.8 doesn't support <version>7</version> yet  
*Application Client Facet 7.0  
+
* Application Client Facet 7.0  
*JCA (Connector) Facet 1.7
+
* JCA (Connector) Facet 1.7
 +
* JAX-RS 2.0
 +
* JPA 2.1
 +
* JSF 2.2
  
 
Also, when m2e-wtp is unable to determine the correct Facet from the maven plugin settings or deployment descriptors are missing, instead of setting a default version, the existing user-installed Facet will be kept.  
 
Also, when m2e-wtp is unable to determine the correct Facet from the maven plugin settings or deployment descriptors are missing, instead of setting a default version, the existing user-installed Facet will be kept.  
Line 45: Line 48:
 
The pom settings always override the workspace preferences. So if you have, for instance the JPA configurator disabled at the workspace level, using <m2e.jpa.activation>true</m2e.jpa.activation> will enable it on your project anyway.
 
The pom settings always override the workspace preferences. So if you have, for instance the JPA configurator disabled at the workspace level, using <m2e.jpa.activation>true</m2e.jpa.activation> will enable it on your project anyway.
  
=== New API for Facet Detection for JAXRS/JSF/JPA ===
+
=== New API for Facet Detection for JAX-RS/JSF/JPA ===
 
A new extension point is available for 3rd party adopters willing to contribute alternative Facet detection strategies for the JPA, JAX-RS and JSF configurators.
 
A new extension point is available for 3rd party adopters willing to contribute alternative Facet detection strategies for the JPA, JAX-RS and JSF configurators.
 
All you need to do is extend org.eclipse.m2e.wtp.facets.AbstractFacetDetector
 
All you need to do is extend org.eclipse.m2e.wtp.facets.AbstractFacetDetector
Line 84: Line 87:
  
 
=== Disabled validation of build output folder ===
 
=== Disabled validation of build output folder ===
m2e-wtp now disables WTP validators on the build output folder ( usually the target/ folder). This dramatically improve build times when using big war overlays, for instance. Validating such files makes no sense since these files are generally not user generated.
+
m2e-wtp now disables WTP validation on the build output folder (usually the target/ folder). This dramatically improves build times when using big war overlays, for instance. Validating resources under that folder makes no sense since they are generally not manually generated and will likely be regenerated automatically on subsequent builds.
  
 
=== Eliminated unnecessary file copies ===
 
=== Eliminated unnecessary file copies ===
TODO
+
Prior to WTP 3.5.0, in order to deploy classpath entries under a non default name, m2e-wtp used to copy original files under the target folder, using the deployed name, then make the Maven Classpath library point at the copied file. This non-pretty workaround could cause bad file locking issues under Windows.
 +
 
 +
Since WTP 3.5.0 (Kepler), that file copy is not necessary anymore. WTP is now able to directly deploy classpath entries under non-default names. The old file copy-based workaround is still used when m2e-wtp is used with older WTP versions.

Latest revision as of 10:10, 26 June 2013

New and Noteworthy in m2e-wtp 1.0.0

List of all issues fixed for m2e-wtp 1.0.0 : changelog

Pre-Requisites

m2e-wtp requires an Eclipse JavaEE distribution, and can be installed from :

m2e 1.4 and the Maven Archiver 0.15.0+ feature from Sonatype are required. They will be automatically discovered and installed if necessary.

Restart your workspace after the installation.

Java EE 7 support

m2e-wtp now supports the brand new Java EE 7 Facets introduced in WTP 3.5.0 (Kepler).

  • Dynamic Web Facet 3.1
  • EJB Facet 3.2
  • Enterprise Application (EAR) Facet 7.0 - Please note maven-ear-plugin 2.8 doesn't support <version>7</version> yet
  • Application Client Facet 7.0
  • JCA (Connector) Facet 1.7
  • JAX-RS 2.0
  • JPA 2.1
  • JSF 2.2

Also, when m2e-wtp is unable to determine the correct Facet from the maven plugin settings or deployment descriptors are missing, instead of setting a default version, the existing user-installed Facet will be kept.

Be aware the Java EE 7 specs require projects to build using Java 1.7. Don't forget to set the proper maven-compiler-plugin configuration :

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.1</version>
  <configuration>
  <source>1.7< /source>
  <target>1.7</target>
  </configuration>
</plugin>


Enable/Disable the JAX-RS/JPA/JSF Configurators at the pom.xml level

The optional JAX-RS, JPA and JSF configurators can be enabled or disabled at a workspace level from Window > Preferences > Maven > Java EE Integration. Now, you can have a finer grain control on these configurators directly from your pom.xml properties :

  • Adding <m2e.jaxrs.activation>false</m2e.jaxrs.activation> in your pom properties section will disable the JAX-RS configurator
  • Adding <m2e.jpa.activation>false</m2e.jpa.activation> in your pom properties section will disable the JPA configurator
  • Adding <m2e.jsf.activation>false</m2e.jsf.activation> in your pom properties section will disable the JSF configurator

The pom settings always override the workspace preferences. So if you have, for instance the JPA configurator disabled at the workspace level, using <m2e.jpa.activation>true</m2e.jpa.activation> will enable it on your project anyway.

New API for Facet Detection for JAX-RS/JSF/JPA

A new extension point is available for 3rd party adopters willing to contribute alternative Facet detection strategies for the JPA, JAX-RS and JSF configurators. All you need to do is extend org.eclipse.m2e.wtp.facets.AbstractFacetDetector

public class MyCustomFacetDetector extends AbstractFacetDetector {
  @Override
  public IProjectFacetVersion findFacetVersion(IMavenProjectFacade mavenProjectFacade, Map<?, ?> context, IProgressMonitor monitor) {
    //context is an optional map containing context sensitive data.
    //It currently only contains a JptXmlRresource instance when invoked by the JPA configurator
    //JptXmlResource jpaXmlResource = (JptXmlResource)context.get(JpaProjectConfigurator.PERSISTENCE_XML_KEY);
 
    IProjectFacetVersion version = ...//implement Facet detection logic, ex. inspect mavenProjectFacade.getMavenProject().getArtifacts() 
                                      //for interesting   dependencies.
    return version;
  }
}

In order to contribute the new strategy for the facet of your choice, you need to declare the extension point in your plugin.xml like :

<extension
      point="org.eclipse.m2e.wtp.facetDetectors">
   <facetDetector
         class="org.eclipse.m2e.wtp.jpa.internal.configurators.PersistenceXmlJpaFacetDetector"
         facetId="jpt.jpa"
         priority="10"><!-- lowest values have highest priority-->
   </facetDetector>
</extension>

So if you want to contribute a JPA Facet detector that's invoked *before* the m2e-wtp's built-in PersistenceXmlJpaFacetDetector, give the priority a value lower than 10.

Project conversion enhancements

When converting an Eclipse project to Maven, m2e-wtp will now try to detect the latest available released plugin version from available Nexus Indexes (though that detection strategy may change in the future). If no Nexus index is available or no recent plugin version can be found, then m2e-wtp will fall back on a reference version.

This is particularly useful in the case of the maven-ear-plugin (v2.8), which currently doesn't support Java EE 7. Once a newer version is released, m2e-wtp will be able to use that to perform valid EAR 7 project conversions to Maven.

Disabled validation of build output folder

m2e-wtp now disables WTP validation on the build output folder (usually the target/ folder). This dramatically improves build times when using big war overlays, for instance. Validating resources under that folder makes no sense since they are generally not manually generated and will likely be regenerated automatically on subsequent builds.

Eliminated unnecessary file copies

Prior to WTP 3.5.0, in order to deploy classpath entries under a non default name, m2e-wtp used to copy original files under the target folder, using the deployed name, then make the Maven Classpath library point at the copied file. This non-pretty workaround could cause bad file locking issues under Windows.

Since WTP 3.5.0 (Kepler), that file copy is not necessary anymore. WTP is now able to directly deploy classpath entries under non-default names. The old file copy-based workaround is still used when m2e-wtp is used with older WTP versions.

Back to the top