blob: a17b961b7272d50d5cefbfcc563e6e406ede8f61 [file] [log] [blame]
------
Java 6 in Plugins and Shared Components
------
Dennis Lundberg
------
2015-02-14
------
~~ Licensed to the Apache Software Foundation (ASF) under one
~~ or more contributor license agreements. See the NOTICE file
~~ distributed with this work for additional information
~~ regarding copyright ownership. The ASF licenses this file
~~ to you under the Apache License, Version 2.0 (the
~~ "License"); you may not use this file except in compliance
~~ with the License. You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing,
~~ software distributed under the License is distributed on an
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~~ KIND, either express or implied. See the License for the
~~ specific language governing permissions and limitations
~~ under the License.
~~ NOTE: For help with the syntax of this file, see:
~~ https://maven.apache.org/doxia/references/apt-format.html
Java 6 in Plugins and Shared Components
When you want to start using Java 6 features in a plugin, or a shared component,
the process described here must be used as decided by the Maven PMC.
A plugin/component can start using Java 6 features and/or dependencies when the need
arises. If there are issues that have already been fixed, but not yet released,
the current trunk of the plugin/component must be released first, targeting Java 5.
In the announcement for such a final Java 5 version of the plugin/component, we inform
the users that this is the last version that will work with Java 5.
* In JIRA
When a plugin/component decides to switch to Java 6, you should set
the description field for the versions in JIRA for the plugin/component, so that it
is clear which version works with which version of Java.
Mark the last Java 5 compatible version with "Last version to work with Java 5",
see {{{https://issues.apache.org/jira/browse/MCHECKSTYLE/fixforversion/20631}example}}.
Mark the first version that requires Java 6 "This version requires Java 6",
see {{{https://issues.apache.org/jira/browse/MCHECKSTYLE/fixforversion/20762}example}}.
Create an issue "Require Java 6" and schedule it for the first Java 6
version, see {{{https://issues.apache.org/jira/browse/MCHECKSTYLE-277}example}}.
Reference this issue when you check in the code changes (see below) into
version control
* On the plugin/component site
Specify the Java requirements in <<<index.apt.vm>>>: "This plugin/component requires Java
$\{javaVersion\}.", see
{{{https://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/index.apt.vm?r1=1650811&r2=1652771&pathrev=1658048}example}}.
We need to use the variable $\{javaVersion\} here, because
$\{maven.compiler.source\} does not work in a site.
* In the POM
Make sure these 3 properties are defined, either in the project or in a
parent:
* javaVersion=1.6
* maven.compiler.source=$\{javaVersion\}
* maven.compiler.target=$\{javaVersion\}
[]
Here is a list plugins that are defined in a parent, and that already makes
use of the above mentioned properties. So it should be enough to just make
sure that the effective-pom looks ok.
* <<<maven-compiler-plugin>>> is defined in <<<maven-parent>>>, see
{{{https://svn.apache.org/viewvc/maven/pom/tags/maven-parent-26/pom.xml?view=markup#l842}example}}
* <<<maven-enforcer-plugin>>> and the <<<enforceBytecodeVersion>>> rule is defined in
<<<maven-parent>>>, see
{{{https://svn.apache.org/viewvc/maven/pom/tags/maven-parent-26/pom.xml?view=markup#l946}example}}
* <<<maven-pmd-plugin>>> is defined in <<<maven-parent>>>, see
{{{https://svn.apache.org/viewvc/maven/pom/tags/maven-parent-26/pom.xml?view=markup#l1069}example}}
[]
These plugins that are not defined in a parent, so you might need
to configure the Java version for them in the plugin/component
~~ TODO The links in the following bullets should be changed to point to a tag, once maven-checkstyle-plugin has been released
* <<<animal-sniffer-maven-plugin>>> is only defined in selected plugins, see
{{{https://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/pom.xml?view=markup#l307}example in <<<maven-checkstyle-plugin>>>}}.
We should move it to maven-parent.
* <<<buildhelper-maven-plugin>>> is used to create the signature for
animal-sniffer and is only defined in selected plugins, see
{{{https://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/pom.xml?view=markup#l295}example in <<<maven-checkstyle-plugin>>>}}.
We should move it to maven-parent.
* <<<maven-plugin-plugin>>> is only defined in selected plugins, see
{{{https://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/pom.xml?view=markup#l370}example in <<<maven-checkstyle-plugin>>>}}.
We should move it to maven-plugins parent.
[]