Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added .scannerwork/.sonar_lock
Empty file.
6 changes: 6 additions & 0 deletions .scannerwork/report-task.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
projectKey=my_project_key
serverUrl=http://localhost:9000
serverVersion=9.9.8.100196
dashboardUrl=http://localhost:9000/dashboard?id=my_project_key
ceTaskId=AZmVY8kgt2VQnP3E6_zl
ceTaskUrl=http://localhost:9000/api/ce/task?id=AZmVY8kgt2VQnP3E6_zl
35 changes: 35 additions & 0 deletions EmptyProject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,39 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<developers>
<developer>
<id>dev1</id>
<name>User1</name>
<email>test1@email.com</email>
<organization>Test1Org</organization>
</developer>
<developer>
<id>dev2</id>
<name>User2</name>
<email>test2@email.com</email>
<organization>Test2Org</organization>
</developer>
</developers>

<build>
<plugins>
<plugin>
<groupId>org.plugin</groupId>
<artifactId>MavenPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>show-developers-on-validate</id>
<phase>validate</phase>
<goals>
<goal>show-developers</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
49 changes: 46 additions & 3 deletions MavenPlugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.plugin</groupId>
<artifactId>MavenPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.6</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<goalPrefix>developers</goalPrefix>
</configuration>
<executions>
<execution>
<id>default-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
36 changes: 36 additions & 0 deletions MavenPlugin/src/main/java/org/plugin/DevelopersInfoMojo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.plugin;

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 org.apache.maven.project.MavenProject;
import org.apache.maven.model.Developer;

import java.util.List;

@Mojo(name = "show-developers")
public class DevelopersInfoMojo extends AbstractMojo {

@Parameter(defaultValue = "${project}", readonly = true, required = true)
private MavenProject project;

@Override
public void execute() throws MojoExecutionException {
List<Developer> developers = project.getDevelopers();

if (developers == null || developers.isEmpty()) {
getLog().info("No developers defined in pom.xml");
return;
}

getLog().info("=== Developers Info ===");
for (Developer dev : developers) {
getLog().info("ID: " + dev.getId());
getLog().info("Name: " + dev.getName());
getLog().info("Email: " + dev.getEmail());
getLog().info("Organization: " + dev.getOrganization());
getLog().info("-----------------------");
}
}
}
7 changes: 0 additions & 7 deletions MavenPlugin/src/main/java/org/plugin/Main.java

This file was deleted.

7 changes: 7 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sonar.projectKey=my_project_key
sonar.projectName=My Project
sonar.projectVersion=1.0
sonar.sources=EmptyProject/src/main/java, MavenPlugin/src/main/java
sonar.java.binaries=EmptyProject/target/classes, MavenPlugin/target/classes
sonar.host.url=http://localhost:9000
sonar.login=squ_0dc5361ec722f7562baba02ae4788995e731f2a1