-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from clairemcginty/allow-list-param
Add target* params for conflict targeting
- Loading branch information
Showing
12 changed files
with
363 additions
and
27 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
...lugin/src/it/00-test-harness/a-v1/src/main/java/com/spotify/missinglink/d/WillGoAway.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,8 @@ | ||
package com.spotify.missinglink.d; | ||
|
||
/** | ||
* TODO: document! | ||
*/ | ||
public class WillGoAway { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
maven-plugin/src/it/00-test-harness/b/src/main/java/com/spotify/missinglink/e/E.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,12 @@ | ||
package com.spotify.missinglink.e; | ||
|
||
import com.spotify.missinglink.d.WillGoAway; | ||
|
||
/** | ||
* TODO: document! | ||
*/ | ||
public class E { | ||
public static void classShouldBeMissing() { | ||
System.out.println(new WillGoAway()); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
maven-plugin/src/it/class-missing-target-destination/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,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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.spotify.missinglink.tests</groupId> | ||
<artifactId>class-missing-target-destination</artifactId> | ||
<version>1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.spotify.missinglink.tests</groupId> | ||
<artifactId>a</artifactId> | ||
<version>2-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.spotify.missinglink.tests</groupId> | ||
<artifactId>b</artifactId> | ||
<version>1-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<targetDestinationPackages> | ||
<targetDestinationPackage> | ||
<package>com.spotify.missinglink.d</package> | ||
</targetDestinationPackage> | ||
</targetDestinationPackages> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals><goal>check</goal></goals> | ||
<phase>process-classes</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5</version> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
<useIncrementalCompilation>false</useIncrementalCompilation> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
14 changes: 14 additions & 0 deletions
14
...arget-destination/src/main/java/com/spotify/missinglink/ClassMissingAllowDestination.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,14 @@ | ||
package com.spotify.missinglink; | ||
|
||
import com.spotify.missinglink.e.E; | ||
|
||
/** | ||
* This is expected to generate a runtime error because WillGoAway(), as invoked by E.classShouldBeMissing(), | ||
* doesn't exist in a conflicting package. | ||
*/ | ||
public class ClassMissingAllowDestination { | ||
|
||
public static void main(String[] args) { | ||
E.classShouldBeMissing(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...t-destination/src/test/java/com/spotify/missinglink/ClassMissingAllowDestinationTest.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,13 @@ | ||
package com.spotify.missinglink; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class ClassMissingAllowDestinationTest { | ||
|
||
@Test | ||
public void shouldThrowError() throws Exception { | ||
Throwable ex = Assert.assertThrows(NoClassDefFoundError.class, () -> ClassMissingAllowDestination.main(new String[0])); | ||
Assert.assertTrue(ex.getMessage().contains("WillGoAway")); | ||
} | ||
} |
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.