This commit is contained in:
Phillip Webb
2014-05-20 13:13:39 +01:00
parent e40acd81e4
commit 8bcda1bcbe
91 changed files with 477 additions and 438 deletions

View File

@@ -129,5 +129,4 @@
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -30,8 +30,9 @@ import org.w3c.dom.NodeList;
/**
* {@link ManagedDependencies} implementation backed a maven POM.
*
*
* @author Phillip Webb
* @author Andy Wilkinson
* @since 1.1.0
*/
public class PomManagedDependencies extends AbstractManagedDependencies {

View File

@@ -26,7 +26,7 @@ import java.util.TreeMap;
* {@link ManagedDependencies} backed by an external properties file (of the form created
* by the Spring IO platform). The property key should be the groupId and artifactId (in
* the form {@literal groupId:artifactId}) and the value should be the version.
*
*
* @author Phillip Webb
* @since 1.1.0
*/

View File

@@ -24,7 +24,7 @@ import java.util.Collections;
* {@link ManagedDependencies} used by various spring boot tools. Provides programmatic
* access to 'spring-boot-dependencies' and can also support user defined version managed
* dependencies.
*
*
* @author Phillip Webb
* @since 1.1.0
*/

View File

@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat;
/**
* Tests for {@link PomManagedDependencies}.
*
*
* @author Phillip Webb
*/
public class PomManagedDependenciesTests {

View File

@@ -28,7 +28,7 @@ import org.springframework.boot.loader.util.AsciiBytes;
/**
* {@link java.net.JarURLConnection} used to support {@link JarFile#getUrl()}.
*
*
* @author Phillip Webb
*/
class JarURLConnection extends java.net.JarURLConnection {

View File

@@ -95,7 +95,8 @@ public abstract class AbstractDependencyFilterMojo extends AbstractMojo {
}
filters.addFilter(new ArtifactIdFilter("",
cleanFilterConfig(this.excludeArtifactIds)));
filters.addFilter(new MatchingGroupIdFilter(cleanFilterConfig(this.excludeGroupIds)));
filters.addFilter(new MatchingGroupIdFilter(
cleanFilterConfig(this.excludeGroupIds)));
if (this.excludes != null) {
filters.addFilter(new ExcludeFilter(this.excludes));
}

View File

@@ -1,3 +1,19 @@
/*
* Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.maven;
import org.apache.maven.artifact.Artifact;
@@ -6,10 +22,11 @@ import org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatur
/**
* An {@link org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter
* ArtifactsFilter} that filters by matching groupId.
*
* Preferred over the {@link org.apache.maven.shared.artifact.filter.collection.GroupIdFilter} due
* to that classes use of {@link String#startsWith} to match on prefix.
*
*
* Preferred over the
* {@link org.apache.maven.shared.artifact.filter.collection.GroupIdFilter} due to that
* classes use of {@link String#startsWith} to match on prefix.
*
* @author Mark Ingram
* @since 1.1
*/
@@ -22,7 +39,9 @@ public class MatchingGroupIdFilter extends AbstractArtifactFeatureFilter {
super("", exclude);
}
@Override
protected String getArtifactFeature(Artifact artifact) {
return artifact.getGroupId();
}
}

View File

@@ -33,6 +33,7 @@ import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
/**
* Tests for {@link AbstractDependencyFilterMojo}.
*
* @author Stephane Nicoll
*/
@@ -54,7 +55,7 @@ public class DependencyFilterMojoTests {
@Test
public void filterGroupIdExactMatch() throws MojoExecutionException {
TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo(
Collections.<Exclude>emptyList(), "com.foo", "");
Collections.<Exclude> emptyList(), "com.foo", "");
Artifact artifact = createArtifact("com.foo.bar", "one");
Set<Artifact> artifacts = mojo.filterDependencies(
@@ -91,5 +92,6 @@ public class DependencyFilterMojoTests {
public void execute() throws MojoExecutionException, MojoFailureException {
}
}
}