Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSONAR-166 Fix Mojo so it can correctly determine if it runs on the l…
…ast project * the counting mode used previously is very fragile depending on the number of calls made to the plugin. An example where it failed is if the plugin is only configured to run in the aggregator pom (so the counter never gets past 1). As the dependency graph is already computed by maven we can just take the last project in order and compare it to the current one.
- Loading branch information
Showing
11 changed files
with
186 additions
and
13 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
its/projects/maven/aggregator-inherit-parent-and-bind-to-verify/module1/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,16 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>module1</artifactId> | ||
<name>Module1</name> | ||
|
||
|
||
</project> | ||
|
16 changes: 16 additions & 0 deletions
16
its/projects/maven/aggregator-inherit-parent-and-bind-to-verify/module2/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,16 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>module2</artifactId> | ||
<name>Module2</name> | ||
|
||
|
||
</project> | ||
|
10 changes: 10 additions & 0 deletions
10
its/projects/maven/aggregator-inherit-parent-and-bind-to-verify/parent/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,10 @@ | ||
<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.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
</project> | ||
|
40 changes: 40 additions & 0 deletions
40
its/projects/maven/aggregator-inherit-parent-and-bind-to-verify/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,40 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>parent/pom.xml</relativePath> | ||
</parent> | ||
<artifactId>aggregator</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>parent</module> | ||
<module>module1</module> | ||
<module>module2</module> | ||
</modules> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.sonarsource.scanner.maven</groupId> | ||
<artifactId>sonar-maven-plugin</artifactId> | ||
<version>${sonar.maven.it.mojoVersion}</version> | ||
<executions> | ||
<execution> | ||
<id>run-sonar</id> | ||
<goals> | ||
<goal>sonar</goal> | ||
</goals> | ||
<phase>verify</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> | ||
|
16 changes: 16 additions & 0 deletions
16
its/projects/maven/aggregator-inherit-parent/module1/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,16 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>module1</artifactId> | ||
<name>Module1</name> | ||
|
||
|
||
</project> | ||
|
16 changes: 16 additions & 0 deletions
16
its/projects/maven/aggregator-inherit-parent/module2/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,16 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>module2</artifactId> | ||
<name>Module2</name> | ||
|
||
|
||
</project> | ||
|
10 changes: 10 additions & 0 deletions
10
its/projects/maven/aggregator-inherit-parent/parent/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,10 @@ | ||
<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.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
</project> | ||
|
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,22 @@ | ||
<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> | ||
<parent> | ||
<groupId>org.sonarsource.maven.its</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<relativePath>parent/pom.xml</relativePath> | ||
</parent> | ||
<artifactId>aggregator</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>parent</module> | ||
<module>module1</module> | ||
<module>module2</module> | ||
</modules> | ||
|
||
|
||
</project> | ||
|
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