This page details some of the backwards compatibility issues that you might encounter upgrading between Maven versions, and how to update your project.
JDK requirement is now 1.4 and above
The JDK required to run Maven is now 1.4 or above. This does not affect what JDKs you can build your libraries for, however - you can still generate class files that will run on 1.1 JVMs as before.
Deprecated Plugins Removed
The following plugins are no longer distributed with Maven by default. They are still available using
the plugin:download
command to obtain the version released with Maven 1.0.2, and the source
code is available from the plugin sandbox. If there is sufficient interest in maintaining them or moving
them to another project it will be considered.
The default
attribute in maven.xml has been deprecated
The default goal should be specified in a <defaultGoal>
tag inside the
<build>
section of project.xml instead of maven.xml.
Changes for XML parsers
Due to the minimum JDK requirement, Xerces is no longer bundled with Maven. Plugins that relied on that particular version of Xerces and are no JAXP compliant may need modifications.
XSLT should now work under JDK 1.4 and 5.0 without the plugin modifications previously required.
Bundled Ant version changed from 1.5.3-1 to 1.6.5
While in most cases this change should be transparent, those using optional tasks will need to add them as a dependency to their plugin/project, as not all optional tasks are bundled with Maven any more.
Implicit dependencies on JARs in Maven's lib
directory
Aside from the XML parsers, the following libraries are no longer distributed with Maven:
commons-digester
commons-graph
commons-lang
which
If a plugin did not declare a dependency but relied on its existence, it may fail to work under Maven 1.1.
In addition, the versions of some libraries have changed, which may affect plugins.
Upgrading maven.jar
If you are directly importing and using classes from this package, you may find classes
from the org.apache.maven.project
package are missing as they have moved.
This may also apply if you are using maven-jelly-tags
.
Fix: Include maven-model-3.0.1
in your project's dependencies.
Changes to org.apache.maven.project.Repository
(and use of pom.repository.*
in Jelly)
The Repository
class now houses only the information from the project model.
You may find that static methods such as splitSCMConnection
and tokenizerToArray
or fields such as scmType
, which depended on the split function, are missing.
Fix: These functions have been removed. The static methods do exist in
maven-changelog-plugin
if needed, in the RepositoryUtils
class.
All other plugins had been manually splitting the connection string.
See maven-scm-plugin
for an example of this.
The future should see all plugins and code using Maven SCM for this task, and all dealings with an
SCM system.
Use of Project.getDependencyPath
and Project.getDependency
If you have a single non-JAR artifact that you resolve using this function, it will no longer be found.
Fix: Specify the type in the argument. The full form is
getDependency('groupId:artifactId:type')
. Type is defaulted to jar
.
Parse errors on previously 'valid' project files
project.xml
files that used to work in older versions of Maven may now present parse
errors. The parser in Maven 1.1 is much less tolerant of invalid project.xml
files
to avoid silently masking syntax errors. Some XML features are not enabled (such as DOCTYPE ENTITY
declarations) - see the FAQ for an explanation.
Fix: Check your project file against the XSD published for the model version you are using.
Entities and JDK 1.4
Due to a bug in the parser included with JDK 1.4, relative SYSTEM entities will not work in
maven.xml
where they may have previously.
Fix: As above, we recommend not using entities in maven.xml
, in favour of inheritance
and plugins. If you want an existing file to work without modifications, you should
download Xerces and place it in
<JAVA_HOME>/jre/lib/endorsed
(this directory may need to be created).
Deprecated create-upload-bundle
goal.
Replaced by artifact:create-upload-bundle
.