Compare commits
29 Commits
maven-plug
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
7fcab60985 | |
|
|
d682b25820 | |
|
|
a7fc242de5 | |
|
|
8d1ba27e95 | |
|
|
f99796ee68 | |
|
|
a3371bc6fb | |
|
|
e564b8d54d | |
|
|
d38ef497bc | |
|
|
92f5eaaa3d | |
|
|
d484f85160 | |
|
|
04684f0fc3 | |
|
|
e44bb78aff | |
|
|
1f70e4ea47 | |
|
|
3ec7f6f61d | |
|
|
bcf94564ba | |
|
|
6fda7882f1 | |
|
|
e430efe682 | |
|
|
e598cdfd30 | |
|
|
053932347f | |
|
|
81eb53a1c5 | |
|
|
49349dee7a | |
|
|
f50e9ebb58 | |
|
|
117eaf66a5 | |
|
|
365f900755 | |
|
|
d49dbb8b79 | |
|
|
89a82c2963 | |
|
|
f223b01735 | |
|
|
2767d04ccb | |
|
|
5e063a0907 |
|
|
@ -0,0 +1 @@
|
||||||
|
asfMavenStdBuild(javaVersions:['8','7'])
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-annotations</artifactId>
|
<artifactId>maven-plugin-annotations</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
@ -264,6 +264,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-plugin-plugin</artifactId>
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
|
<version>3.5</version>
|
||||||
<!-- will use previous maven-plugin-plugin release to build current maven-plugin-plugin as configured in parent -->
|
<!-- will use previous maven-plugin-plugin release to build current maven-plugin-plugin as configured in parent -->
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ under the License.
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<!-- pom properties values not taken into account since invoker defines properties -->
|
||||||
|
<!-- that override what's defined in pom -->
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
@ -70,7 +72,11 @@ under the License.
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.4</version>
|
<version>3.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source><!-- avoid ${maven.compiler.source} since value is not as expected -->
|
||||||
|
<target>1.8</target><!-- avoid ${maven.compiler.target} since value is not as expected -->
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package fr.ca;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface TestInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Java 8 required to support such default method implementation
|
||||||
|
*/
|
||||||
|
public default void foo(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,9 @@ package fr.ca;
|
||||||
|
|
||||||
public interface TestInterface {
|
public interface TestInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Java 8 required to support such default method implementation
|
||||||
|
*/
|
||||||
public default void foo(){
|
public default void foo(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 = clean plugin:report
|
||||||
|
invoker.mavenOpts = -Duser.language=en -Duser.country=US -Duser.variant=US
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.apache.maven.plugins.its.plugin</groupId>
|
||||||
|
<artifactId>report-since</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>maven-plugin</packaging>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven</groupId>
|
||||||
|
<artifactId>maven-plugin-api</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
|
<version>@project.version@</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>@sitePluginVersion@</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<reports>
|
||||||
|
<report>index</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
|
<version>@project.version@</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package org;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.apache.maven.plugin.AbstractMojo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does nothing.
|
||||||
|
*
|
||||||
|
* @goal noop
|
||||||
|
* @phase process-sources
|
||||||
|
* @requiresDependencyResolution test
|
||||||
|
* @requiresDirectInvocation true
|
||||||
|
* @requiresOnline
|
||||||
|
* @inheritByDefault false
|
||||||
|
* @execute phase="compile"
|
||||||
|
* @aggregator
|
||||||
|
* @since 1.0
|
||||||
|
*
|
||||||
|
* @deprecated You don't use test goals, do you?
|
||||||
|
*/
|
||||||
|
public class MyMojo
|
||||||
|
extends AbstractMojo
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a test.
|
||||||
|
*
|
||||||
|
* @parameter
|
||||||
|
* @required
|
||||||
|
*/
|
||||||
|
@SuppressWarnings( "unused" )
|
||||||
|
private String required;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a test.
|
||||||
|
*
|
||||||
|
* @parameter expression="${string}" default-value="${project.version}/</markup-must-be-escaped>"
|
||||||
|
* @deprecated Just testing.
|
||||||
|
* @since 1.1
|
||||||
|
*/
|
||||||
|
@SuppressWarnings( "unused" )
|
||||||
|
private String string;
|
||||||
|
|
||||||
|
public void execute()
|
||||||
|
{
|
||||||
|
// intentional do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
assert new File( basedir, 'target/generated-site' ).exists()
|
||||||
|
|
||||||
|
content = new File( basedir, 'target/generated-site/xdoc/noop-mojo.xml' ).text
|
||||||
|
|
||||||
|
assert content.contains( '<li><strong>Since</strong>: <code>1.0</code></li>' )
|
||||||
|
assert content.contains( '<li><strong>Since</strong>: <code>1.1</code></li>' )
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
@ -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 = process-classes javadoc:javadoc
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.apache.maven.plugins.plugin.its</groupId>
|
||||||
|
<artifactId>mplugin3224</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>maven-plugin</packaging>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
Generation javadoc for private methods should be valid
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven</groupId>
|
||||||
|
<artifactId>maven-plugin-api</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-utils</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
|
<artifactId>maven-plugin-annotations</artifactId>
|
||||||
|
<version>@project.version@</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>3.0.0-M1</version>
|
||||||
|
<configuration>
|
||||||
|
<level>private</level>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-plugin-plugin</artifactId>
|
||||||
|
<version>@project.version@</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-descriptor</id>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>help-goal</id>
|
||||||
|
<goals>
|
||||||
|
<goal>helpmojo</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package test;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.apache.maven.plugin.AbstractMojo;
|
||||||
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
|
||||||
|
* inline link to {@link org.apache.maven.plugin.AbstractMojo}.
|
||||||
|
*
|
||||||
|
* @deprecated As of 1.0, use the "quoted" goal instead.
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
|
@Mojo( name= "test" )
|
||||||
|
public class MyMojo
|
||||||
|
extends AbstractMojo
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
|
||||||
|
* escaped in Java string literals.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
@Parameter( defaultValue = "escape\\backslash" )
|
||||||
|
private String defaultParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This parameter is deprecated.
|
||||||
|
*
|
||||||
|
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
||||||
|
*/
|
||||||
|
@Parameter
|
||||||
|
private String deprecatedParam;
|
||||||
|
|
||||||
|
@Parameter( property = "test.undocumented", required = true )
|
||||||
|
private String undocumentedParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Readonly parameter: should not be proposed for configuration.
|
||||||
|
*/
|
||||||
|
@Parameter( defaultValue = "not for configuration", readonly = true )
|
||||||
|
private String readonly;
|
||||||
|
|
||||||
|
public void execute()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -19,10 +19,24 @@ package org.apache.maven.plugin.plugin;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
|
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
|
||||||
|
import org.apache.maven.artifact.versioning.VersionRange;
|
||||||
import org.apache.maven.doxia.sink.Sink;
|
import org.apache.maven.doxia.sink.Sink;
|
||||||
import org.apache.maven.doxia.siterenderer.Renderer;
|
import org.apache.maven.doxia.siterenderer.Renderer;
|
||||||
|
import org.apache.maven.execution.RuntimeInformation;
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
|
|
@ -33,6 +47,7 @@ import org.apache.maven.plugins.annotations.Execute;
|
||||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
|
import org.apache.maven.plugins.plugin.descriptor.MNG6109PluginDescriptorBuilder;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.apache.maven.reporting.AbstractMavenReport;
|
import org.apache.maven.reporting.AbstractMavenReport;
|
||||||
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
||||||
|
|
@ -50,17 +65,6 @@ import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileReader;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the Plugin's documentation report: <code>plugin-info.html</code> plugin overview page,
|
* Generates the Plugin's documentation report: <code>plugin-info.html</code> plugin overview page,
|
||||||
* and one <code><i>goal</i>-mojo.html</code> per goal.
|
* and one <code><i>goal</i>-mojo.html</code> per goal.
|
||||||
|
|
@ -187,6 +191,12 @@ public class PluginReport
|
||||||
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
||||||
protected ArtifactRepository local;
|
protected ArtifactRepository local;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 3.5.1
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
private RuntimeInformation rtInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
|
@ -250,7 +260,8 @@ public class PluginReport
|
||||||
private PluginDescriptor extractPluginDescriptor()
|
private PluginDescriptor extractPluginDescriptor()
|
||||||
throws MavenReportException
|
throws MavenReportException
|
||||||
{
|
{
|
||||||
PluginDescriptorBuilder builder = new PluginDescriptorBuilder();
|
PluginDescriptorBuilder builder = getPluginDescriptorBuilder();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return builder.build( new FileReader( new File( project.getBuild().getOutputDirectory(),
|
return builder.build( new FileReader( new File( project.getBuild().getOutputDirectory(),
|
||||||
|
|
@ -319,6 +330,38 @@ public class PluginReport
|
||||||
return pluginDescriptor;
|
return pluginDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the
|
||||||
|
* maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix
|
||||||
|
* (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).
|
||||||
|
*
|
||||||
|
* @return the proper pluginDescriptorBuilder
|
||||||
|
* @see https://issues.apache.org/jira/browse/MNG-6109
|
||||||
|
* @see https://issues.apache.org/jira/browse/MPLUGIN-319
|
||||||
|
*/
|
||||||
|
private PluginDescriptorBuilder getPluginDescriptorBuilder()
|
||||||
|
{
|
||||||
|
PluginDescriptorBuilder pluginDescriptorBuilder;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
VersionRange versionRange = VersionRange.createFromVersionSpec( "(3.3.9,)" );
|
||||||
|
if ( versionRange.containsVersion( rtInfo.getApplicationVersion() ) )
|
||||||
|
{
|
||||||
|
pluginDescriptorBuilder = new PluginDescriptorBuilder();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pluginDescriptorBuilder = new MNG6109PluginDescriptorBuilder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( InvalidVersionSpecificationException e )
|
||||||
|
{
|
||||||
|
return new MNG6109PluginDescriptorBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
return pluginDescriptorBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package org.apache.maven.plugins.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.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
|
import org.apache.maven.plugin.descriptor.Parameter;
|
||||||
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
|
||||||
|
import org.codehaus.plexus.configuration.PlexusConfiguration;
|
||||||
|
import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the plugin descriptor and adds the fix for MNG-6109 when using Maven-3.3.9 and before.
|
||||||
|
* Class can be removed once Maven 3.5.0 is the prerequisite for this plugin.
|
||||||
|
*
|
||||||
|
* @author Robert Scholte
|
||||||
|
* @since 3.5.1
|
||||||
|
*/
|
||||||
|
public class MNG6109PluginDescriptorBuilder extends PluginDescriptorBuilder
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MojoDescriptor buildComponentDescriptor( PlexusConfiguration c, PluginDescriptor pluginDescriptor )
|
||||||
|
throws PlexusConfigurationException
|
||||||
|
{
|
||||||
|
MojoDescriptor mojoDescriptor = super.buildComponentDescriptor( c, pluginDescriptor );
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
// Parameters
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
PlexusConfiguration[] parameterConfigurations = c.getChild( "parameters" ).getChildren( "parameter" );
|
||||||
|
|
||||||
|
for ( PlexusConfiguration d : parameterConfigurations )
|
||||||
|
{
|
||||||
|
String parameterName = d.getChild( "name" ).getValue();
|
||||||
|
Parameter pd = (Parameter) mojoDescriptor.getParameterMap().get( parameterName );
|
||||||
|
|
||||||
|
String parameterSince = d.getChild( "since" ).getValue();
|
||||||
|
pd.setSince( parameterSince );
|
||||||
|
}
|
||||||
|
|
||||||
|
return mojoDescriptor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ Using Plugin Tools Java5 Annotations
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-annotations</artifactId>
|
<artifactId>maven-plugin-annotations</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>provided</scope><!-- annotations are needed only to build the plugin -->
|
<optional>true</optional> <!-- annotations are not used at runtime because @Retention(value=CLASS), they are needed only to build the plugin -->
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
...
|
...
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ under the License.
|
||||||
<href>http://maven.apache.org/</href>
|
<href>http://maven.apache.org/</href>
|
||||||
</bannerLeft>
|
</bannerLeft>
|
||||||
<bannerRight>
|
<bannerRight>
|
||||||
<src>http://maven.apache.org/images/maventxt_logo_200.gif</src>
|
<src>https://maven.apache.org/images/maven-logo-black-on-white.png</src>
|
||||||
</bannerRight>
|
</bannerRight>
|
||||||
|
|
||||||
<skin>
|
<skin>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public class TestAnnotationsReader
|
||||||
MojoAnnotationsScanner mojoAnnotationsScanner = (MojoAnnotationsScanner) lookup( MojoAnnotationsScanner.ROLE );
|
MojoAnnotationsScanner mojoAnnotationsScanner = (MojoAnnotationsScanner) lookup( MojoAnnotationsScanner.ROLE );
|
||||||
|
|
||||||
MojoAnnotationsScannerRequest request = new MojoAnnotationsScannerRequest();
|
MojoAnnotationsScannerRequest request = new MojoAnnotationsScannerRequest();
|
||||||
request.setClassesDirectories( Collections.singletonList( new File( "target/test-classes" ) ) );
|
request.setClassesDirectories( Collections.singletonList( new File( getBasedir(), "target/test-classes" ) ) );
|
||||||
request.setIncludePatterns( Arrays.asList( "**/FooMojo.class" ) );
|
request.setIncludePatterns( Arrays.asList( "**/FooMojo.class" ) );
|
||||||
request.setProject( new MavenProject() );
|
request.setProject( new MavenProject() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,17 @@ import static org.easymock.EasyMock.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.codehaus.plexus.logging.Logger;
|
import org.codehaus.plexus.logging.Logger;
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
public class DefaultMojoAnnotationsScannerTest
|
public class DefaultMojoAnnotationsScannerTest
|
||||||
extends TestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
private DefaultMojoAnnotationsScanner scanner = new DefaultMojoAnnotationsScanner();
|
private DefaultMojoAnnotationsScanner scanner = new DefaultMojoAnnotationsScanner();
|
||||||
|
|
||||||
public void testSkipModuleInfoClassInArchive() throws Exception
|
public void testSkipModuleInfoClassInArchive() throws Exception
|
||||||
{
|
{
|
||||||
scanner.scanArchive( new File( "src/test/resources/java9-module.jar"), null, false );
|
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java9-module.jar"), null, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testJava8Annotations() throws Exception
|
public void testJava8Annotations() throws Exception
|
||||||
|
|
@ -42,7 +42,7 @@ public class DefaultMojoAnnotationsScannerTest
|
||||||
expect( logger.isDebugEnabled() ).andReturn( false );
|
expect( logger.isDebugEnabled() ).andReturn( false );
|
||||||
replay( logger );
|
replay( logger );
|
||||||
scanner.enableLogging( logger );
|
scanner.enableLogging( logger );
|
||||||
scanner.scanArchive( new File( "src/test/resources/java8-annotations.jar"), null, false );
|
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java8-annotations.jar"), null, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-api</artifactId>
|
<artifactId>maven-plugin-tools-api</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-generators</artifactId>
|
<artifactId>maven-plugin-tools-generators</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -473,9 +473,9 @@ public class PluginXdocGenerator
|
||||||
{
|
{
|
||||||
Parameter parameter = parameters.next();
|
Parameter parameter = parameters.next();
|
||||||
|
|
||||||
w.startElement( "p" );
|
w.startElement( "h4" );
|
||||||
w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.name_internal", parameter.getName() ) );
|
w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.name_internal", parameter.getName() ) );
|
||||||
w.endElement(); //p
|
w.endElement();
|
||||||
|
|
||||||
if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
|
if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ public class HelpMojo
|
||||||
* @param indentSize The size of each indentation, must not be negative.
|
* @param indentSize The size of each indentation, must not be negative.
|
||||||
* @param lineLength The length of the line, must not be negative.
|
* @param lineLength The length of the line, must not be negative.
|
||||||
* @return The sequence of display lines, never <code>null</code>.
|
* @return The sequence of display lines, never <code>null</code>.
|
||||||
* @throws NegativeArraySizeException if <code>indent < 0</code>
|
* @throws NegativeArraySizeException if <code>indent < 0</code>
|
||||||
*/
|
*/
|
||||||
private static List<String> toLines( String text, int indent, int indentSize, int lineLength )
|
private static List<String> toLines( String text, int indent, int indentSize, int lineLength )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ pluginxdoc.mojodescriptor.inheritedByDefault=Is NOT inherited by default in mult
|
||||||
pluginxdoc.mojodescriptor.parameter.details=Parameter Details
|
pluginxdoc.mojodescriptor.parameter.details=Parameter Details
|
||||||
pluginxdoc.mojodescriptor.parameter.deprecated=<strong>Deprecated.</strong> {0}
|
pluginxdoc.mojodescriptor.parameter.deprecated=<strong>Deprecated.</strong> {0}
|
||||||
pluginxdoc.mojodescriptor.parameter.name=Name
|
pluginxdoc.mojodescriptor.parameter.name=Name
|
||||||
pluginxdoc.mojodescriptor.parameter.name_link=<strong><a href="#{0}">{0}</a></strong>
|
pluginxdoc.mojodescriptor.parameter.name_link=<code><a href="#{0}"><{0}></a></code>
|
||||||
pluginxdoc.mojodescriptor.parameter.name_internal=<strong><a name="{0}">{0}</a>:</strong>
|
pluginxdoc.mojodescriptor.parameter.name_internal=<strong><a name="{0}"><{0}></a></strong>
|
||||||
pluginxdoc.mojodescriptor.parameter.description=Description
|
pluginxdoc.mojodescriptor.parameter.description=Description
|
||||||
pluginxdoc.mojodescriptor.parameter.type=Type
|
pluginxdoc.mojodescriptor.parameter.type=Type
|
||||||
pluginxdoc.mojodescriptor.parameter.since=Since
|
pluginxdoc.mojodescriptor.parameter.since=Since
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ pluginxdoc.mojodescriptor.inheritedByDefault=N'est PAS h\u00e9rit\u00e9 par d\u0
|
||||||
pluginxdoc.mojodescriptor.parameter.details=D\u00e9tails des param\u00e8tres
|
pluginxdoc.mojodescriptor.parameter.details=D\u00e9tails des param\u00e8tres
|
||||||
pluginxdoc.mojodescriptor.parameter.deprecated=<strong>Obsol\u00e8te.</strong> {0}
|
pluginxdoc.mojodescriptor.parameter.deprecated=<strong>Obsol\u00e8te.</strong> {0}
|
||||||
pluginxdoc.mojodescriptor.parameter.name=Nom
|
pluginxdoc.mojodescriptor.parameter.name=Nom
|
||||||
pluginxdoc.mojodescriptor.parameter.name_internal=<strong><a name="{0}">{0}</a> :</strong>
|
|
||||||
pluginxdoc.mojodescriptor.parameter.description=Description
|
pluginxdoc.mojodescriptor.parameter.description=Description
|
||||||
pluginxdoc.mojodescriptor.parameter.type=Type
|
pluginxdoc.mojodescriptor.parameter.type=Type
|
||||||
pluginxdoc.mojodescriptor.parameter.since=Depuis
|
pluginxdoc.mojodescriptor.parameter.since=Depuis
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-java</artifactId>
|
<artifactId>maven-plugin-tools-java</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -233,4 +233,28 @@ public class JavaMojoDescriptorExtractorTest
|
||||||
assertEquals( 1, results.size() );
|
assertEquals( 1, results.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSingleTypeImportWithFullyQualifiedClassName()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
List<MojoDescriptor> results = extract( "MPLUGIN-314" );
|
||||||
|
|
||||||
|
assertEquals( 1, results.size() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testMethodReferenceInEnumConstructor()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
List<MojoDescriptor> results = extract( "MPLUGIN-320" );
|
||||||
|
|
||||||
|
assertNull( results );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testEnumWithRegexPattern()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
List<MojoDescriptor> results = extract( "MPLUGIN-290" );
|
||||||
|
|
||||||
|
assertNull( results );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* 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 java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public enum Test
|
||||||
|
{
|
||||||
|
|
||||||
|
Test( Pattern.compile( "a" ) );
|
||||||
|
|
||||||
|
private Test( Pattern p )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<name></name>
|
||||||
|
<description></description>
|
||||||
|
<groupId></groupId>
|
||||||
|
<artifactId></artifactId>
|
||||||
|
<version></version>
|
||||||
|
<goalPrefix>test</goalPrefix>
|
||||||
|
<isolatedRealm>false</isolatedRealm>
|
||||||
|
<inheritedByDefault>true</inheritedByDefault>
|
||||||
|
<mojos/>
|
||||||
|
<dependencies/>
|
||||||
|
</plugin>
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* 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.apache.maven.artifact.resolver.ArtifactResolver;
|
||||||
|
import org.apache.maven.plugin.AbstractMojo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that using an import and the same fully qualified class name results in a correct requirement role generated.
|
||||||
|
*
|
||||||
|
* @goal test
|
||||||
|
*/
|
||||||
|
public class MyMojo
|
||||||
|
extends AbstractMojo
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @component
|
||||||
|
*/
|
||||||
|
private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
|
||||||
|
|
||||||
|
public void execute()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<name></name>
|
||||||
|
<description></description>
|
||||||
|
<groupId></groupId>
|
||||||
|
<artifactId></artifactId>
|
||||||
|
<version></version>
|
||||||
|
<goalPrefix>test</goalPrefix>
|
||||||
|
<isolatedRealm>false</isolatedRealm>
|
||||||
|
<inheritedByDefault>true</inheritedByDefault>
|
||||||
|
<mojos>
|
||||||
|
<mojo>
|
||||||
|
<goal>test</goal>
|
||||||
|
<description>Tests that using an import and the same fully qualified class name results in a correct requirement role generated.</description>
|
||||||
|
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||||
|
<requiresProject>true</requiresProject>
|
||||||
|
<requiresReports>false</requiresReports>
|
||||||
|
<aggregator>false</aggregator>
|
||||||
|
<requiresOnline>false</requiresOnline>
|
||||||
|
<inheritedByDefault>true</inheritedByDefault>
|
||||||
|
<implementation>MyMojo</implementation>
|
||||||
|
<language>java</language>
|
||||||
|
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||||
|
<executionStrategy>once-per-session</executionStrategy>
|
||||||
|
<threadSafe>false</threadSafe>
|
||||||
|
<parameters/>
|
||||||
|
<requirements>
|
||||||
|
<requirement>
|
||||||
|
<role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
|
||||||
|
<field-name>resolver</field-name>
|
||||||
|
</requirement>
|
||||||
|
</requirements>
|
||||||
|
</mojo>
|
||||||
|
</mojos>
|
||||||
|
<dependencies/>
|
||||||
|
</plugin>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* 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 java.util.function.Supplier;
|
||||||
|
|
||||||
|
public enum Exceptions {
|
||||||
|
NPE(NullPointerException::new),
|
||||||
|
IAE(IllegalArgumentException::new);
|
||||||
|
|
||||||
|
private final Supplier<? extends Exception> supplier;
|
||||||
|
|
||||||
|
<T extends Exception> Exceptions(Supplier<T> supplier) {
|
||||||
|
this.supplier = supplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<name></name>
|
||||||
|
<description></description>
|
||||||
|
<groupId></groupId>
|
||||||
|
<artifactId></artifactId>
|
||||||
|
<version></version>
|
||||||
|
<goalPrefix>test</goalPrefix>
|
||||||
|
<isolatedRealm>false</isolatedRealm>
|
||||||
|
<inheritedByDefault>true</inheritedByDefault>
|
||||||
|
<mojos/>
|
||||||
|
<dependencies/>
|
||||||
|
</plugin>
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-ant</artifactId>
|
<artifactId>maven-plugin-tools-ant</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,16 @@ package org.apache.maven.tools.plugin.extractor.ant;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import junit.framework.TestCase;
|
||||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.plugin.descriptor.Parameter;
|
import org.apache.maven.plugin.descriptor.Parameter;
|
||||||
|
|
@ -29,18 +39,6 @@ import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
|
||||||
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
||||||
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||||
import org.codehaus.plexus.component.repository.ComponentRequirement;
|
import org.codehaus.plexus.component.repository.ComponentRequirement;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
public class AntMojoDescriptorExtractorTest
|
public class AntMojoDescriptorExtractorTest
|
||||||
extends TestCase
|
extends TestCase
|
||||||
|
|
@ -103,34 +101,42 @@ public class AntMojoDescriptorExtractorTest
|
||||||
|
|
||||||
private Map buildTestMap( String resourceDirName )
|
private Map buildTestMap( String resourceDirName )
|
||||||
{
|
{
|
||||||
Map result = new HashMap();
|
try
|
||||||
|
|
||||||
ClassLoader cloader = Thread.currentThread().getContextClassLoader();
|
|
||||||
URL mojosXmlUrl = cloader.getResource( resourceDirName + "/test.mojos.xml" );
|
|
||||||
|
|
||||||
if ( mojosXmlUrl == null )
|
|
||||||
{
|
{
|
||||||
fail( "No classpath resource named: '" + resourceDirName + "/test.mojos.xml' could be found." );
|
Map result = new HashMap();
|
||||||
}
|
|
||||||
|
|
||||||
File mojosXml = new File( StringUtils.replace( mojosXmlUrl.getPath(), "%20", " " ) );
|
ClassLoader cloader = Thread.currentThread().getContextClassLoader();
|
||||||
File dir = mojosXml.getParentFile();
|
URL mojosXmlUrl = cloader.getResource( resourceDirName + "/test.mojos.xml" );
|
||||||
|
|
||||||
Set scripts = new HashSet();
|
if ( mojosXmlUrl == null )
|
||||||
String[] listing = dir.list();
|
|
||||||
for ( int i = 0; listing != null && i < listing.length; i++ )
|
|
||||||
{
|
|
||||||
if ( listing[i].endsWith( ".mojos.xml" ) )
|
|
||||||
{
|
{
|
||||||
File f = new File( dir, listing[i] ).getAbsoluteFile();
|
fail( "No classpath resource named: '" + resourceDirName + "/test.mojos.xml' could be found." );
|
||||||
|
|
||||||
scripts.add( f );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO As of JDK 7, replace with Paths.get( resource.toURI() ).toFile()
|
||||||
|
File mojosXml = new File( mojosXmlUrl.toURI() );
|
||||||
|
File dir = mojosXml.getParentFile();
|
||||||
|
|
||||||
|
Set scripts = new HashSet();
|
||||||
|
String[] listing = dir.list();
|
||||||
|
for ( int i = 0; listing != null && i < listing.length; i++ )
|
||||||
|
{
|
||||||
|
if ( listing[i].endsWith( ".mojos.xml" ) )
|
||||||
|
{
|
||||||
|
File f = new File( dir, listing[i] ).getAbsoluteFile();
|
||||||
|
|
||||||
|
scripts.add( f );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put( dir.getAbsolutePath(), scripts );
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch ( final URISyntaxException e )
|
||||||
|
{
|
||||||
|
throw new AssertionError( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
result.put( dir.getAbsolutePath(), scripts );
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-plugin-tools-model</artifactId>
|
<artifactId>maven-plugin-tools-model</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,9 @@ public class PluginMetadataParser
|
||||||
descriptors.add( descriptor );
|
descriptors.add( descriptor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reader.close();
|
||||||
|
reader = null;
|
||||||
}
|
}
|
||||||
catch ( IOException e )
|
catch ( IOException e )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,16 +19,12 @@ package org.apache.maven.tools.plugin.extractor.model;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
|
||||||
import org.apache.maven.tools.plugin.extractor.model.PluginMetadataParseException;
|
|
||||||
import org.apache.maven.tools.plugin.extractor.model.PluginMetadataParser;
|
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
|
|
||||||
public class PluginMetadataParserTest
|
public class PluginMetadataParserTest
|
||||||
extends TestCase
|
extends TestCase
|
||||||
|
|
@ -62,13 +58,21 @@ public class PluginMetadataParserTest
|
||||||
|
|
||||||
private File getMetadataFile( String name )
|
private File getMetadataFile( String name )
|
||||||
{
|
{
|
||||||
URL resource = Thread.currentThread().getContextClassLoader().getResource( name );
|
try
|
||||||
if ( resource == null )
|
|
||||||
{
|
{
|
||||||
fail( "Cannot find classpath resource: '" + name + "'." );
|
URL resource = Thread.currentThread().getContextClassLoader().getResource( name );
|
||||||
}
|
if ( resource == null )
|
||||||
|
{
|
||||||
|
fail( "Cannot find classpath resource: '" + name + "'." );
|
||||||
|
}
|
||||||
|
|
||||||
return new File( StringUtils.replace( resource.getPath(), "%20", " " ) );
|
// TODO As of JDK 7, replace with Paths.get( resource.toURI() ).toFile()
|
||||||
|
return new File( resource.toURI() );
|
||||||
|
}
|
||||||
|
catch ( final URISyntaxException e )
|
||||||
|
{
|
||||||
|
throw new AssertionError( e );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ under the License.
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-script-ant</artifactId>
|
<artifactId>maven-script-ant</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,6 @@ package org.apache.maven.script.ant;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import static org.easymock.EasyMock.createMock;
|
|
||||||
import static org.easymock.EasyMock.expect;
|
|
||||||
import static org.easymock.EasyMock.replay;
|
|
||||||
import static org.easymock.EasyMock.verify;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -29,13 +25,14 @@ import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import junit.framework.TestCase;
|
||||||
import org.apache.maven.artifact.Artifact;
|
import org.apache.maven.artifact.Artifact;
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.model.Build;
|
import org.apache.maven.model.Build;
|
||||||
|
|
@ -59,9 +56,10 @@ import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||||
import org.codehaus.plexus.logging.Logger;
|
import org.codehaus.plexus.logging.Logger;
|
||||||
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
||||||
import org.codehaus.plexus.util.IOUtil;
|
import org.codehaus.plexus.util.IOUtil;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import static org.easymock.EasyMock.createMock;
|
||||||
|
import static org.easymock.EasyMock.expect;
|
||||||
import junit.framework.TestCase;
|
import static org.easymock.EasyMock.replay;
|
||||||
|
import static org.easymock.EasyMock.verify;
|
||||||
|
|
||||||
public class AntMojoWrapperTest
|
public class AntMojoWrapperTest
|
||||||
extends TestCase
|
extends TestCase
|
||||||
|
|
@ -69,7 +67,7 @@ public class AntMojoWrapperTest
|
||||||
|
|
||||||
public void test2xStylePlugin()
|
public void test2xStylePlugin()
|
||||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||||
ComponentConfigurationException, ArchiverException
|
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||||
{
|
{
|
||||||
String pluginXml = "META-INF/maven/plugin-2.1.xml";
|
String pluginXml = "META-INF/maven/plugin-2.1.xml";
|
||||||
|
|
||||||
|
|
@ -89,7 +87,7 @@ public class AntMojoWrapperTest
|
||||||
|
|
||||||
public void test20StylePlugin()
|
public void test20StylePlugin()
|
||||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||||
ComponentConfigurationException, ArchiverException
|
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||||
{
|
{
|
||||||
String pluginXml = "META-INF/maven/plugin-2.0.xml";
|
String pluginXml = "META-INF/maven/plugin-2.0.xml";
|
||||||
|
|
||||||
|
|
@ -128,7 +126,7 @@ public class AntMojoWrapperTest
|
||||||
|
|
||||||
private List<String> run( String pluginXml, boolean includeImplied )
|
private List<String> run( String pluginXml, boolean includeImplied )
|
||||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||||
ComponentConfigurationException, ArchiverException
|
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||||
{
|
{
|
||||||
StackTraceElement stack = new Throwable().getStackTrace()[1];
|
StackTraceElement stack = new Throwable().getStackTrace()[1];
|
||||||
System.out.println( "\n\nRunning: " + stack.getMethodName() + "\n\n" );
|
System.out.println( "\n\nRunning: " + stack.getMethodName() + "\n\n" );
|
||||||
|
|
@ -146,6 +144,8 @@ public class AntMojoWrapperTest
|
||||||
{
|
{
|
||||||
reader = new InputStreamReader( resource.openStream() );
|
reader = new InputStreamReader( resource.openStream() );
|
||||||
pd = new PluginDescriptorBuilder().build( reader, pluginXml );
|
pd = new PluginDescriptorBuilder().build( reader, pluginXml );
|
||||||
|
reader.close();
|
||||||
|
reader = null;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -168,7 +168,8 @@ public class AntMojoWrapperTest
|
||||||
|
|
||||||
if ( includeImplied )
|
if ( includeImplied )
|
||||||
{
|
{
|
||||||
File pluginXmlFile = new File( StringUtils.replace( resource.getPath(), "%20", " " ) );
|
// TODO As of JDK 7, replace with Paths.get( resource.toURI() ).toFile()
|
||||||
|
File pluginXmlFile = new File( resource.toURI() );
|
||||||
|
|
||||||
File jarFile = File.createTempFile( "AntMojoWrapperTest.", ".test.jar" );
|
File jarFile = File.createTempFile( "AntMojoWrapperTest.", ".test.jar" );
|
||||||
jarFile.deleteOnExit();
|
jarFile.deleteOnExit();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ under the License.
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-script-beanshell</artifactId>
|
<artifactId>maven-script-beanshell</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ under the License.
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>maven-script</artifactId>
|
<artifactId>maven-script</artifactId>
|
||||||
|
|
|
||||||
68
pom.xml
68
pom.xml
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||||
<artifactId>maven-plugin-tools</artifactId>
|
<artifactId>maven-plugin-tools</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>Maven Plugin Tools</name>
|
<name>Maven Plugin Tools</name>
|
||||||
|
|
@ -74,9 +74,10 @@
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugin-tools/tags/maven-plugin-tools-3.5</connection>
|
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-plugin-tools.git</connection>
|
||||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugin-tools/tags/maven-plugin-tools-3.5</developerConnection>
|
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-plugin-tools.git</developerConnection>
|
||||||
<url>http://svn.apache.org/viewvc/maven/plugin-tools/tags/maven-plugin-tools-3.5</url>
|
<url>https://github.com/apache/maven-plugin-tools/tree/${project.scm.tag}</url>
|
||||||
|
<tag>HEAD</tag>
|
||||||
</scm>
|
</scm>
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>jira</system>
|
<system>jira</system>
|
||||||
|
|
@ -97,7 +98,7 @@
|
||||||
<pluginTestingHarnessVersion>1.2</pluginTestingHarnessVersion>
|
<pluginTestingHarnessVersion>1.2</pluginTestingHarnessVersion>
|
||||||
<mavenVersion>2.2.1</mavenVersion>
|
<mavenVersion>2.2.1</mavenVersion>
|
||||||
<antVersion>1.7.1</antVersion>
|
<antVersion>1.7.1</antVersion>
|
||||||
<mavenInvokerPluginVersion>1.10</mavenInvokerPluginVersion>
|
<mavenInvokerPluginVersion>3.0.1</mavenInvokerPluginVersion>
|
||||||
<maven.site.path>plugin-tools-archives/plugin-tools-LATEST</maven.site.path>
|
<maven.site.path>plugin-tools-archives/plugin-tools-LATEST</maven.site.path>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
@ -214,7 +215,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.thoughtworks.qdox</groupId>
|
<groupId>com.thoughtworks.qdox</groupId>
|
||||||
<artifactId>qdox</artifactId>
|
<artifactId>qdox</artifactId>
|
||||||
<version>2.0-M4</version>
|
<version>2.0-M5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
@ -398,33 +399,34 @@
|
||||||
<activation>
|
<activation>
|
||||||
<jdk>[1.9,)</jdk>
|
<jdk>[1.9,)</jdk>
|
||||||
</activation>
|
</activation>
|
||||||
<!-- chicken-egg problem. Can only be built with Java9 once maven-plugin-plugin 3.5 is available -->
|
<build>
|
||||||
<!-- <build> -->
|
<plugins>
|
||||||
<!-- <plugins> -->
|
<plugin>
|
||||||
<!-- <plugin> -->
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<!-- <artifactId>maven-enforcer-plugin</artifactId> -->
|
<executions>
|
||||||
<!-- <executions> -->
|
<execution>
|
||||||
<!-- <execution> -->
|
<id>enforce-bytecode-version</id>
|
||||||
<!-- <id>enforce-bytecode-version</id> -->
|
<configuration>
|
||||||
<!-- <configuration> -->
|
<rules>
|
||||||
<!-- <rules> -->
|
<enforceBytecodeVersion>
|
||||||
<!-- <enforceBytecodeVersion> -->
|
<ignoreClasses>
|
||||||
<!-- <maxJdkVersion>1.9</maxJdkVersion> -->
|
<ignoreClass>module-info</ignoreClass>
|
||||||
<!-- </enforceBytecodeVersion> -->
|
</ignoreClasses>
|
||||||
<!-- </rules> -->
|
</enforceBytecodeVersion>
|
||||||
<!-- </configuration> -->
|
</rules>
|
||||||
<!-- </execution> -->
|
</configuration>
|
||||||
<!-- </executions> -->
|
</execution>
|
||||||
<!-- <dependencies> -->
|
</executions>
|
||||||
<!-- <dependency> -->
|
<dependencies>
|
||||||
<!-- <groupId>org.codehaus.mojo</groupId> -->
|
<dependency>
|
||||||
<!-- <artifactId>extra-enforcer-rules</artifactId> -->
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<!-- <version>1.0-beta-5</version> -->
|
<artifactId>extra-enforcer-rules</artifactId>
|
||||||
<!-- </dependency> -->
|
<version>1.0-beta-5</version>
|
||||||
<!-- </dependencies> -->
|
</dependency>
|
||||||
<!-- </plugin> -->
|
</dependencies>
|
||||||
<!-- </plugins> -->
|
</plugin>
|
||||||
<!-- </build> -->
|
</plugins>
|
||||||
|
</build>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ under the License.
|
||||||
<href>https://maven.apache.org/</href>
|
<href>https://maven.apache.org/</href>
|
||||||
</bannerLeft>
|
</bannerLeft>
|
||||||
<bannerRight>
|
<bannerRight>
|
||||||
<src>https://maven.apache.org/images/maventxt_logo_200.gif</src>
|
<src>https://maven.apache.org/images/maven-logo-black-on-white.png</src>
|
||||||
</bannerRight>
|
</bannerRight>
|
||||||
|
|
||||||
<skin>
|
<skin>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue