Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MPLUGIN-396] Allow @deprecated annotation without javadoc tag
- Loading branch information
1 parent
0a7c5be
commit c9e18b9
Showing
14 changed files
with
406 additions
and
19 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[INFO] help 1.0-SNAPSHOT | ||
Tests generation and compilation of the help mojo. | ||
|
||
help:test | ||
Deprecated. No reason given | ||
|
||
MOJO-DESCRIPTION. Some 'quotation' marks and backslashes '\\', some important | ||
javadoc | ||
and an inline link to AnotherMojo. | ||
|
||
Available parameters: | ||
|
||
defaultParam (Default: escape\backslash) | ||
This parameter uses 'quotation' marks and backslashes '\\' in its | ||
description. Those characters must be escaped in Java string literals. | ||
|
||
deprecatedParam | ||
Deprecated. No reason given | ||
|
||
Parameter description in javadoc. | ||
|
||
undocumentedParam | ||
|
||
Required: Yes | ||
User property: test.undocumented |
19 changes: 19 additions & 0 deletions
19
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.1 = clean install | ||
invoker.goals.2 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help |
79 changes: 79 additions & 0 deletions
79
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?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>@mavenVersion@</version> | ||
<scope>provided</scope> | ||
</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>3.10.1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<id>help-goal</id> | ||
<goals> | ||
<goal>helpmojo</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
67 changes: 67 additions & 0 deletions
67
...plugin-plugin/src/it/help-basic-deprecated-annotation-only/src/main/java/test/MyMojo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
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 test.AnotherMojo}. | ||
* | ||
* @since 2.1 | ||
*/ | ||
@Deprecated | ||
@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; | ||
|
||
/** | ||
* Parameter description in javadoc. | ||
*/ | ||
@Deprecated | ||
@Parameter | ||
private String deprecatedParam; | ||
|
||
@Parameter( property = "test.undocumented", required = true ) | ||
private String undocumentedParam; | ||
|
||
/** | ||
* Readonly parameter: should not be proposed for configuration. | ||
*/ | ||
@Parameter( defaultValue = "not for configuration", readonly = true ) | ||
private String readonly; | ||
|
||
public void execute() | ||
{ | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/test.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
28 changes: 28 additions & 0 deletions
28
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r", "" ) | ||
|
||
log = new File( basedir, "help.log" ).text.replace( "\r", "" ) | ||
log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) ) | ||
log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim() | ||
|
||
assert log == expected | ||
|
||
return true |
43 changes: 43 additions & 0 deletions
43
...t/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/MPlugin396Mojo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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.plugins.annotations.Component; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
import org.apache.maven.project.MavenProjectHelper; | ||
|
||
@Deprecated | ||
@Mojo( name = "mplugin-396" ) | ||
public class MPlugin396Mojo | ||
extends AbstractMojo | ||
{ | ||
@Deprecated | ||
@Parameter | ||
private String param; | ||
|
||
@Component | ||
private MavenProjectHelper projectHelper; | ||
|
||
public void execute() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.