feat(create-mvn-plugin): added docs to mvn plugin

This commit is contained in:
dancingCycle 2022-01-05 02:14:15 -05:00
parent 3f4c712257
commit 3c50c07181
2 changed files with 35 additions and 20 deletions

View File

@ -13,16 +13,26 @@
<name>counter-maven-plugin Maven Mojo</name>
<url>http://maven.apache.org</url>
<!--<licenses>
<license>
<name>GNU General Public License</name>
<url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
</license>
</licenses>-->
<organization>
<name>Software Ingenieur Begerad</name>
<url>https://www.swingbe.de/</url>
</organization>
<scm>
<!--<url>https://github.com/Software-Ingenieur-Begerad/sandbox-java</url>-->
</scm>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
@ -51,12 +61,22 @@
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -15,16 +15,11 @@ import java.util.List;
public class DependencyCounterMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", required = true, readonly = true)
MavenProject project;
public void execute() throws MojoExecutionException, MojoFailureException {
List<Dependency> dependencies = project.getDependencies();
long numDependencies = dependencies.stream().count();
getLog().info("Number of dependencies: " + numDependencies);
}
}