|
The Apache Maven team announced a while ago to stop supporting Maven2.
Now it is time for the plugins to follow. This pages describes the topics on what to do to make plugin Maven3+ compliant.
maven.compiler.source
and maven.compiler.target
properties to 1.7There is a report generated daily with plugins prerequisites.
While at it, some housekeeping can be done:
org.apache.maven.plugins
.xxx (matching the groupId, not conflicting with maven-core org.apache.maven.plugin
package)The following plugins already use successfully without maven-compat and with maven-artifact-transfer:
Maven Shared Components needed to be upgraded:
Known plugins still to do (there are probably more):
The plugins which have been lifted to 3.0.0‚
Testcases with this code:
container = new DefaultPlexusContainer();
container.initialize(); // This statement can be removed for 3.0
container.start(); // This statement can be removed for 3.0
Intermittently (and while upgrading) you may find code like this:
metadataSource = (ArtifactMetadataSource) lookup( ArtifactMetadataSource.ROLE );
While you are still working with maven-compat, you can fix this by switching to lookup by type;
metadataSource = (ArtifactMetadataSource) lookup( ArtifactMetadataSource.class);
Deprecation mappings
Old | New |
---|---|
org.apache.maven.project.MavenProjectBuilder |
Some adaptions necessary, some reflection to stay compatible with 2 Aether versions. See http://svn.apache.org/viewvc?view=revision&revision=r1685177 for sample |
org.apache.maven.artifact.factory.ArtifactFactory | org.apache.maven.repository.RepositorySystem (however, there's only one implementation: LegacyRepositorySystem, which is again part of maven-compat AND reuses ArtifactFactory) Depending on what you want to do next with the Artifact, you could use TransferUtils.toArtifactCoordinate() instead. |
org.apache.maven.artifact.repository.ArtifactRepositoryFactory | org.apache.maven.artifact.repository.MavenArtifactRepository |
org.apache.maven.artifact.resolver.ArtifactCollector | org.apache.maven.shared.artifact.collect.DependencyCollector |
org.apache.maven.artifact.deployer.ArtifactDeployer | org.apache.maven.shared.artifact.deploy.ArtifactDeployer |
org.apache.maven.artifact.installer.ArtifactInstaller | org.apache.maven.shared.artifact.install.ArtifactInstaller |
org.apache.maven.artifact.resolver.ArtifactResolver | org.apache.maven.shared.artifact.resolve.ArtifactResolver |
It won't be possible any more to get the dependencies based on an artifact, since an artifact is basically a reference to a file with a coordinate. Instead you must use a dependency, plugin, extension or other model entity to resolve the dependencies. See http://maven.apache.org/shared-archives/maven-artifact-transfer-LATEST/comparison.html for a matrix.