diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml index 198a90c10271..dffcf9d4dec4 100644 --- a/maven-plugin-api/pom.xml +++ b/maven-plugin-api/pom.xml @@ -61,20 +61,13 @@ under the License. org.codehaus.modello modello-maven-plugin - 2.0.0 - - - src/main/mdo/lifecycle.mdo - - 1.0.0 - modello - none + none - modello-site-docs + modello-site-docs-plugin-1.1 pre-site @@ -83,6 +76,18 @@ under the License. 1.1.0 + + modello-site-docs-lifecycle + pre-site + + + + src/main/mdo/lifecycle.mdo + + 1.0.0 + + + @@ -90,7 +95,7 @@ under the License. modello-plugin-velocity - velocity + velocity-lifecycle generate-sources velocity @@ -112,6 +117,28 @@ under the License. + + velocity-plugin + generate-sources + + velocity + + + 1.1.0 + + src/main/mdo/plugin.mdo + + + + + + + packageModelV3=org.apache.maven.plugin.immutabledescriptor + packageModelV4=org.apache.maven.plugin.immutabledescriptor + packageToolV4=org.apache.maven.plugin.immutabledescriptor.io.xpp3 + + + diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/lifecycle/ImmutableCollections.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/ImmutableCollections.java similarity index 99% rename from maven-plugin-api/src/main/java/org/apache/maven/plugin/lifecycle/ImmutableCollections.java rename to maven-plugin-api/src/main/java/org/apache/maven/plugin/ImmutableCollections.java index 875b0b22fa27..4ed841bcd725 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/lifecycle/ImmutableCollections.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/ImmutableCollections.java @@ -1,4 +1,4 @@ -package org.apache.maven.plugin.lifecycle; +package org.apache.maven.plugin; /* * Licensed to the Apache Software Foundation (ASF) under one @@ -38,7 +38,7 @@ import java.util.function.Predicate; import java.util.function.UnaryOperator; -class ImmutableCollections +public class ImmutableCollections { private static final List EMPTY_LIST = new AbstractImmutableList() @@ -88,7 +88,7 @@ public int size() } }; - static List copy( Collection collection ) + public static List copy( Collection collection ) { if ( collection == null ) { diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java index 80829332a972..24e1ff3d15f4 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java @@ -39,6 +39,7 @@ * TODO is there a need for the delegation of MavenMojoDescriptor to this? * Why not just extend ComponentDescriptor here? */ +@Deprecated public class MojoDescriptor extends ComponentDescriptor implements Cloneable diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java index 8c799419c3c3..c60309a90100 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java @@ -46,6 +46,7 @@ /** * @author Jason van Zyl */ +@Deprecated public class PluginDescriptor extends ComponentSetDescriptor implements Cloneable diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java index 98021fa0c922..460c329b4681 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java @@ -36,6 +36,7 @@ /** * @author Jason van Zyl */ +@Deprecated public class PluginDescriptorBuilder { public PluginDescriptor build( Reader reader ) diff --git a/maven-plugin-api/src/main/mdo/model.vm b/maven-plugin-api/src/main/mdo/model.vm index e995fa6e9478..b96d9cf71099 100644 --- a/maven-plugin-api/src/main/mdo/model.vm +++ b/maven-plugin-api/src/main/mdo/model.vm @@ -44,6 +44,7 @@ #set ( $dummy = $imports.add( "org.apache.maven.api.annotations.Nonnull" ) ) #set ( $dummy = $imports.add( "org.apache.maven.api.annotations.NotThreadSafe" ) ) #set ( $dummy = $imports.add( "org.apache.maven.api.annotations.ThreadSafe" ) ) + #set ( $dummy = $imports.add( "org.apache.maven.plugin.ImmutableCollections" ) ) #foreach ( $field in $allFields ) #if ( $field.type == "java.util.List" ) #set ( $dummy = $imports.add( "java.util.ArrayList" ) ) diff --git a/maven-plugin-api/src/main/mdo/plugin.mdo b/maven-plugin-api/src/main/mdo/plugin.mdo index ddb2fd62a301..392f1a35d5ad 100644 --- a/maven-plugin-api/src/main/mdo/plugin.mdo +++ b/maven-plugin-api/src/main/mdo/plugin.mdo @@ -34,7 +34,7 @@ under the License. package - plugin descriptor XML documentation (no java generation) + org.apache.maven.plugin.descriptor @@ -370,7 +370,7 @@ under the License. Parameter 1.0.0+ - A phase mapping definition. + A parameter definition. @@ -455,6 +455,37 @@ under the License. ]]> + + + 1.1.0+ + Add setters/getters for expression and default value coming from the mojo's configuration + + + + @@ -512,6 +543,26 @@ under the License. The field name which has this requirement. + + + 1.1.0+ + Conversion to Plexus Component Requirement + + + + @@ -547,6 +598,27 @@ under the License. The type of dependency. + + + 1.1.0+ + Conversion to Plexus Component Dependency + + + + diff --git a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/MojoDescriptorTest.java b/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/MojoDescriptorTest.java deleted file mode 100644 index 0aec7d372222..000000000000 --- a/maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/MojoDescriptorTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.apache.maven.plugin.descriptor; - -/* - * 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. - */ - -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class MojoDescriptorTest -{ - @Test - public void getParameterMap() throws DuplicateParameterException - { - MojoDescriptor mojoDescriptor = new MojoDescriptor(); - Parameter param1 = new Parameter(); - param1.setName( "param1" ); - param1.setDefaultValue( "value1" ); - mojoDescriptor.addParameter( param1 ); - - assertEquals( 1, mojoDescriptor.getParameters().size() ); - - assertEquals( mojoDescriptor.getParameters().size(), mojoDescriptor.getParameterMap().size() ); - - Parameter param2 = new Parameter(); - param2.setName( "param2" ); - param2.setDefaultValue( "value2" ); - mojoDescriptor.addParameter( param2 ); - - assertEquals( 2, mojoDescriptor.getParameters().size() ); - assertEquals( mojoDescriptor.getParameters().size(), mojoDescriptor.getParameterMap().size() ); - } - -} \ No newline at end of file