Compare commits
67 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 | |
|
|
4bd90ea35f | |
|
|
4ac5b187dc | |
|
|
3aaa8d275c | |
|
|
e0fe0f017f | |
|
|
176760d3f9 | |
|
|
197e306311 | |
|
|
79490bad16 | |
|
|
52c7bcc7c0 | |
|
|
15180d93b0 | |
|
|
c20a5f300b | |
|
|
f0d7f725a4 | |
|
|
629dd38f3d | |
|
|
ec99a5982d | |
|
|
6992f7719b | |
|
|
9963ca473d | |
|
|
dacb6e6b6d | |
|
|
9a7fd1e70d | |
|
|
34920f0a2c | |
|
|
7c58d51900 | |
|
|
372526b052 | |
|
|
22fcf70b89 | |
|
|
a44d4f1719 | |
|
|
7dd7d23ebf | |
|
|
250f72677d | |
|
|
8fd7093a5c | |
|
|
1525c61b93 | |
|
|
51a8d562ad | |
|
|
7b952b87a3 | |
|
|
547e3868c7 | |
|
|
257e61a72e | |
|
|
e982dbf1c6 | |
|
|
6edd624afc | |
|
|
cc006dbd8e | |
|
|
0fec67e0eb | |
|
|
4b16f1d883 | |
|
|
267e446889 | |
|
|
e3b6db6b40 | |
|
|
45a627148b |
|
|
@ -0,0 +1 @@
|
|||
asfMavenStdBuild(javaVersions:['8','7'])
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
@ -74,7 +74,10 @@
|
|||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<!-- from stricter view, should use ${mavenPluginToolsVersion} but this is causing problems with release plugin -->
|
||||
<!--version>${mavenPluginToolsVersion}</version-->
|
||||
<scope>provided</scope>
|
||||
<!--
|
||||
Do not use 'provided' scope here. The annotations are a transitive dependency of
|
||||
'maven-plugin-tools-annotations' which fails to load at runtime when not available.
|
||||
-->
|
||||
</dependency>
|
||||
|
||||
<!-- doxia -->
|
||||
|
|
@ -164,6 +167,13 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- other -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
|
|
@ -187,16 +197,17 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/filtered-resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration><!-- TODO remove when upgrading parent pom -->
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
|
|
@ -253,6 +264,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<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 -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
@ -360,6 +372,10 @@
|
|||
<sitePluginVersion>3.3</sitePluginVersion>
|
||||
<antVersion>${antVersion}</antVersion>
|
||||
</filterProperties>
|
||||
<properties>
|
||||
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
|
||||
</properties>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
@ -388,7 +404,7 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
|
||||
<!-- see https://issues.apache.org/jira/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ under the License.
|
|||
|
||||
<properties>
|
||||
<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.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
|
@ -70,7 +72,11 @@ under the License.
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<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>
|
||||
</plugins>
|
||||
</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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +1,47 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +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 = clean plugin:report -DskipTests
|
||||
# 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 -DskipTests
|
||||
|
|
|
|||
|
|
@ -1,45 +1,45 @@
|
|||
<?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>mplugin-187</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<description>Verify that plugin:report succeeds</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<?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>mplugin-187</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<description>Verify that plugin:report succeeds</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,18 +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 = clean compile plugin:report
|
||||
# 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 compile plugin:report
|
||||
|
|
|
|||
|
|
@ -1,81 +1,81 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*/
|
||||
@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
*/
|
||||
@Parameter(defaultValue = "${project.build.directory}", required = true)
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*/
|
||||
@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
*/
|
||||
@Parameter(defaultValue = "${project.build.directory}", required = true)
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +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.
|
||||
*/
|
||||
|
||||
File pluginInfo = new File( basedir, "target/site/plugin-info.html" );
|
||||
assert pluginInfo.isFile()
|
||||
|
||||
File touchMojo = new File( basedir, "target/generated-site/xdoc/touch-mojo.xml" );
|
||||
assert touchMojo.isFile()
|
||||
|
||||
return true;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File pluginInfo = new File( basedir, "target/site/plugin-info.html" );
|
||||
assert pluginInfo.isFile()
|
||||
|
||||
File touchMojo = new File( basedir, "target/generated-site/xdoc/touch-mojo.xml" );
|
||||
assert touchMojo.isFile()
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,19 +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.java.version = 1.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.
|
||||
|
||||
invoker.java.version = 1.8+
|
||||
invoker.goals.1 = clean verify
|
||||
|
|
@ -1,37 +1,37 @@
|
|||
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.
|
||||
*/
|
||||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
|
||||
/**
|
||||
* Created by clement.agarini on 04/08/14.
|
||||
*/
|
||||
@Mojo(name="test-plugin",defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||
public class MyMojo extends AbstractMojo {
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||
|
||||
}
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
|
||||
/**
|
||||
* Created by clement.agarini on 04/08/14.
|
||||
*/
|
||||
@Mojo(name="test-plugin",defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||
public class MyMojo extends AbstractMojo {
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +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 {
|
||||
|
||||
public default void foo(){
|
||||
|
||||
}
|
||||
}
|
||||
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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
invoker.maven.version = 3.0+
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<?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.its.plugin</groupId>
|
||||
<artifactId>help</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>
|
||||
Tests generation and compilation of the help mojo.
|
||||
</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>
|
||||
</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,37 @@
|
|||
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( name= "test" )
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
@Parameter
|
||||
private String empyAnnotatedParameter;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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.
|
||||
|
||||
detail = true
|
||||
goal = test
|
||||
|
|
@ -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.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<?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>mplugin305</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<url>https://issues.apache.org/jira/browse/MPLUGIN-305</url>
|
||||
|
||||
<properties>
|
||||
<mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<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-plugin-plugin</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<configuration>
|
||||
<extractors>
|
||||
<extractor>java-annotations</extractor>
|
||||
</extractors>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.surefire.suite.RunResult;
|
||||
|
||||
@Mojo(name="custom-surefire")
|
||||
public class CustomSurefireMojo extends AbstractSurefireMojo {
|
||||
|
||||
public File getBasedir()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDebugForkedProcess()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public Boolean getFailIfNoSpecifiedTests()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getForkedProcessTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutForcedInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getReportFormat()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getReportsDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getShutdown()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getSkipAfterFailureCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTest()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getTestClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isPrintSummary()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkip()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipExec()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipTests()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseFile()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseManifestOnlyJar()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseSystemClassLoader()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setBasedir( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setDebugForkedProcess( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setFailIfNoSpecifiedTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setForkedProcessTimeoutInSeconds( int arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutForcedInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setPrintSummary( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportFormat( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportsDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkip( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipExec( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTest( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTestClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseFile( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseManifestOnlyJar( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseSystemClassLoader( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getDefaultIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getExcludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getIncludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPluginName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRerunFailingTestsCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRunOrder()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File[] getSuiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleSummary( RunResult arg0, Exception arg1 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSuiteXmlFiles()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSkipExecution()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIncludes( List<String> arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunOrder( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuiteXmlFiles( File[] arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<File> suiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
assert pluginDescriptor.mojos.mojo.size() == 1
|
||||
assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 50
|
||||
|
||||
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.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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>mplugin305</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<url>https://issues.apache.org/jira/browse/MPLUGIN-305</url>
|
||||
|
||||
<properties>
|
||||
<mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<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-plugin-plugin</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<configuration>
|
||||
<extractors>
|
||||
<extractor>java-annotations</extractor>
|
||||
</extractors>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<mojoDependencies/>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.surefire.suite.RunResult;
|
||||
|
||||
@Mojo(name="custom-surefire")
|
||||
public class CustomSurefireMojo extends AbstractSurefireMojo {
|
||||
|
||||
public File getBasedir()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDebugForkedProcess()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public Boolean getFailIfNoSpecifiedTests()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getForkedProcessTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutForcedInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getReportFormat()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getReportsDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getShutdown()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getSkipAfterFailureCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTest()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getTestClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isPrintSummary()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkip()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipExec()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipTests()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseFile()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseManifestOnlyJar()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseSystemClassLoader()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setBasedir( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setDebugForkedProcess( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setFailIfNoSpecifiedTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setForkedProcessTimeoutInSeconds( int arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutForcedInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setPrintSummary( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportFormat( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportsDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkip( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipExec( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTest( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTestClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseFile( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseManifestOnlyJar( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseSystemClassLoader( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getDefaultIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getExcludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getIncludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPluginName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRerunFailingTestsCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRunOrder()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File[] getSuiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleSummary( RunResult arg0, Exception arg1 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSuiteXmlFiles()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSkipExecution()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIncludes( List<String> arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunOrder( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuiteXmlFiles( File[] arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<File> suiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
assert pluginDescriptor.mojos.mojo.size() == 1
|
||||
assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 0
|
||||
|
||||
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.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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>mplugin305</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<url>https://issues.apache.org/jira/browse/MPLUGIN-305</url>
|
||||
|
||||
<properties>
|
||||
<mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<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-plugin-plugin</artifactId>
|
||||
<version>${mavenPluginPluginVersion}</version>
|
||||
<configuration>
|
||||
<extractors>
|
||||
<extractor>java-annotations</extractor>
|
||||
</extractors>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
<mojoDependencies>
|
||||
<mojoDependency>org.apache.maven.surefire:maven-surefire-common</mojoDependency>
|
||||
</mojoDependencies>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.surefire.suite.RunResult;
|
||||
|
||||
@Mojo(name="custom-surefire")
|
||||
public class CustomSurefireMojo extends AbstractSurefireMojo {
|
||||
|
||||
public File getBasedir()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDebugForkedProcess()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public Boolean getFailIfNoSpecifiedTests()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getForkedProcessTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutForcedInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double getParallelTestsTimeoutInSeconds()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getReportFormat()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getReportsDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getShutdown()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getSkipAfterFailureCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTest()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public File getTestClassesDirectory()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isPrintSummary()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkip()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipExec()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSkipTests()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseFile()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseManifestOnlyJar()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseSystemClassLoader()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setBasedir( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setDebugForkedProcess( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setFailIfNoSpecifiedTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setForkedProcessTimeoutInSeconds( int arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutForcedInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setParallelTestsTimeoutInSeconds( double arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setPrintSummary( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportFormat( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setReportsDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkip( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipExec( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setSkipTests( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTest( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setTestClassesDirectory( File arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseFile( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseManifestOnlyJar( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
public void setUseSystemClassLoader( boolean arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getDefaultIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getExcludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getIncludes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getIncludesFile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPluginName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRerunFailingTestsCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRunOrder()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File[] getSuiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleSummary( RunResult arg0, Exception arg1 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasSuiteXmlFiles()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSkipExecution()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIncludes( List<String> arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRunOrder( String arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuiteXmlFiles( File[] arg0 )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<File> suiteXmlFiles()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert descriptorFile.isFile()
|
||||
|
||||
def pluginDescriptor = new XmlParser().parse( descriptorFile );
|
||||
|
||||
assert pluginDescriptor.mojos.mojo.size() == 1
|
||||
assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 50
|
||||
|
||||
return true;
|
||||
|
|
@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
package org.apache.maven.plugins.issues.plugin;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*
|
||||
* @goal touch
|
||||
*
|
||||
* @phase process-sources
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
* @parameter expression="${project.build.directory}"
|
||||
* @required
|
||||
*/
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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>target bytecode defined by plugin configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix></goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
package org.apache.maven.plugins.issues.plugin;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*
|
||||
* @goal touch
|
||||
*
|
||||
* @phase process-sources
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
* @parameter expression="${project.build.directory}"
|
||||
* @required
|
||||
*/
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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>target bytecode defined by pluginManagement configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>pluginManagement</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>Management</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -59,6 +59,9 @@ under the License.
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipDescriptor>true</skipDescriptor>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
package org.apache.maven.plugins.issues.plugin;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*
|
||||
* @goal touch
|
||||
*
|
||||
* @phase process-sources
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
* @parameter expression="${project.build.directory}"
|
||||
* @required
|
||||
*/
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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>target bytecode defined by maven.compiler.target property</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>property</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>property</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
package org.apache.maven.plugins.issues.plugin;
|
||||
|
||||
/*
|
||||
* 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.plugin.MojoExecutionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*
|
||||
* @goal touch
|
||||
*
|
||||
* @phase process-sources
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
* @parameter expression="${project.build.directory}"
|
||||
* @required
|
||||
*/
|
||||
private File outputDirectory;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
File f = outputDirectory;
|
||||
|
||||
if ( !f.exists() )
|
||||
{
|
||||
f.mkdirs();
|
||||
}
|
||||
|
||||
File touch = new File( f, "touch.txt" );
|
||||
|
||||
FileWriter w = null;
|
||||
try
|
||||
{
|
||||
w = new FileWriter( touch );
|
||||
|
||||
w.write( "touch.txt" );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Error creating file " + touch, e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( w != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
w.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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>target bytecode defined by report jdk requirement configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>requirement</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>requirement</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -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.
|
||||
maven.compiler.source=1.3
|
||||
maven.compiler.target=1.3
|
||||
|
|
@ -62,6 +62,16 @@ under the License.
|
|||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<!-- old maven-parent, so fix it like this. -->
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,19 +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 = install -DskipTests
|
||||
# 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 = install -DskipTests
|
||||
invoker.mavenOpts = -Dmaven.plugin.skip=true
|
||||
|
|
@ -1,23 +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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert !descriptorFile.isFile()
|
||||
|
||||
return true;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert !descriptorFile.isFile()
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<component-set>
|
||||
<components>
|
||||
<!--
|
||||
| MAVEN PLUGIN
|
||||
|-->
|
||||
<component>
|
||||
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
|
||||
<role-hint>maven-plugin</role-hint>
|
||||
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
|
||||
<configuration>
|
||||
<type>maven-plugin</type>
|
||||
<extension>jar</extension>
|
||||
<language>java</language>
|
||||
<addedToClasspath>true</addedToClasspath>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
<!--
|
||||
| Defining the phases with their appropriate plugins
|
||||
! and versions which will be executed during the 'default'
|
||||
! life cycle.
|
||||
-->
|
||||
<!--
|
||||
| MAVEN PLUGIN
|
||||
|-->
|
||||
<component>
|
||||
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
|
||||
<role-hint>maven-plugin</role-hint>
|
||||
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
|
||||
<configuration>
|
||||
<lifecycles>
|
||||
<lifecycle>
|
||||
<id>default</id>
|
||||
<!-- START SNIPPET: maven-plugin-lifecycle -->
|
||||
<phases>
|
||||
<process-resources>
|
||||
org.apache.maven.plugins:maven-resources-plugin:3.0.1:resources
|
||||
</process-resources>
|
||||
<compile>
|
||||
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
|
||||
</compile>
|
||||
<process-classes>
|
||||
org.apache.maven.plugins:maven-plugin-plugin:${project.version}:descriptor
|
||||
</process-classes>
|
||||
<process-test-resources>
|
||||
org.apache.maven.plugins:maven-resources-plugin:3.0.1:testResources
|
||||
</process-test-resources>
|
||||
<test-compile>
|
||||
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
|
||||
</test-compile>
|
||||
<test>
|
||||
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test
|
||||
</test>
|
||||
<package>
|
||||
org.apache.maven.plugins:maven-jar-plugin:3.0.2:jar,
|
||||
org.apache.maven.plugins:maven-plugin-plugin:${project.version}:addPluginArtifactMetadata
|
||||
</package>
|
||||
<install>
|
||||
org.apache.maven.plugins:maven-install-plugin:2.5.2:install
|
||||
</install>
|
||||
<deploy>
|
||||
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
|
||||
</deploy>
|
||||
</phases>
|
||||
<!-- END SNIPPET: maven-plugin-lifecycle -->
|
||||
</lifecycle>
|
||||
</lifecycles>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
</components>
|
||||
</component-set>
|
||||
|
|
@ -21,6 +21,8 @@ package org.apache.maven.plugin.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||
import org.apache.maven.artifact.resolver.filter.IncludesArtifactFilter;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||
|
|
@ -40,6 +42,7 @@ import org.codehaus.plexus.util.ReaderFactory;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -129,6 +132,16 @@ public abstract class AbstractGeneratorMojo
|
|||
*/
|
||||
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||
protected Set<Artifact> dependencies;
|
||||
|
||||
/**
|
||||
* Specify the dependencies as {@code groupId:artifactId} containing (abstract) Mojos.
|
||||
* If not specified in the configuration, this is {@code null} and all dependencies are scanned.
|
||||
* If specified with no children, no dependencies are scanned.
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
@Parameter
|
||||
private List<String> mojoDependencies;
|
||||
|
||||
/**
|
||||
* List of Remote Repositories used by the resolver
|
||||
|
|
@ -223,13 +236,38 @@ public abstract class AbstractGeneratorMojo
|
|||
if ( encoding == null || encoding.length() < 1 )
|
||||
{
|
||||
getLog().warn( "Using platform encoding (" + ReaderFactory.FILE_ENCODING
|
||||
+ " actually) to read mojo metadata, i.e. build is platform dependent!" );
|
||||
+ " actually) to read mojo source files, i.e. build is platform dependent!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
getLog().info( "Using '" + encoding + "' encoding to read mojo metadata." );
|
||||
getLog().info( "Using '" + encoding + "' encoding to read mojo source files." );
|
||||
}
|
||||
|
||||
Set<Artifact> requestDependencies;
|
||||
if ( mojoDependencies == null )
|
||||
{
|
||||
requestDependencies = dependencies;
|
||||
}
|
||||
else if ( mojoDependencies == null )
|
||||
{
|
||||
requestDependencies = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestDependencies = new LinkedHashSet<Artifact>();
|
||||
|
||||
ArtifactFilter filter = new IncludesArtifactFilter( mojoDependencies );
|
||||
|
||||
for ( Artifact artifact : dependencies )
|
||||
{
|
||||
if ( filter.include( artifact ) )
|
||||
{
|
||||
requestDependencies.add( artifact );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||
|
|
@ -238,7 +276,7 @@ public abstract class AbstractGeneratorMojo
|
|||
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
|
||||
request.setEncoding( encoding );
|
||||
request.setSkipErrorNoDescriptorsFound( skipErrorNoDescriptorsFound );
|
||||
request.setDependencies( dependencies );
|
||||
request.setDependencies( requestDependencies );
|
||||
request.setLocal( this.local );
|
||||
request.setRemoteRepos( this.remoteRepos );
|
||||
|
||||
|
|
|
|||
|
|
@ -19,19 +19,35 @@ package org.apache.maven.plugin.plugin;
|
|||
* 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.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.siterenderer.Renderer;
|
||||
import org.apache.maven.execution.RuntimeInformation;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
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.reporting.AbstractMavenReport;
|
||||
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
||||
|
|
@ -45,18 +61,10 @@ import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
|||
import org.apache.maven.tools.plugin.scanner.MojoScanner;
|
||||
import org.apache.maven.tools.plugin.util.PluginUtils;
|
||||
import org.codehaus.plexus.component.repository.ComponentDependency;
|
||||
import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
|
||||
import java.io.File;
|
||||
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,
|
||||
* and one <code><i>goal</i>-mojo.html</code> per goal.
|
||||
|
|
@ -182,6 +190,12 @@ public class PluginReport
|
|||
*/
|
||||
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
||||
protected ArtifactRepository local;
|
||||
|
||||
/**
|
||||
* @since 3.5.1
|
||||
*/
|
||||
@Component
|
||||
private RuntimeInformation rtInfo;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
|
@ -246,6 +260,22 @@ public class PluginReport
|
|||
private PluginDescriptor extractPluginDescriptor()
|
||||
throws MavenReportException
|
||||
{
|
||||
PluginDescriptorBuilder builder = getPluginDescriptorBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
return builder.build( new FileReader( new File( project.getBuild().getOutputDirectory(),
|
||||
"META-INF/maven/plugin.xml" ) ) );
|
||||
}
|
||||
catch ( FileNotFoundException e )
|
||||
{
|
||||
getLog().debug( "Failed to read META-INF/maven/plugin.xml, fall back to mojoScanner" );
|
||||
}
|
||||
catch ( PlexusConfigurationException e )
|
||||
{
|
||||
getLog().debug( "Failed to read META-INF/maven/plugin.xml, fall back to mojoScanner" );
|
||||
}
|
||||
|
||||
// Copy from AbstractGeneratorMojo#execute()
|
||||
String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( project.getArtifactId() );
|
||||
if ( goalPrefix == null )
|
||||
|
|
@ -300,6 +330,38 @@ public class PluginReport
|
|||
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}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,16 +24,18 @@
|
|||
~~ under the License.
|
||||
|
||||
~~ NOTE: For help with the syntax of this file, see:
|
||||
~~ http://maven.apache.org/doxia/references/apt-format.html
|
||||
~~ https://maven.apache.org/doxia/references/apt-format.html
|
||||
|
||||
Using Plugin Tools Java5 Annotations
|
||||
|
||||
Since version 3.0, you can use Java5 annotations to generate the plugin descriptor file.
|
||||
Since version 3.0 of the maven-plugin-plugin, you can use Java5 annotations to generate the
|
||||
plugin descriptor file.
|
||||
|
||||
<<NOTE>> With annotations, your Mojo super class does not any more require to be in the same project. Provided that the super class also uses annotations, it
|
||||
can now come from reactor projects or external dependencies. As javadoc doclet are still useful for <<<@since>>>, <<<@deprecated>>> and comments,
|
||||
the sources are still scanned. So if you use an external dependency, you must still provide an artifact with sources (<<<sources>>> classifier) to
|
||||
provide documentation (the tooling will skip error if this artifact sources is missing).
|
||||
can now come from reactor projects or external dependencies. By default all dependencies are scanned, but this can be reduced with the <<<mojoDependencies>>>
|
||||
parameter. As javadoc doclet are still useful for <<<@since>>>, <<<@deprecated>>> and comments, the sources are still scanned. So if you use an external
|
||||
dependency, you must still provide an artifact with sources (<<<sources>>> classifier) to provide documentation (the tooling will skip error if this artifact
|
||||
sources is missing).
|
||||
|
||||
* Annotations
|
||||
|
||||
|
|
@ -92,7 +94,7 @@ Using Plugin Tools Java5 Annotations
|
|||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<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>
|
||||
</dependencies>
|
||||
...
|
||||
|
|
@ -145,7 +147,7 @@ Using Plugin Tools Java5 Annotations
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
|
||||
<!-- see https://issues.apache.org/jira/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ under the License.
|
|||
<href>http://maven.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<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>
|
||||
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>1.5</version>
|
||||
</skin>
|
||||
|
||||
<custom>
|
||||
|
|
@ -53,7 +53,7 @@ under the License.
|
|||
<item name="Usage" href="usage.html"/>
|
||||
<item name="FAQ" href="faq.html"/>
|
||||
<item name="Release Notes" href="jira-report.html"/>
|
||||
<!-- According to http://jira.codehaus.org/browse/MNGSITE-152 -->
|
||||
<!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
|
||||
<item name="License" href="http://www.apache.org/licenses/"/>
|
||||
<item name="Download" href="../download.html"/>
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
|
|
@ -97,6 +97,10 @@
|
|||
</exclusions>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
// not a component but a Maven object to be transformed into an expression/property: deprecated
|
||||
getLogger().warn( "Deprecated @Component annotation for '" + parameter.getName() + "' field in "
|
||||
+ mojoAnnotatedClass.getClassName()
|
||||
+ ": replace with @Parameter( default-value = \"" + expression
|
||||
+ ": replace with @Parameter( defaultValue = \"" + expression
|
||||
+ "\", readonly = true )" );
|
||||
parameter.setDefaultValue( expression );
|
||||
parameter.setType( componentAnnotationContent.getRoleClassName() );
|
||||
|
|
|
|||
|
|
@ -19,6 +19,18 @@ package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
|
|
@ -41,17 +53,6 @@ import org.codehaus.plexus.util.reflection.ReflectorException;
|
|||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
|
|
@ -61,6 +62,9 @@ public class DefaultMojoAnnotationsScanner
|
|||
extends AbstractLogEnabled
|
||||
implements MojoAnnotationsScanner
|
||||
{
|
||||
// classes with a dash must be ignored
|
||||
private static final Pattern SCANNABLE_CLASS = Pattern.compile( "[^-]+\\.class" );
|
||||
|
||||
private Reflector reflector = new Reflector();
|
||||
|
||||
public Map<String, MojoAnnotatedClass> scan( MojoAnnotationsScannerRequest request )
|
||||
|
|
@ -126,19 +130,28 @@ public class DefaultMojoAnnotationsScanner
|
|||
|
||||
ZipInputStream archiveStream = new ZipInputStream( new FileInputStream( archiveFile ) );
|
||||
|
||||
String zipEntryName = null;
|
||||
try
|
||||
{
|
||||
|
||||
for ( ZipEntry zipEntry = archiveStream.getNextEntry(); zipEntry != null;
|
||||
zipEntry = archiveStream.getNextEntry() )
|
||||
{
|
||||
if ( !zipEntry.getName().endsWith( ".class" ) )
|
||||
zipEntryName = zipEntry.getName();
|
||||
if ( !SCANNABLE_CLASS.matcher( zipEntryName ).matches() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
analyzeClassStream( mojoAnnotatedClasses, archiveStream, artifact, excludeMojo );
|
||||
}
|
||||
}
|
||||
catch ( IllegalArgumentException e )
|
||||
{
|
||||
// In case of a class with newer specs an IllegalArgumentException can be thrown
|
||||
getLogger().error( "Failed to analyze " + archiveFile.getAbsolutePath() + "!/" + zipEntryName );
|
||||
|
||||
throw e;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtil.close( archiveStream );
|
||||
|
|
@ -174,7 +187,7 @@ public class DefaultMojoAnnotationsScanner
|
|||
|
||||
for ( String classFile : classFiles )
|
||||
{
|
||||
if ( !classFile.endsWith( ".class" ) )
|
||||
if ( !SCANNABLE_CLASS.matcher( classFile ).matches() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class MojoAnnotationVisitor
|
|||
|
||||
MojoAnnotationVisitor( Logger logger, String annotationClassName )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
this.annotationClassName = annotationClassName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class MojoClassVisitor
|
|||
|
||||
public MojoClassVisitor( Logger logger )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class MojoFieldVisitor
|
|||
|
||||
MojoFieldVisitor( Logger logger, String fieldName, String className )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
this.fieldName = fieldName;
|
||||
this.className = className;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class TestAnnotationsReader
|
|||
MojoAnnotationsScanner mojoAnnotationsScanner = (MojoAnnotationsScanner) lookup( MojoAnnotationsScanner.ROLE );
|
||||
|
||||
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.setProject( new MavenProject() );
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* 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 static org.easymock.EasyMock.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
|
||||
public class DefaultMojoAnnotationsScannerTest
|
||||
extends PlexusTestCase
|
||||
{
|
||||
private DefaultMojoAnnotationsScanner scanner = new DefaultMojoAnnotationsScanner();
|
||||
|
||||
public void testSkipModuleInfoClassInArchive() throws Exception
|
||||
{
|
||||
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java9-module.jar"), null, false );
|
||||
}
|
||||
|
||||
public void testJava8Annotations() throws Exception
|
||||
{
|
||||
Logger logger = createMock( Logger.class );
|
||||
expect( logger.isDebugEnabled() ).andReturn( false );
|
||||
replay( logger );
|
||||
scanner.enableLogging( logger );
|
||||
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java8-annotations.jar"), null, false );
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -88,15 +88,15 @@ public class DefaultMojoScanner
|
|||
|
||||
if ( extractor == null )
|
||||
{
|
||||
throw new ExtractionException( "No mojo extractor with id: " + extractorId );
|
||||
throw new ExtractionException( "No mojo extractor with '" + extractorId + "' id." );
|
||||
}
|
||||
|
||||
logger.debug( "Applying mojo extractor with id: " + extractorId );
|
||||
logger.debug( "Applying " + extractorId + " mojo extractor" );
|
||||
|
||||
List<MojoDescriptor> extractorDescriptors = extractor.execute( request );
|
||||
|
||||
logger.info( "Mojo extractor with id: " + extractorId + " found " + extractorDescriptors.size()
|
||||
+ " mojo descriptors." );
|
||||
logger.info( extractorId + " mojo extractor found " + extractorDescriptors.size()
|
||||
+ " mojo descriptor" + ( extractorDescriptors.size() > 1 ? "s" : "" ) + "." );
|
||||
numMojoDescriptors += extractorDescriptors.size();
|
||||
|
||||
for ( MojoDescriptor descriptor : extractorDescriptors )
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-generators</artifactId>
|
||||
|
|
|
|||
|
|
@ -473,9 +473,9 @@ public class PluginXdocGenerator
|
|||
{
|
||||
Parameter parameter = parameters.next();
|
||||
|
||||
w.startElement( "p" );
|
||||
w.startElement( "h4" );
|
||||
w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.name_internal", parameter.getName() ) );
|
||||
w.endElement(); //p
|
||||
w.endElement();
|
||||
|
||||
if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
|
||||
{
|
||||
|
|
@ -543,6 +543,10 @@ public class PluginXdocGenerator
|
|||
addedUl = addUl( w, addedUl, parameter.getDefaultValue() );
|
||||
writeDetail( getString( "pluginxdoc.mojodescriptor.parameter.default" ),
|
||||
escapeXml( parameter.getDefaultValue() ), w );
|
||||
|
||||
addedUl = addUl( w, addedUl, parameter.getAlias() );
|
||||
writeDetail( getString( "pluginxdoc.mojodescriptor.parameter.alias" ), escapeXml( parameter.getAlias() ),
|
||||
w );
|
||||
|
||||
if ( addedUl )
|
||||
{
|
||||
|
|
@ -719,6 +723,13 @@ public class PluginXdocGenerator
|
|||
if ( property != null )
|
||||
{
|
||||
w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.property.description", property ) );
|
||||
w.writeMarkup( "<br/>" );
|
||||
}
|
||||
|
||||
if ( StringUtils.isNotEmpty( parameter.getAlias() ) )
|
||||
{
|
||||
w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.alias.description",
|
||||
escapeXml( parameter.getAlias() ) ) );
|
||||
}
|
||||
|
||||
w.endElement(); //td
|
||||
|
|
|
|||
|
|
@ -321,7 +321,11 @@ public class HelpMojo
|
|||
String parameterName = getValue( parameter, "name" );
|
||||
String parameterDescription = getValue( parameter, "description" );
|
||||
|
||||
Element fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
|
||||
Element fieldConfigurationElement = null;
|
||||
if ( configurationElement != null )
|
||||
{
|
||||
fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
|
||||
}
|
||||
|
||||
String parameterDefaultValue = "";
|
||||
if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) )
|
||||
|
|
@ -355,7 +359,7 @@ public class HelpMojo
|
|||
* @param str String to repeat
|
||||
* @param repeat number of times to repeat str
|
||||
* @return String with repeated String
|
||||
* @throws NegativeArraySizeException if <code>repeat < 0</code>
|
||||
* @throws NegativeArraySizeException if <code>repeat < 0</code>
|
||||
* @throws NullPointerException if str is <code>null</code>
|
||||
*/
|
||||
private static String repeat( String str, int repeat )
|
||||
|
|
@ -394,7 +398,7 @@ public class HelpMojo
|
|||
* @param indentSize The size of each indentation, 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>.
|
||||
* @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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ pluginxdoc.mojodescriptor.inheritedByDefault=Is NOT inherited by default in mult
|
|||
pluginxdoc.mojodescriptor.parameter.details=Parameter Details
|
||||
pluginxdoc.mojodescriptor.parameter.deprecated=<strong>Deprecated.</strong> {0}
|
||||
pluginxdoc.mojodescriptor.parameter.name=Name
|
||||
pluginxdoc.mojodescriptor.parameter.name_link=<strong><a href="#{0}">{0}</a></strong>
|
||||
pluginxdoc.mojodescriptor.parameter.name_internal=<strong><a name="{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.description=Description
|
||||
pluginxdoc.mojodescriptor.parameter.type=Type
|
||||
pluginxdoc.mojodescriptor.parameter.since=Since
|
||||
|
|
@ -53,6 +53,8 @@ pluginxdoc.mojodescriptor.parameter.property=User Property
|
|||
pluginxdoc.mojodescriptor.parameter.property.description=<strong>User property is</strong>: <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.parameter.default=Default
|
||||
pluginxdoc.mojodescriptor.parameter.defaultValue=<strong>Default value is</strong>: <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.parameter.alias=Alias
|
||||
pluginxdoc.mojodescriptor.parameter.alias.description=<strong>Alias is</strong>: <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.requiredParameters=Required Parameters
|
||||
pluginxdoc.mojodescriptor.optionalParameters=Optional Parameters
|
||||
pluginxdoc.mojodescriptor.parameters=Parameters
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ pluginxdoc.mojodescriptor.parameter.required=Erforderlich
|
|||
pluginxdoc.mojodescriptor.parameter.expression=Ausdruck
|
||||
pluginxdoc.mojodescriptor.parameter.default=Standard
|
||||
pluginxdoc.mojodescriptor.parameter.defaultValue=<strong>Standardwert ist</strong>: <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.parameter.alias=Alias
|
||||
pluginxdoc.mojodescriptor.parameter.alias.description=<strong>Alias ist</strong>: <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.requiredParameters=Erforderliche Parameter
|
||||
pluginxdoc.mojodescriptor.optionalParameters=Optionale Parameter
|
||||
pluginxdoc.mojodescriptor.parameters=Parameter
|
||||
|
|
|
|||
|
|
@ -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.deprecated=<strong>Obsol\u00e8te.</strong> {0}
|
||||
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.type=Type
|
||||
pluginxdoc.mojodescriptor.parameter.since=Depuis
|
||||
|
|
@ -52,6 +51,8 @@ pluginxdoc.mojodescriptor.parameter.property=Propri\u00e9t\u00e9 utilisateur
|
|||
pluginxdoc.mojodescriptor.parameter.property.description=<strong>Propri\u00e9t\u00e9 utilisateur</strong> : <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.parameter.default=D\u00e9faut
|
||||
pluginxdoc.mojodescriptor.parameter.defaultValue=<strong>Valeur par d\u00e9faut</strong> : <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.parameter.alias=Alias
|
||||
pluginxdoc.mojodescriptor.parameter.alias.description=<strong>Alias</strong> : <code>{0}</code>.
|
||||
pluginxdoc.mojodescriptor.requiredParameters=Param\u00e8tres requis
|
||||
pluginxdoc.mojodescriptor.optionalParameters=Param\u00e8tres optionnels
|
||||
pluginxdoc.mojodescriptor.parameters=Param\u00e8tres
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public abstract class AbstractGeneratorTestCase
|
|||
param.setRequired( true );
|
||||
param.setType( "java.lang.String" );
|
||||
param.setDescription( "Test parameter description" );
|
||||
param.setAlias( "some.alias" );
|
||||
|
||||
params.add( param );
|
||||
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ public class PluginDescriptorGeneratorTest
|
|||
assertEquals( "dir", parameter.getName() );
|
||||
assertEquals( String.class.getName(), parameter.getType() );
|
||||
assertTrue( parameter.isRequired() );
|
||||
assertEquals( "some.alias", parameter.getAlias() );
|
||||
}
|
||||
|
||||
private void checkDependency( String groupId, String artifactId, String version, ComponentDependency dependency )
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
|
|
|
|||
|
|
@ -233,4 +233,28 @@ public class JavaMojoDescriptorExtractorTest
|
|||
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>
|
||||
|
|
@ -55,7 +55,7 @@ public class Full
|
|||
protected String[] parameter;
|
||||
|
||||
/**
|
||||
* @parameter alias="myAlias" expression="${aSystemProperty}" default-value="${anExpression}"
|
||||
* @parameter alias="myAlias" property="aSystemProperty" default-value="${anExpression}"
|
||||
* @readonly
|
||||
* @required
|
||||
* @since tomorrow
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-javadoc</artifactId>
|
||||
|
|
@ -74,6 +74,7 @@
|
|||
<name>java.vendor</name>
|
||||
<value>Sun Microsystems Inc.</value>
|
||||
</property>
|
||||
<jdk>(,1.9)</jdk>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
@ -92,6 +93,7 @@
|
|||
<name>java.vendor</name>
|
||||
<value>Oracle Corporation</value>
|
||||
</property>
|
||||
<jdk>(,1.9)</jdk>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
@ -108,7 +110,9 @@
|
|||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-invoker-plugin</artifactId>
|
||||
<version>${mavenInvokerPluginVersion}</version>
|
||||
<configuration>
|
||||
<debug>true</debug>
|
||||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ under the License.
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>2.10.4</version>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/site/apidocs</outputDirectory>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-ant</artifactId>
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ import java.util.Set;
|
|||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.Parameter;
|
||||
import org.apache.maven.plugin.tools.model.PluginMetadataParseException;
|
||||
import org.apache.maven.plugin.tools.model.PluginMetadataParser;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.path.PathTranslator;
|
||||
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
||||
import org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor;
|
||||
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||
import org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor;
|
||||
import org.apache.maven.tools.plugin.extractor.model.PluginMetadataParseException;
|
||||
import org.apache.maven.tools.plugin.extractor.model.PluginMetadataParser;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.repository.ComponentRequirement;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@ package org.apache.maven.tools.plugin.extractor.ant;
|
|||
* 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.MojoDescriptor;
|
||||
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.extractor.ExtractionException;
|
||||
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
|
||||
extends TestCase
|
||||
|
|
@ -100,39 +98,47 @@ public class AntMojoDescriptorExtractorTest
|
|||
assertEquals( "Mojo descriptor: " + desc.getGoal() + " is missing 'PathTranslator' component requirement.", PathTranslator.class.getName(), req.getRole() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Map buildTestMap( String resourceDirName )
|
||||
{
|
||||
Map result = new HashMap();
|
||||
|
||||
ClassLoader cloader = Thread.currentThread().getContextClassLoader();
|
||||
URL mojosXmlUrl = cloader.getResource( resourceDirName + "/test.mojos.xml" );
|
||||
|
||||
if ( mojosXmlUrl == null )
|
||||
try
|
||||
{
|
||||
fail( "No classpath resource named: '" + resourceDirName + "/test.mojos.xml' could be found." );
|
||||
}
|
||||
|
||||
File mojosXml = new File( StringUtils.replace( mojosXmlUrl.getPath(), "%20", " " ) );
|
||||
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" ) )
|
||||
Map result = new HashMap();
|
||||
|
||||
ClassLoader cloader = Thread.currentThread().getContextClassLoader();
|
||||
URL mojosXmlUrl = cloader.getResource( resourceDirName + "/test.mojos.xml" );
|
||||
|
||||
if ( mojosXmlUrl == null )
|
||||
{
|
||||
File f = new File( dir, listing[i] ).getAbsoluteFile();
|
||||
|
||||
scripts.add( f );
|
||||
fail( "No classpath resource named: '" + resourceDirName + "/test.mojos.xml' could be found." );
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-model</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.plugin.tools.model;
|
||||
package org.apache.maven.tools.plugin.extractor.model;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.plugin.tools.model;
|
||||
package org.apache.maven.tools.plugin.extractor.model;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -29,7 +29,7 @@ import java.util.Set;
|
|||
import org.apache.maven.plugin.descriptor.DuplicateParameterException;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.Parameter;
|
||||
import org.apache.maven.plugin.tools.model.io.xpp3.PluginMetadataXpp3Reader;
|
||||
import org.apache.maven.tools.plugin.extractor.model.io.xpp3.PluginMetadataXpp3Reader;
|
||||
import org.codehaus.plexus.component.repository.ComponentRequirement;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
|
|
@ -78,6 +78,9 @@ public class PluginMetadataParser
|
|||
descriptors.add( descriptor );
|
||||
}
|
||||
}
|
||||
|
||||
reader.close();
|
||||
reader = null;
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
|
@ -136,11 +139,11 @@ public class PluginMetadataParser
|
|||
descriptor.setExecuteGoal( le.getGoal() );
|
||||
}
|
||||
|
||||
List<org.apache.maven.plugin.tools.model.Parameter> parameters = mojo.getParameters();
|
||||
List<org.apache.maven.tools.plugin.extractor.model.Parameter> parameters = mojo.getParameters();
|
||||
|
||||
if ( parameters != null && !parameters.isEmpty() )
|
||||
{
|
||||
for ( org.apache.maven.plugin.tools.model.Parameter param : parameters )
|
||||
for ( org.apache.maven.tools.plugin.extractor.model.Parameter param : parameters )
|
||||
{
|
||||
Parameter dParam = new Parameter();
|
||||
dParam.setAlias( param.getAlias() );
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<defaults>
|
||||
<default>
|
||||
<key>package</key>
|
||||
<value>org.apache.maven.plugin.tools.model</value>
|
||||
<value>org.apache.maven.tools.plugin.extractor.model</value>
|
||||
</default>
|
||||
</defaults>
|
||||
<classes>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.plugin.tools.model;
|
||||
package org.apache.maven.tools.plugin.extractor.model;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -19,14 +19,12 @@ package org.apache.maven.plugin.tools.model;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
|
||||
public class PluginMetadataParserTest
|
||||
extends TestCase
|
||||
|
|
@ -57,16 +55,24 @@ public class PluginMetadataParserTest
|
|||
assertTrue( desc.getImplementation().endsWith( ":test2" ) );
|
||||
assertEquals( "test2", desc.getGoal() );
|
||||
}
|
||||
|
||||
|
||||
private File getMetadataFile( String name )
|
||||
{
|
||||
URL resource = Thread.currentThread().getContextClassLoader().getResource( name );
|
||||
if ( resource == null )
|
||||
try
|
||||
{
|
||||
fail( "Cannot find classpath resource: '" + name + "'." );
|
||||
URL resource = Thread.currentThread().getContextClassLoader().getResource( name );
|
||||
if ( resource == null )
|
||||
{
|
||||
fail( "Cannot find classpath resource: '" + name + "'." );
|
||||
}
|
||||
|
||||
// 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 );
|
||||
}
|
||||
|
||||
return new File( StringUtils.replace( resource.getPath(), "%20", " " ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ under the License.
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-script-ant</artifactId>
|
||||
|
|
@ -68,7 +68,7 @@ under the License.
|
|||
<artifactId>maven-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>easymock</groupId>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,20 @@ package org.apache.maven.script.ant;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.io.Reader;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.model.Build;
|
||||
|
|
@ -42,23 +56,10 @@ import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
|||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.easymock.MockControl;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import static org.easymock.EasyMock.createMock;
|
||||
import static org.easymock.EasyMock.expect;
|
||||
import static org.easymock.EasyMock.replay;
|
||||
import static org.easymock.EasyMock.verify;
|
||||
|
||||
public class AntMojoWrapperTest
|
||||
extends TestCase
|
||||
|
|
@ -66,7 +67,7 @@ public class AntMojoWrapperTest
|
|||
|
||||
public void test2xStylePlugin()
|
||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||
ComponentConfigurationException, ArchiverException
|
||||
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||
{
|
||||
String pluginXml = "META-INF/maven/plugin-2.1.xml";
|
||||
|
||||
|
|
@ -86,7 +87,7 @@ public class AntMojoWrapperTest
|
|||
|
||||
public void test20StylePlugin()
|
||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||
ComponentConfigurationException, ArchiverException
|
||||
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||
{
|
||||
String pluginXml = "META-INF/maven/plugin-2.0.xml";
|
||||
|
||||
|
|
@ -125,7 +126,7 @@ public class AntMojoWrapperTest
|
|||
|
||||
private List<String> run( String pluginXml, boolean includeImplied )
|
||||
throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
|
||||
ComponentConfigurationException, ArchiverException
|
||||
ComponentConfigurationException, ArchiverException, URISyntaxException
|
||||
{
|
||||
StackTraceElement stack = new Throwable().getStackTrace()[1];
|
||||
System.out.println( "\n\nRunning: " + stack.getMethodName() + "\n\n" );
|
||||
|
|
@ -143,6 +144,8 @@ public class AntMojoWrapperTest
|
|||
{
|
||||
reader = new InputStreamReader( resource.openStream() );
|
||||
pd = new PluginDescriptorBuilder().build( reader, pluginXml );
|
||||
reader.close();
|
||||
reader = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -160,11 +163,13 @@ public class AntMojoWrapperTest
|
|||
|
||||
wrapper.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
|
||||
|
||||
MockControl artifactCtl = null;
|
||||
MockControl pathTranslatorCtl = null;
|
||||
Artifact artifact = createMock( Artifact.class );
|
||||
PathTranslator pt = createMock( PathTranslator.class );
|
||||
|
||||
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" );
|
||||
jarFile.deleteOnExit();
|
||||
|
|
@ -175,29 +180,12 @@ public class AntMojoWrapperTest
|
|||
archiver.addFile( pluginXmlFile, pluginXml );
|
||||
archiver.createArchive();
|
||||
|
||||
artifactCtl = MockControl.createControl( Artifact.class );
|
||||
Artifact artifact = (Artifact) artifactCtl.getMock();
|
||||
|
||||
artifact.getFile();
|
||||
artifactCtl.setReturnValue( jarFile, MockControl.ZERO_OR_MORE );
|
||||
|
||||
artifact.getGroupId();
|
||||
artifactCtl.setReturnValue( "groupId", MockControl.ZERO_OR_MORE );
|
||||
|
||||
artifact.getArtifactId();
|
||||
artifactCtl.setReturnValue( "artifactId", MockControl.ZERO_OR_MORE );
|
||||
|
||||
artifact.getVersion();
|
||||
artifactCtl.setReturnValue( "1", MockControl.ZERO_OR_MORE );
|
||||
|
||||
artifact.getId();
|
||||
artifactCtl.setReturnValue( "groupId:artifactId:jar:1", MockControl.ZERO_OR_MORE );
|
||||
|
||||
artifact.getClassifier();
|
||||
artifactCtl.setReturnValue( null, MockControl.ZERO_OR_MORE );
|
||||
|
||||
pathTranslatorCtl = MockControl.createControl( PathTranslator.class );
|
||||
PathTranslator pt = (PathTranslator) pathTranslatorCtl.getMock();
|
||||
expect( artifact.getFile() ).andReturn( jarFile ).anyTimes();
|
||||
expect( artifact.getGroupId() ).andReturn( "groupId" ).anyTimes();
|
||||
expect( artifact.getArtifactId() ).andReturn( "artifactId" ).anyTimes();
|
||||
expect( artifact.getVersion() ).andReturn( "1" ).anyTimes();
|
||||
expect( artifact.getId() ).andReturn( "groupId:artifactId:jar:1" ).anyTimes();
|
||||
expect( artifact.getClassifier() ).andReturn( null ).anyTimes();
|
||||
|
||||
Model model = new Model();
|
||||
|
||||
|
|
@ -209,8 +197,7 @@ public class AntMojoWrapperTest
|
|||
MavenProject project = new MavenProject( model );
|
||||
project.setFile( new File( "pom.xml" ).getAbsoluteFile() );
|
||||
|
||||
artifactCtl.replay();
|
||||
pathTranslatorCtl.replay();
|
||||
replay( artifact, pt );
|
||||
|
||||
pd.setPluginArtifact( artifact );
|
||||
pd.setArtifacts( Collections.singletonList( artifact ) );
|
||||
|
|
@ -248,8 +235,7 @@ public class AntMojoWrapperTest
|
|||
|
||||
if ( includeImplied )
|
||||
{
|
||||
artifactCtl.verify();
|
||||
pathTranslatorCtl.verify();
|
||||
verify( artifact, pt );
|
||||
}
|
||||
|
||||
List<String> messages = new ArrayList<String>();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ under the License.
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-script</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-script-beanshell</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ under the License.
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-script</artifactId>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue