Author: gboue Date: Fri Nov 11 17:13:13 2016 New Revision: 1769319 URL: http://svn.apache.org/viewvc?rev=1769319&view=rev Log: [MPH-120] Migrate plugin to Maven 3.0
Bump Maven requirement to 3.0 and version of the plugin to 3.0.0-SNAPSHOT. Replacing deprecated APIs like ArtifactFactory with the use of the shared components and removing Maven 2 specific code. The "expressions" goal that was Maven 2 specific is removed (it is now covered in the Javadoc of PluginParameterExpressionEvaluator). Added: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-deploy.properties - copied, changed from r1768278, maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test.properties maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/ maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/ maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml (with props) maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties (with props) maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy (with props) maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/ActiveProfilesMojoTest.java (with props) maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/AllProfilesMojoTest.java (with props) maven/plugins/trunk/maven-help-plugin/src/test/resources/unit/active-profiles/ maven/plugins/trunk/maven-help-plugin/src/test/resources/unit/active-profiles/plugin-config.xml (with props) maven/plugins/trunk/maven-help-plugin/src/test/resources/unit/all-profiles/ maven/plugins/trunk/maven-help-plugin/src/test/resources/unit/all-profiles/plugin-config.xml (with props) Removed: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test.properties maven/plugins/trunk/maven-help-plugin/src/it/expressions/ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/HelpUtil.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/LoggerRetriever.java maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/ExpressionsMojoTest.java maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/HelpUtilTest.java Modified: maven/plugins/trunk/maven-help-plugin/pom.xml maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/module/pom.xml maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/verify.groovy maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/pom.xml maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/verify.groovy maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/test.properties maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/invoker.properties maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java maven/plugins/trunk/maven-help-plugin/src/site/apt/examples/describe-configuration.apt maven/plugins/trunk/maven-help-plugin/src/site/apt/index.apt.vm maven/plugins/trunk/maven-help-plugin/src/site/apt/usage.apt maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/DescribeMojoTest.java maven/plugins/trunk/maven-help-plugin/src/test/java/org/apache/maven/plugins/help/EvaluateMojoTest.java Modified: maven/plugins/trunk/maven-help-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/pom.xml?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-help-plugin/pom.xml Fri Nov 11 17:13:13 2016 @@ -30,7 +30,7 @@ under the License. </parent> <artifactId>maven-help-plugin</artifactId> - <version>2.2.1-SNAPSHOT</version> + <version>3.0.0-SNAPSHOT</version> <packaging>maven-plugin</packaging> <name>Apache Maven Help Plugin</name> @@ -63,7 +63,7 @@ under the License. </distributionManagement> <properties> - <mavenVersion>2.2.1</mavenVersion> + <mavenVersion>3.0</mavenVersion> </properties> <dependencies> @@ -90,41 +90,48 @@ under the License. </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-descriptor</artifactId> - <version>${mavenVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> - <version>${mavenVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> <artifactId>maven-settings</artifactId> <version>${mavenVersion}</version> </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-profile</artifactId> - <version>${mavenVersion}</version> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-parameter-documenter</artifactId> - <version>${mavenVersion}</version> - </dependency> <!-- maven plugin tools --> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> - <artifactId>maven-plugin-tools-api</artifactId> - <version>2.4.3</version> + <artifactId>maven-plugin-tools-generators</artifactId> + <version>${mavenPluginToolsVersion}</version> + <exclusions> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-descriptor</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> <scope>provided</scope> </dependency> + + <!-- shared --> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-artifact-transfer</artifactId> + <version>0.9.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-api</artifactId> + <version>3.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-exec</artifactId> + <version>1.3</version> + </dependency> <!-- plexus --> <dependency> @@ -176,7 +183,13 @@ under the License. <dependency> <groupId>org.apache.maven.plugin-testing</groupId> <artifactId>maven-plugin-testing-harness</artifactId> - <version>1.3</version> + <version>2.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${mavenVersion}</version> <scope>test</scope> </dependency> <dependency> Added: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,24 @@ +/* + * 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. + */ + +def buildLog = new File(basedir, 'build.log'); + +assert buildLog.exists() + +assert 1 == buildLog.text.count( ' - it-repo (source: external)' ) Propchange: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/module/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/module/pom.xml?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/module/pom.xml (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/module/pom.xml Fri Nov 11 17:13:13 2016 @@ -21,4 +21,18 @@ <artifactId>active-profiles_multimodule-module</artifactId> + <profiles> + <profile> + <id>mph79-child</id> + <activation> + <file> + <exists>${basedir}/pom.xml</exists> + </file> + </activation> + </profile> + <profile> + <id>mph79-child-inactive</id> + </profile> + </profiles> + </project> Modified: maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/verify.groovy?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/verify.groovy (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/active-profiles_multimodule/verify.groovy Fri Nov 11 17:13:13 2016 @@ -16,7 +16,11 @@ * specific language governing permissions and limitations * under the License. */ + def buildLog = new File( basedir, 'build.log' ); assert buildLog.exists() assert 2 == buildLog.text.count( ' - mph79 (source: org.apache.maven.its.help:active-profiles_multimodule:1.0-SNAPSHOT)' ) +assert 1 == buildLog.text.count( ' - mph79-child (source: org.apache.maven.its.help:active-profiles_multimodule-module:1.0-SNAPSHOT)' ) +assert 0 == buildLog.text.count( ' - mph79-child-inactive' ) +assert 2 == buildLog.text.count( ' - it-repo (source: external)' ) Modified: maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/pom.xml?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/pom.xml (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/pom.xml Fri Nov 11 17:13:13 2016 @@ -33,4 +33,18 @@ under the License. <plugins> </plugins> </build> + + <profiles> + <profile> + <id>profile-active-from-pom</id> + <activation> + <file> + <exists>pom.xml</exists> + </file> + </activation> + </profile> + <profile> + <id>profile-inactive-from-pom</id> + </profile> + </profiles> </project> Modified: maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/verify.groovy?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/verify.groovy (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/all-profiles/verify.groovy Fri Nov 11 17:13:13 2016 @@ -19,4 +19,6 @@ def buildLog = new File( basedir, 'build.log' ); assert buildLog.exists() -assert buildLog.text.contains( ' Profile Id: it-repo (Active: true , Source: settings.xml)' ) +assert 1 == buildLog.text.count( ' Profile Id: it-repo (Active: true , Source: settings.xml)' ) +assert 1 == buildLog.text.count( ' Profile Id: profile-active-from-pom (Active: true , Source: pom)' ) +assert 1 == buildLog.text.count( ' Profile Id: profile-inactive-from-pom (Active: false , Source: pom)' ) Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,19 @@ +# 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. + +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:describe +invoker.buildResult = failure Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml Fri Nov 11 17:13:13 2016 @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +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. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.help</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + + <description> + </description> + + <build> + <plugins> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,18 @@ +# 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. + +cmd = invalid Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-invalid/test.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,19 @@ +# 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. + +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:describe +invoker.buildResult = failure Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml Fri Nov 11 17:13:13 2016 @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +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. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.help</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + + <description> + </description> + + <build> + <plugins> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,18 @@ +# 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. + +cmd = deploy:invalid Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal-invalid/test.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/test.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/test.properties?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/test.properties (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/test.properties Fri Nov 11 17:13:13 2016 @@ -16,3 +16,4 @@ # under the License. cmd = deploy:deploy +output = result.txt Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,29 @@ +/* + * 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. + */ + +def result = new File(basedir, 'result.txt').text; + +def ls = System.getProperty( "line.separator" ); + +assert result.contains("'deploy:deploy' is a plugin goal (aka mojo)." + ls + + "Mojo: 'deploy:deploy'" + ls + + "deploy:deploy" + ls + + " Description:") + +return true; Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd-with-goal/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/invoker.properties?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/invoker.properties (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/invoker.properties Fri Nov 11 17:13:13 2016 @@ -15,4 +15,8 @@ # specific language governing permissions and limitations # under the License. -invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:describe +invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:describe +invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:describe + +invoker.systemPropertiesFile.1 = test-deploy.properties +invoker.systemPropertiesFile.2 = test-site.properties Copied: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-deploy.properties (from r1768278, maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test.properties) URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-deploy.properties?p2=maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-deploy.properties&p1=maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test.properties&r1=1768278&r2=1769319&rev=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test.properties (original) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-deploy.properties Fri Nov 11 17:13:13 2016 @@ -16,3 +16,4 @@ # under the License. cmd = deploy +output = result-deploy.txt Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,19 @@ +# 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. + +cmd = site +output = result-site.txt Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/test-site.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,31 @@ +/* + * 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. + */ + +def result = new File(basedir, 'result-deploy.txt').text; + +def ls = System.getProperty( "line.separator" ); + +assert result.contains("'deploy' is a phase corresponding to this plugin:" + ls + + "org.apache.maven.plugins:maven-deploy-plugin") + +result = new File(basedir, 'result-site.txt').text; + +assert result.contains("'site' is a lifecycle with the following phases:") + +return true; Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-cmd/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,18 @@ +# 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. + +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:describe Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml Fri Nov 11 17:13:13 2016 @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +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. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.help</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + + <description> + </description> + + <build> + <plugins> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,20 @@ +# 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. + +# in this specific version, the descriptor of the plugin doesn't have the plugin name +plugin = org.apache.maven.plugins:maven-help-plugin:2.0 +output = result.txt Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/test.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,30 @@ +/* + * 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. + */ + +def result = new File(basedir, 'result.txt').text; + +def ls = System.getProperty( "line.separator" ); + +assert result.contains( "Name: Maven Help Plugin" ) + +assert result.contains( "Group Id: org.apache.maven.plugins" + ls + + "Artifact Id: maven-help-plugin" + ls + + "Version: 2.0" ) + +return true; Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/describe-plugin-without-name/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,18 @@ +# 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. + +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:evaluate Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/invoker.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml Fri Nov 11 17:13:13 2016 @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +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. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.help</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + + <build> + <plugins> + </plugins> + </build> +</project> Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties Fri Nov 11 17:13:13 2016 @@ -0,0 +1,19 @@ +# 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. + +expression = settings.servers[0] +output = result.txt Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/test.properties ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,26 @@ +/* + * 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. + */ + +def result = new File(basedir, 'result.txt').text; + +assert result.contains( '<id>deep-clone</id>' ) +assert result.contains( '<password>server-password</password>' ) +assert result.contains( '<passphrase>server-passphrase</passphrase>' ) + +return true; Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate-settings-servers/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy?rev=1769319&view=auto ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy (added) +++ maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy Fri Nov 11 17:13:13 2016 @@ -0,0 +1,23 @@ +/* + * 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. + */ + +def result = new File(basedir, 'build.log').text; +assert result.contains( 'The description.' ) + +return true; Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-help-plugin/src/it/evaluate/verify.groovy ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java Fri Nov 11 17:13:13 2016 @@ -25,16 +25,20 @@ import java.io.Writer; import java.util.List; import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.ArtifactUtils; -import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; -import org.apache.maven.project.MavenProjectBuilder; -import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.shared.artifact.ArtifactCoordinate; +import org.apache.maven.shared.artifact.DefaultArtifactCoordinate; +import org.apache.maven.shared.artifact.resolve.ArtifactResolver; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.WriterFactory; @@ -52,17 +56,20 @@ public abstract class AbstractHelpMojo /** The maximum length of a display line. */ protected static final int LINE_LENGTH = 79; + /** The line separator for the current OS. */ + protected static final String LS = System.getProperty( "line.separator" ); + /** - * Maven Artifact Factory component. + * Maven Project Builder component. */ @Component - private ArtifactFactory artifactFactory; + protected ProjectBuilder projectBuilder; /** - * Maven Project Builder component. + * Component used to resolve artifacts and download their files from remote repositories. */ @Component - private MavenProjectBuilder mavenProjectBuilder; + protected ArtifactResolver artifactResolver; /** * Remote repositories used for the project. @@ -75,10 +82,17 @@ public abstract class AbstractHelpMojo */ @Parameter( defaultValue = "${localRepository}", required = true, readonly = true ) protected ArtifactRepository localRepository; + + /** + * The current build session instance. This is used for + * plugin manager API calls. + */ + @Parameter( defaultValue = "${session}", readonly = true, required = true ) + protected MavenSession session; /** * Optional parameter to write the output of this help in a given file, instead of writing to the console. - * <br/> + * <br> * <b>Note</b>: Could be a relative path. */ @Parameter( property = "output" ) @@ -132,11 +146,14 @@ public abstract class AbstractHelpMojo } /** - * @param artifactString should respect the format <code>groupId:artifactId[:version][:classifier]</code> + * Parses the given String into GAV artifact coordinate information, adding the given type. + * + * @param artifactString should respect the format <code>groupId:artifactId[:version]</code> + * @param type The extension for the artifact, must not be <code>null</code>. * @return the <code>Artifact</code> object for the <code>artifactString</code> parameter. * @throws MojoExecutionException if the <code>artifactString</code> doesn't respect the format. */ - protected Artifact getArtifact( String artifactString ) + protected ArtifactCoordinate getArtifactCoordinate( String artifactString, String type ) throws MojoExecutionException { if ( StringUtils.isEmpty( artifactString ) ) @@ -147,10 +164,8 @@ public abstract class AbstractHelpMojo String groupId; // required String artifactId; // required String version; // optional - String classifier = null; // optional String[] artifactParts = artifactString.split( ":" ); - switch ( artifactParts.length ) { case 2: @@ -163,51 +178,50 @@ public abstract class AbstractHelpMojo artifactId = artifactParts[1]; version = artifactParts[2]; break; - case 4: - groupId = artifactParts[0]; - artifactId = artifactParts[1]; - version = artifactParts[2]; - classifier = artifactParts[3]; - break; default: throw new MojoExecutionException( "The artifact parameter '" + artifactString - + "' should be conform to: " + "'groupId:artifactId[:version][:classifier]'." ); - } - - if ( StringUtils.isNotEmpty( classifier ) ) - { - return artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", classifier ); + + "' should be conform to: " + "'groupId:artifactId[:version]'." ); } + return getArtifactCoordinate( groupId, artifactId, version, type ); + } - return artifactFactory.createArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, "jar" ); + protected ArtifactCoordinate getArtifactCoordinate( String groupId, String artifactId, String version, String type ) + { + DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate(); + coordinate.setGroupId( groupId ); + coordinate.setArtifactId( artifactId ); + coordinate.setVersion( version ); + coordinate.setExtension( type ); + return coordinate; } + /** + * Retrieves the Maven Project associated with the given artifact String, in the form of + * <code>groupId:artifactId[:version]</code>. This resolves the POM artifact at those coordinates and then builds + * the Maven project from it. + * + * @param artifactString Coordinates of the Maven project to get. + * @return New Maven project. + * @throws MojoExecutionException If there was an error while getting the Maven project. + */ protected MavenProject getMavenProject( String artifactString ) throws MojoExecutionException { - Artifact artifactObj = getArtifact( artifactString ); - - if ( Artifact.SCOPE_SYSTEM.equals( artifactObj.getScope() ) ) - { - throw new MojoExecutionException( "System artifact is not be handled." ); - } - - Artifact copyArtifact = ArtifactUtils.copyArtifact( artifactObj ); - if ( !"pom".equals( copyArtifact.getType() ) ) - { - copyArtifact = - artifactFactory.createProjectArtifact( copyArtifact.getGroupId(), copyArtifact.getArtifactId(), - copyArtifact.getVersion(), copyArtifact.getScope() ); - } - + ArtifactCoordinate coordinate = getArtifactCoordinate( artifactString, "pom" ); try { - return mavenProjectBuilder.buildFromRepository( copyArtifact, remoteRepositories, localRepository ); + ProjectBuildingRequest pbr = new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() ); + pbr.setRemoteRepositories( remoteRepositories ); + pbr.setProject( null ); + pbr.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); + pbr.setResolveDependencies( true ); + Artifact artifact = artifactResolver.resolveArtifact( pbr, coordinate ).getArtifact(); + return projectBuilder.build( artifact.getFile(), pbr ).getProject(); } - catch ( ProjectBuildingException e ) + catch ( Exception e ) { throw new MojoExecutionException( "Unable to get the POM for the artifact '" + artifactString - + "'. Verify the artifact parameter." ); + + "'. Verify the artifact parameter.", e ); } } Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java Fri Nov 11 17:13:13 2016 @@ -19,18 +19,11 @@ package org.apache.maven.plugins.help; * under the License. */ -import static org.apache.maven.plugins.help.HelpUtil.LS; - import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.maven.model.Profile; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; @@ -90,17 +83,11 @@ public class ActiveProfilesMojo throw new MojoExecutionException( "Cannot write active profiles to output: " + output, e ); } - if ( getLog().isInfoEnabled() ) - { - getLog().info( "Active profile report written to: " + output ); - } + getLog().info( "Active profile report written to: " + output ); } else { - if ( getLog().isInfoEnabled() ) - { - getLog().info( message ); - } + getLog().info( message ); } } @@ -116,32 +103,9 @@ public class ActiveProfilesMojo */ private void getActiveProfileStatement( MavenProject project, StringBuilder message ) { - Map<String, List<String>> activeProfileIds = new LinkedHashMap<String, List<String>>(); - try - { - activeProfileIds.putAll( getInjectedProfileIds( project ) ); - } - catch ( UnsupportedOperationException uoe ) - { - // Fall back to M2 approach - @SuppressWarnings( "unchecked" ) - List<Profile> profiles = new ArrayList<Profile>( project.getActiveProfiles() ); - - for ( Profile profile : profiles ) - { - List<String> profileIds = activeProfileIds.get( profile.getSource() ); - if ( profileIds == null ) - { - profileIds = new ArrayList<String>(); - activeProfileIds.put( profile.getSource(), profileIds ); - } - profileIds.add( profile.getId() ); - } - } - - + Map<String, List<String>> activeProfileIds = project.getInjectedProfileIds(); + message.append( LS ); - message.append( "Active Profiles for Project \'" ).append( project.getId() ).append( "\':" ); message.append( LS ).append( LS ); @@ -166,34 +130,4 @@ public class ActiveProfilesMojo message.append( LS ); } - @SuppressWarnings( "unchecked" ) - private Map<String, List<String>> getInjectedProfileIds( MavenProject project ) throws UnsupportedOperationException - { - try - { - // This method was introduced with M3 - Method getInjectedProfileIdsMethod = MavenProject.class.getMethod( "getInjectedProfileIds" ); - return (Map<String, List<String>>) getInjectedProfileIdsMethod.invoke( project ); - } - catch ( SecurityException e ) - { - throw new UnsupportedOperationException( e.getMessage(), e ); - } - catch ( NoSuchMethodException e ) - { - throw new UnsupportedOperationException( e.getMessage(), e ); - } - catch ( IllegalArgumentException e ) - { - throw new UnsupportedOperationException( e.getMessage(), e ); - } - catch ( IllegalAccessException e ) - { - throw new UnsupportedOperationException( e.getMessage(), e ); - } - catch ( InvocationTargetException e ) - { - throw new UnsupportedOperationException( e.getMessage(), e ); - } - } } Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java?rev=1769319&r1=1769318&r2=1769319&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java Fri Nov 11 17:13:13 2016 @@ -19,33 +19,22 @@ package org.apache.maven.plugins.help; * under the License. */ -import static org.apache.maven.plugins.help.HelpUtil.LS; - -import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Profile; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.profiles.DefaultMavenProfilesBuilder; -import org.apache.maven.profiles.DefaultProfileManager; -import org.apache.maven.profiles.ProfileManager; -import org.apache.maven.profiles.ProfilesConversionUtils; -import org.apache.maven.profiles.ProfilesRoot; -import org.apache.maven.profiles.activation.ProfileActivationException; import org.apache.maven.project.MavenProject; -import org.apache.maven.settings.Settings; import org.apache.maven.settings.SettingsUtils; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import java.io.File; import java.io.IOException; +import java.util.HashMap; import java.util.List; import java.util.Map; /** * Displays a list of available profiles under the current project. - * <br/> + * <br> * <b>Note</b>: it will list <b>all</b> profiles for a project. If a * profile comes up with a status <b>inactive</b> then there might be a need to * set profile activation switches/property. @@ -69,10 +58,10 @@ public class AllProfilesMojo private List<MavenProject> projects; /** - * The current build session instance. This is used for plugin manager API calls. + * The list of profiles defined in the current Maven settings. */ - @Parameter( defaultValue = "${session}", readonly = true, required = true ) - private MavenSession session; + @Parameter( defaultValue = "${settings.profiles}", readonly = true, required = true ) + private List<org.apache.maven.settings.Profile> settingsProfiles; // ---------------------------------------------------------------------- // Public methods @@ -87,43 +76,19 @@ public class AllProfilesMojo for ( MavenProject project : projects ) { descriptionBuffer.append( "Listing Profiles for Project: " ).append( project.getId() ).append( LS ); - - DefaultProfileManager pm = - new DefaultProfileManager( session.getContainer(), session.getExecutionProperties() ); - - // Obtain Profiles from external profiles.xml - try - { - loadProjectExternalProfiles( pm, project.getBasedir() ); - } - catch ( ProfileActivationException e ) - { - throw new MojoExecutionException( "Error obtaining external Profiles:" + e.getMessage(), e ); - } - - // Attempt to obtain settings profiles - loadSettingsProfiles( pm, session.getSettings() ); - - // Attempt to obtain profiles from pom.xml - loadProjectPomProfiles( pm, project ); + + Map<String, Profile> allProfilesByIds = new HashMap<String, Profile>(); + addSettingsProfiles( allProfilesByIds ); + addProjectPomProfiles( project, allProfilesByIds ); // now display - if ( null == pm.getExplicitlyActivatedIds() || pm.getExplicitlyActivatedIds().size() == 0 ) + if ( allProfilesByIds.isEmpty() ) { - if ( getLog().isWarnEnabled() ) - { - getLog().warn( "No profiles detected!" ); - } + getLog().warn( "No profiles detected!" ); } else { - // This feels more like a hack to filter out inactive profiles, there is no 'direct' - // way to query activation status on a Profile instance. - @SuppressWarnings( "unchecked" ) - Map<String, Profile> allProfilesByIds = pm.getProfilesById(); - // active Profiles will be a subset of *all* profiles - @SuppressWarnings( "unchecked" ) List<Profile> activeProfiles = project.getActiveProfiles(); for ( Profile activeProfile : activeProfiles ) { @@ -161,17 +126,11 @@ public class AllProfilesMojo throw new MojoExecutionException( "Cannot write profiles description to output: " + output, e ); } - if ( getLog().isInfoEnabled() ) - { - getLog().info( "Wrote descriptions to: " + output ); - } + getLog().info( "Wrote descriptions to: " + output ); } else { - if ( getLog().isInfoEnabled() ) - { - getLog().info( descriptionBuffer.toString() ); - } + getLog().info( descriptionBuffer.toString() ); } } @@ -180,132 +139,50 @@ public class AllProfilesMojo // ---------------------------------------------------------------------- /** - * Loads up external Profiles using <code>profiles.xml</code> (if any) located in the current - * project's <code>${basedir}</code>. - * - * @param profileManager ProfileManager instance to use to load profiles from external Profiles. - * @param projectDir location of the current project, could be null. - * @throws ProfileActivationException, if there was an error loading profiles. - */ - private void loadProjectExternalProfiles( ProfileManager profileManager, File projectDir ) - throws ProfileActivationException - { - if ( projectDir == null ) - { - return; - } - - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "Attempting to read profiles from external profiles.xml..." ); - } - - try - { - DefaultMavenProfilesBuilder profilesBuilder = new DefaultMavenProfilesBuilder(); - ProfilesRoot root = profilesBuilder.buildProfiles( projectDir ); - if ( root != null ) - { - List<org.apache.maven.profiles.Profile> profiles = root.getProfiles(); - for ( org.apache.maven.profiles.Profile rawProfile : profiles ) - { - Profile converted = ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile ); - profileManager.addProfile( converted ); - profileManager.explicitlyActivate( converted.getId() ); - } - } - else if ( getLog().isDebugEnabled() ) - { - getLog().debug( "ProfilesRoot was found to be NULL" ); - } - } - catch ( IOException e ) - { - throw new ProfileActivationException( "Cannot read profiles.xml resource from directory: " - + projectDir, e ); - } - catch ( XmlPullParserException e ) - { - throw new ProfileActivationException( "Cannot parse profiles.xml resource from directory: " - + projectDir, e ); - } - } - - /** - * Load profiles from <code>pom.xml</code>. + * Adds the profiles from <code>pom.xml</code> and all of its parents. * - * @param profilesManager not null * @param project could be null + * @param allProfiles Map to add the profiles to. */ - private void loadProjectPomProfiles( ProfileManager profilesManager, MavenProject project ) + private void addProjectPomProfiles( MavenProject project, Map<String, Profile> allProfiles ) { if ( project == null ) { // shouldn't happen as this mojo requires a project - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "No pom.xml found to read Profiles from." ); - } - + getLog().debug( "No pom.xml found to read Profiles from." ); return; } - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "Attempting to read profiles from pom.xml..." ); - } + getLog().debug( "Attempting to read profiles from pom.xml..." ); - // Attempt to obtain the list of profiles from pom.xml - List<Profile> profiles = project.getModel().getProfiles(); - for ( Profile profile : profiles ) + for ( Profile profile : project.getModel().getProfiles() ) { - profilesManager.addProfile( profile ); - profilesManager.explicitlyActivate( profile.getId() ); + allProfiles.put( profile.getId(), profile ); } MavenProject parent = project.getParent(); while ( parent != null ) { - List<Profile> profiles2 = parent.getModel().getProfiles(); - for ( Profile profile : profiles2 ) + for ( Profile profile : parent.getModel().getProfiles() ) { - profilesManager.addProfile( profile ); - profilesManager.explicitlyActivate( profile.getId() ); + allProfiles.put( profile.getId(), profile ); } - parent = parent.getParent(); } } /** - * Load profiles from <code>settings.xml</code>. + * Adds the profiles from <code>settings.xml</code>. * - * @param profileManager not null - * @param settings could be null + * @param allProfiles Map to add the profiles to. */ - private void loadSettingsProfiles( ProfileManager profileManager, Settings settings ) + private void addSettingsProfiles( Map<String, Profile> allProfiles ) { - if ( settings == null ) - { - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "No settings.xml detected." ); - } - - return; - } - - if ( getLog().isDebugEnabled() ) - { - getLog().debug( "Attempting to read profiles from settings.xml..." ); - } - - List<org.apache.maven.settings.Profile> profiles = settings.getProfiles(); - for ( org.apache.maven.settings.Profile rawProfile : profiles ) + getLog().debug( "Attempting to read profiles from settings.xml..." ); + for ( org.apache.maven.settings.Profile settingsProfile : settingsProfiles ) { - Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile ); - profileManager.addProfile( profile ); - profileManager.explicitlyActivate( profile.getId() ); + Profile profile = SettingsUtils.convertFromSettingsProfile( settingsProfile ); + allProfiles.put( profile.getId(), profile ); } } }