Merge branch '1.2.x'
This commit is contained in:
@@ -107,10 +107,10 @@ public abstract class AbstractDependencyFilterMojo extends AbstractMojo {
|
||||
for (ArtifactsFilter additionalFilter : additionalFilters) {
|
||||
filters.addFilter(additionalFilter);
|
||||
}
|
||||
filters.addFilter(new ArtifactIdFilter("",
|
||||
cleanFilterConfig(this.excludeArtifactIds)));
|
||||
filters.addFilter(new MatchingGroupIdFilter(
|
||||
cleanFilterConfig(this.excludeGroupIds)));
|
||||
filters.addFilter(
|
||||
new ArtifactIdFilter("", cleanFilterConfig(this.excludeArtifactIds)));
|
||||
filters.addFilter(
|
||||
new MatchingGroupIdFilter(cleanFilterConfig(this.excludeGroupIds)));
|
||||
if (this.includes != null && !this.includes.isEmpty()) {
|
||||
filters.addFilter(new IncludeFilter(this.includes));
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
|
||||
public class ArtifactsLibraries implements Libraries {
|
||||
|
||||
private static final Map<String, LibraryScope> SCOPES;
|
||||
|
||||
static {
|
||||
Map<String, LibraryScope> scopes = new HashMap<String, LibraryScope>();
|
||||
scopes.put(Artifact.SCOPE_COMPILE, LibraryScope.COMPILE);
|
||||
|
||||
@@ -66,8 +66,8 @@ public class PropertiesMergingResourceTransformer implements ResourceTransformer
|
||||
String name = (String) key;
|
||||
String value = properties.getProperty(name);
|
||||
String existing = this.data.getProperty(name);
|
||||
this.data
|
||||
.setProperty(name, existing == null ? value : existing + "," + value);
|
||||
this.data.setProperty(name,
|
||||
existing == null ? value : existing + "," + value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ class RunArguments {
|
||||
return CommandLineUtils.translateCommandline(arguments);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalArgumentException("Failed to parse arguments [" + arguments
|
||||
+ "]", ex);
|
||||
throw new IllegalArgumentException(
|
||||
"Failed to parse arguments [" + arguments + "]", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,17 +41,17 @@ public class ExcludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void excludeSimple() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar")));
|
||||
Set result = filter.filter(Collections
|
||||
.singleton(createArtifact("com.foo", "bar")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar")));
|
||||
Set result = filter
|
||||
.filter(Collections.singleton(createArtifact("com.foo", "bar")));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void excludeGroupIdNoMatch() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar")));
|
||||
Artifact artifact = createArtifact("com.baz", "bar");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -60,8 +60,8 @@ public class ExcludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void excludeArtifactIdNoMatch() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar")));
|
||||
Artifact artifact = createArtifact("com.foo", "biz");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -70,17 +70,17 @@ public class ExcludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void excludeClassifier() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
Set result = filter.filter(Collections.singleton(createArtifact("com.foo", "bar",
|
||||
"jdk5")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar", "jdk5")));
|
||||
Set result = filter
|
||||
.filter(Collections.singleton(createArtifact("com.foo", "bar", "jdk5")));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void excludeClassifierNoTargetClassifier() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar", "jdk5")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -89,8 +89,8 @@ public class ExcludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void excludeClassifierNoMatch() throws ArtifactFilterException {
|
||||
ExcludeFilter filter = new ExcludeFilter(Arrays.asList(createExclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
ExcludeFilter filter = new ExcludeFilter(
|
||||
Arrays.asList(createExclude("com.foo", "bar", "jdk5")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar", "jdk6");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -126,7 +126,8 @@ public class ExcludeFilterTests {
|
||||
return exclude;
|
||||
}
|
||||
|
||||
private Artifact createArtifact(String groupId, String artifactId, String classifier) {
|
||||
private Artifact createArtifact(String groupId, String artifactId,
|
||||
String classifier) {
|
||||
Artifact a = mock(Artifact.class);
|
||||
given(a.getGroupId()).willReturn(groupId);
|
||||
given(a.getArtifactId()).willReturn(artifactId);
|
||||
|
||||
@@ -40,8 +40,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeSimple() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -50,8 +50,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeGroupIdNoMatch() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar")));
|
||||
Artifact artifact = createArtifact("com.baz", "bar");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
@@ -59,8 +59,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeArtifactIdNoMatch() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar")));
|
||||
Artifact artifact = createArtifact("com.foo", "biz");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
@@ -68,8 +68,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeClassifier() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar", "jdk5")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar", "jdk5");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should not have been filtered", 1, result.size());
|
||||
@@ -78,8 +78,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeClassifierNoTargetClassifier() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar", "jdk5")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
@@ -87,8 +87,8 @@ public class IncludeFilterTests {
|
||||
|
||||
@Test
|
||||
public void includeClassifierNoMatch() throws ArtifactFilterException {
|
||||
IncludeFilter filter = new IncludeFilter(Arrays.asList(createInclude("com.foo",
|
||||
"bar", "jdk5")));
|
||||
IncludeFilter filter = new IncludeFilter(
|
||||
Arrays.asList(createInclude("com.foo", "bar", "jdk5")));
|
||||
Artifact artifact = createArtifact("com.foo", "bar", "jdk6");
|
||||
Set result = filter.filter(Collections.singleton(artifact));
|
||||
assertEquals("Should have been filtered", 0, result.size());
|
||||
@@ -122,7 +122,8 @@ public class IncludeFilterTests {
|
||||
return include;
|
||||
}
|
||||
|
||||
private Artifact createArtifact(String groupId, String artifactId, String classifier) {
|
||||
private Artifact createArtifact(String groupId, String artifactId,
|
||||
String classifier) {
|
||||
Artifact a = mock(Artifact.class);
|
||||
given(a.getGroupId()).willReturn(groupId);
|
||||
given(a.getArtifactId()).willReturn(artifactId);
|
||||
|
||||
@@ -44,7 +44,8 @@ public class RunArgumentsTests {
|
||||
|
||||
@Test
|
||||
public void parseDebugFlags() {
|
||||
String[] args = parseArgs("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
|
||||
String[] args = parseArgs(
|
||||
"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
|
||||
assertEquals(2, args.length);
|
||||
assertEquals("-Xdebug", args[0]);
|
||||
assertEquals("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005",
|
||||
|
||||
@@ -131,8 +131,8 @@ public final class Verify {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Unable to find entry starting with "
|
||||
+ entryName);
|
||||
throw new IllegalStateException(
|
||||
"Unable to find entry starting with " + entryName);
|
||||
}
|
||||
|
||||
public boolean hasEntry(String entry) {
|
||||
@@ -225,16 +225,16 @@ public final class Verify {
|
||||
verifier.assertHasEntryNameStartingWith("lib/spring-context");
|
||||
verifier.assertHasEntryNameStartingWith("lib/spring-core");
|
||||
verifier.assertHasEntryNameStartingWith("lib/javax.servlet-api-3");
|
||||
assertTrue("Unpacked launcher classes", verifier.hasEntry("org/"
|
||||
+ "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes", verifier.hasEntry("org/"
|
||||
+ "test/SampleApplication.class"));
|
||||
assertTrue("Unpacked launcher classes", verifier
|
||||
.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes",
|
||||
verifier.hasEntry("org/" + "test/SampleApplication.class"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void verifyManifest(Manifest manifest) throws Exception {
|
||||
assertEquals("org.springframework.boot.loader.JarLauncher", manifest
|
||||
.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals("org.springframework.boot.loader.JarLauncher",
|
||||
manifest.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals(this.main, manifest.getMainAttributes().getValue("Start-Class"));
|
||||
assertEquals("Foo", manifest.getMainAttributes().getValue("Not-Used"));
|
||||
}
|
||||
@@ -251,20 +251,21 @@ public final class Verify {
|
||||
super.verifyZipEntries(verifier);
|
||||
verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-context");
|
||||
verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-core");
|
||||
verifier.assertHasEntryNameStartingWith("WEB-INF/lib-provided/javax.servlet-api-3");
|
||||
assertTrue("Unpacked launcher classes", verifier.hasEntry("org/"
|
||||
+ "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes", verifier.hasEntry("WEB-INF/classes/org/"
|
||||
+ "test/SampleApplication.class"));
|
||||
verifier.assertHasEntryNameStartingWith(
|
||||
"WEB-INF/lib-provided/javax.servlet-api-3");
|
||||
assertTrue("Unpacked launcher classes", verifier
|
||||
.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes", verifier
|
||||
.hasEntry("WEB-INF/classes/org/" + "test/SampleApplication.class"));
|
||||
assertTrue("Web content", verifier.hasEntry("index.html"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void verifyManifest(Manifest manifest) throws Exception {
|
||||
assertEquals("org.springframework.boot.loader.WarLauncher", manifest
|
||||
.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals("org.test.SampleApplication", manifest.getMainAttributes()
|
||||
.getValue("Start-Class"));
|
||||
assertEquals("org.springframework.boot.loader.WarLauncher",
|
||||
manifest.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals("org.test.SampleApplication",
|
||||
manifest.getMainAttributes().getValue("Start-Class"));
|
||||
assertEquals("Foo", manifest.getMainAttributes().getValue("Not-Used"));
|
||||
}
|
||||
}
|
||||
@@ -277,10 +278,10 @@ public final class Verify {
|
||||
|
||||
@Override
|
||||
protected void verifyManifest(Manifest manifest) throws Exception {
|
||||
assertEquals("org.springframework.boot.loader.PropertiesLauncher", manifest
|
||||
.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals("org.test.SampleApplication", manifest.getMainAttributes()
|
||||
.getValue("Start-Class"));
|
||||
assertEquals("org.springframework.boot.loader.PropertiesLauncher",
|
||||
manifest.getMainAttributes().getValue("Main-Class"));
|
||||
assertEquals("org.test.SampleApplication",
|
||||
manifest.getMainAttributes().getValue("Start-Class"));
|
||||
assertEquals("Foo", manifest.getMainAttributes().getValue("Not-Used"));
|
||||
}
|
||||
}
|
||||
@@ -297,10 +298,10 @@ public final class Verify {
|
||||
verifier.assertHasEntryNameStartingWith("lib/spring-context");
|
||||
verifier.assertHasEntryNameStartingWith("lib/spring-core");
|
||||
verifier.assertHasNoEntryNameStartingWith("lib/javax.servlet-api-3");
|
||||
assertFalse("Unpacked launcher classes", verifier.hasEntry("org/"
|
||||
+ "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes", verifier.hasEntry("org/"
|
||||
+ "test/SampleModule.class"));
|
||||
assertFalse("Unpacked launcher classes", verifier
|
||||
.hasEntry("org/" + "springframework/boot/loader/JarLauncher.class"));
|
||||
assertTrue("Own classes",
|
||||
verifier.hasEntry("org/" + "test/SampleModule.class"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user