Child pages
  • Plugin migration to Maven3 dependencies

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added some sections to ease reading

...

Now it is time for the plugins to follow. This pages describes the topics on what to do to make plugin Maven3+ compliant.

Howto

  1. Set the Maven prerequisite and dependencies to 3.0, which might cause one or more of the following issues:
    1. Unknown dependencies in the pom.xml, e.g. the maven-project artifact doesn't exist anymore: its content is now part of maven-core 
    2. CNFE. Some classes have been moved to maven-compat. You could add it temporarily to get it all working again, later you'll get the instructions how to get rid of it.
  2. Set both the maven.compiler.source and maven.compiler.target properties to 1.6
  3. If the project depends on maven-plugin-testing-harness, use version 2.1, since newer versions depend on newer version of Maven dependencies. Ensure to exclude the maven-2.x dependencies which don't exist anymore, e.g. maven-project
  4. Remove maven-compat (or give it the test-scope if it is required by the maven-plugin-testing-harness)
    Maven compat mainly contains business logic which has been moved to Aether. However, we need to support the implementations of both Sonatype (M3.0.x) and Eclipse (M3.1+). The shared component maven-artifact-transfer can select the proper implementation.
  5. Transitive dependencies may still refer to Maven-2.x artifacts, even if they don't exist for Maven 3.x any more: ensure these are excluded. You can enforce this by adding the requireSameVersions enforcer rule to your project.
  6. Reporting plugins should include org.apache.maven.reporting:maven-reporting-api:3.0

There is a report generated daily with plugins prerequisites.

Housekeeping

While at it, some housekeeping can be done:

  1. Rename package to org.apache.maven.plugins.xxx (matching the groupId, not conflicting with maven-core org.apache.maven.plugin package)
  2. Resolve reflection usage, meant to call Maven3 specific code when available.
  3. Remove deprecated parameters, methods, goals, classes
  4. Remove unnecessary overloaded methods. Some methods have been extended with arguments to stay backwards compatible. Time to clean this up (if the number of arguments is still uncertain, use a Request/Result object containing the argument objects, so the method signature will stay the same).

Plugins followup

The following plugins already use successfully without maven-compat and with maven-artifact-transfer:

...

  • maven-clean-plugin (tick) (has been released as 3.0.0).
  • maven-acr-plugin (tick) (has been release as 3.0.0).
  • maven-source-plugin (tick) (has been released as 3.0.0).

5.Housekeeping

  1. Rename package to org.apache.maven.plugins.xxx (matching the groupId, not conflicting with maven-core org.apache.maven.plugin package)
  2. Resolve reflection usage, meant to call Maven3 specific code when available.
  3. Remove deprecated parameters, methods, goals, classes
  4. Remove unnecessary overloaded methods. Some methods have been extended with arguments to stay backwards compatible. Time to clean this up (if the number of arguments is still uncertain, use a Request/Result object containing the argument objects, so the method signature will stay the same).

 

Stuff that may have changed

...