analyze.
34 | * 35 | * @param url the JAR file or directory to analyze 36 | * @return a {@link java.util.Set} object 37 | * @throws java.io.IOException if any 38 | */ 39 | default Setanalyze.
45 | * 46 | * @param url the JAR file or directory to analyze 47 | * @return a {@link java.util.Set} object 48 | * @throws java.io.IOException if any 49 | */ 50 | SetClassFileVisitor interface.
25 | * 26 | * @author Mark Hobson 27 | */ 28 | public interface ClassFileVisitor { 29 | /** 30 | *visitClass.
31 | * 32 | * @param className a {@link java.lang.String} object. 33 | * @param in a {@link java.io.InputStream} object. 34 | */ 35 | void visitClass(String className, InputStream in); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/shared/dependency/analyzer/ClassesPatterns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.shared.dependency.analyzer; 20 | 21 | import java.util.Collection; 22 | import java.util.Collections; 23 | import java.util.regex.Pattern; 24 | import java.util.stream.Collectors; 25 | 26 | /** 27 | * Patterns for classes 28 | */ 29 | public class ClassesPatterns { 30 | 31 | private final CollectionConstructor for CollectorClassFileVisitor.
38 | */ 39 | public CollectorClassFileVisitor() { 40 | this(new ClassesPatterns()); 41 | } 42 | 43 | public CollectorClassFileVisitor(ClassesPatterns excludedClasses) { 44 | classes = new HashSet<>(); 45 | this.excludedClasses = excludedClasses; 46 | } 47 | 48 | /** {@inheritDoc} */ 49 | @Override 50 | public void visitClass(String className, InputStream in) { 51 | // inner classes have equivalent compilation requirement as container class 52 | if (className.indexOf('$') < 0 && !excludedClasses.isMatch(className)) { 53 | classes.add(className); 54 | } 55 | } 56 | 57 | /** 58 | *Getter for the field classes
.
DefaultClassAnalyzer class.
31 | * 32 | * @author Mark Hobson 33 | */ 34 | @Named 35 | @Singleton 36 | public class DefaultClassAnalyzer implements ClassAnalyzer { 37 | 38 | @Override 39 | public Setanalyze.
35 | * 36 | * @param url the JAR file or directory to analyze 37 | * @return the set of class names referenced by the library 38 | * @throws IOException if an error occurs reading a JAR or .class file 39 | */ 40 | default Setanalyze.
46 | * 47 | * @param url the JAR file or directory to analyze 48 | * @param excludeClasses a class list to exclude 49 | * @return the set of class names referenced by the library 50 | * @throws IOException if an error occurs reading a JAR or .class file 51 | */ 52 | default SetanalyzeUsages.
60 | * 61 | * @param url the JAR file or directory to analyze 62 | * @return the set of class names referenced by the library, paired with the 63 | * classes declaring those references. 64 | * @throws IOException if an error occurs reading a JAR or .class file 65 | */ 66 | Setanalyze.
40 | * 41 | * @param project a {@link org.apache.maven.project.MavenProject} object 42 | * @return a {@link org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis} object 43 | * @throws org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerException if any 44 | */ 45 | default ProjectDependencyAnalysis analyze(MavenProject project) throws ProjectDependencyAnalyzerException { 46 | return analyze(project, null); 47 | } 48 | 49 | /** 50 | *analyze.
51 | * 52 | * @param project a {@link org.apache.maven.project.MavenProject} object 53 | * @param excludedClasses collection of regular expression of classes name to exclude 54 | * @return a {@link org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis} object 55 | * @throws org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzerException if any 56 | */ 57 | ProjectDependencyAnalysis analyze(MavenProject project, CollectionProjectDependencyAnalyzerException class.
23 | * 24 | * @author Mark Hobson 25 | */ 26 | public class ProjectDependencyAnalyzerException extends Exception { 27 | /** 28 | * The serialisation unique ID. 29 | */ 30 | private static final long serialVersionUID = -5954447543668196977L; 31 | 32 | /** 33 | *Constructor for ProjectDependencyAnalyzerException.
34 | * 35 | * @param message a {@link java.lang.String} object. 36 | */ 37 | public ProjectDependencyAnalyzerException(String message) { 38 | super(message); 39 | } 40 | 41 | /** 42 | *Constructor for ProjectDependencyAnalyzerException.
43 | * 44 | * @param message a {@link java.lang.String} object. 45 | * @param cause a {@link java.lang.Throwable} object. 46 | */ 47 | public ProjectDependencyAnalyzerException(String message, Throwable cause) { 48 | super(message, cause); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.shared.dependency.analyzer.asm; 20 | 21 | import javax.inject.Named; 22 | import javax.inject.Singleton; 23 | 24 | import java.io.IOException; 25 | import java.net.URL; 26 | import java.util.Set; 27 | 28 | import org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils; 29 | import org.apache.maven.shared.dependency.analyzer.ClassesPatterns; 30 | import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer; 31 | import org.apache.maven.shared.dependency.analyzer.DependencyUsage; 32 | 33 | /** 34 | * ASMDependencyAnalyzer 35 | * 36 | * @author Mark Hobson 37 | */ 38 | @Named 39 | @Singleton 40 | public class ASMDependencyAnalyzer implements DependencyAnalyzer { 41 | 42 | @Override 43 | public Setorg.objectweb.asm.depend.DependencyVisitor
in the ASM dependencies example.
28 | *
29 | * @author Mark Hobson
30 | */
31 | public class DefaultAnnotationVisitor extends AnnotationVisitor {
32 | private final ResultCollector resultCollector;
33 |
34 | private final String usedByClass;
35 |
36 | /**
37 | * Constructor for DefaultAnnotationVisitor.
38 | * 39 | * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. 40 | */ 41 | public DefaultAnnotationVisitor(ResultCollector resultCollector, String usedByClass) { 42 | super(Opcodes.ASM9); 43 | this.resultCollector = resultCollector; 44 | this.usedByClass = usedByClass; 45 | } 46 | 47 | /** {@inheritDoc} */ 48 | @Override 49 | public void visit(final String name, final Object value) { 50 | if (value instanceof Type) { 51 | resultCollector.addType(usedByClass, (Type) value); 52 | } 53 | } 54 | 55 | /** {@inheritDoc} */ 56 | @Override 57 | public void visitEnum(final String name, final String desc, final String value) { 58 | resultCollector.addDesc(usedByClass, desc); 59 | } 60 | 61 | /** {@inheritDoc} */ 62 | @Override 63 | public AnnotationVisitor visitAnnotation(final String name, final String desc) { 64 | resultCollector.addDesc(usedByClass, desc); 65 | 66 | return this; 67 | } 68 | 69 | /** {@inheritDoc} */ 70 | @Override 71 | public AnnotationVisitor visitArray(final String name) { 72 | return this; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultFieldVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.shared.dependency.analyzer.asm; 20 | 21 | import org.objectweb.asm.AnnotationVisitor; 22 | import org.objectweb.asm.FieldVisitor; 23 | import org.objectweb.asm.Opcodes; 24 | 25 | /** 26 | * Computes the set of classes referenced by visited code. 27 | * Inspired byorg.objectweb.asm.depend.DependencyVisitor
in the ASM dependencies example.
28 | *
29 | * @author Mark Hobson
30 | */
31 | public class DefaultFieldVisitor extends FieldVisitor {
32 | private final AnnotationVisitor annotationVisitor;
33 |
34 | private final ResultCollector resultCollector;
35 |
36 | private final String usedByClass;
37 |
38 | /**
39 | * Constructor for DefaultFieldVisitor.
40 | * 41 | * @param annotationVisitor a {@link org.objectweb.asm.AnnotationVisitor} object. 42 | * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. 43 | */ 44 | public DefaultFieldVisitor( 45 | AnnotationVisitor annotationVisitor, ResultCollector resultCollector, String usedByClass) { 46 | super(Opcodes.ASM9); 47 | this.annotationVisitor = annotationVisitor; 48 | this.resultCollector = resultCollector; 49 | this.usedByClass = usedByClass; 50 | } 51 | 52 | /** {@inheritDoc} */ 53 | @Override 54 | public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) { 55 | resultCollector.addDesc(usedByClass, desc); 56 | 57 | return annotationVisitor; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DefaultSignatureVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.shared.dependency.analyzer.asm; 20 | 21 | import org.objectweb.asm.Opcodes; 22 | import org.objectweb.asm.signature.SignatureVisitor; 23 | 24 | /** 25 | * Computes the set of classes referenced by visited code. 26 | * Inspired byorg.objectweb.asm.depend.DependencyVisitor
in the ASM dependencies example.
27 | *
28 | * @author Mark Hobson
29 | */
30 | public class DefaultSignatureVisitor extends SignatureVisitor {
31 | private final ResultCollector resultCollector;
32 | private final String usedByClass;
33 |
34 | /**
35 | * Constructor for DefaultSignatureVisitor.
36 | * 37 | * @param resultCollector a {@link org.apache.maven.shared.dependency.analyzer.asm.ResultCollector} object. 38 | */ 39 | public DefaultSignatureVisitor(ResultCollector resultCollector, String usedByClass) { 40 | super(Opcodes.ASM9); 41 | this.resultCollector = resultCollector; 42 | this.usedByClass = usedByClass; 43 | } 44 | 45 | /** {@inheritDoc} */ 46 | @Override 47 | public void visitClassType(final String name) { 48 | resultCollector.addName(usedByClass, name); 49 | } 50 | 51 | /** {@inheritDoc} */ 52 | @Override 53 | public void visitInnerClassType(final String name) { 54 | resultCollector.addName(usedByClass, name); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/apache/maven/shared/dependency/analyzer/asm/VisitClassException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.maven.shared.dependency.analyzer.asm; 20 | 21 | /** 22 | * Exception for processing class. 23 | */ 24 | public class VisitClassException extends RuntimeException { 25 | /** 26 | * A constructor 27 | * @param message message 28 | * @param cause cause of exception 29 | */ 30 | public VisitClassException(String message, Throwable cause) { 31 | super(message, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/site/apt/index.apt.vm: -------------------------------------------------------------------------------- 1 | ----- 2 | Introduction 3 | ----- 4 | Hervé Boutemy 5 | ----- 6 | 2013-07-23 7 | ----- 8 | 9 | ~~ Licensed to the Apache Software Foundation (ASF) under one 10 | ~~ or more contributor license agreements. See the NOTICE file 11 | ~~ distributed with this work for additional information 12 | ~~ regarding copyright ownership. The ASF licenses this file 13 | ~~ to you under the Apache License, Version 2.0 (the 14 | ~~ "License"); you may not use this file except in compliance 15 | ~~ with the License. You may obtain a copy of the License at 16 | ~~ 17 | ~~ http://www.apache.org/licenses/LICENSE-2.0 18 | ~~ 19 | ~~ Unless required by applicable law or agreed to in writing, 20 | ~~ software distributed under the License is distributed on an 21 | ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 | ~~ KIND, either express or implied. See the License for the 23 | ~~ specific language governing permissions and limitations 24 | ~~ under the License. 25 | 26 | ~~ NOTE: For help with the syntax of this file, see: 27 | ~~ http://maven.apache.org/doxia/references/apt-format.html 28 | 29 | ${project.name} 30 | 31 | Analyzes the dependencies of a project for undeclared or unused artifacts. 32 | 33 | <${project.name} ${project.version} is distributed in source format.
31 | 32 |Use a source archive if you intend to build ${project.name} yourself.
33 | 34 |Otherwise, simply use the ready-made binary artifacts from central repository.
35 | 36 |${project.name} is distributed under the Apache License, version 2.0.
37 | 38 |This is the current stable version of ${project.name}.
41 | 42 |46 | | Link | 47 |Checksum | 48 |Signature | 49 |
---|---|---|---|
${project.name} ${project.version} (Source zip) | 54 |${project.artifactId}-${project.version}-source-release.zip | 55 |${project.artifactId}-${project.version}-source-release.zip.sha512 | 56 |${project.artifactId}-${project.version}-source-release.zip.asc | 57 |
It is essential that you verify the integrity of the downloaded file 62 | using the checksum (.sha512 file) 63 | or using the signature (.asc file) against the public KEYS used by the Apache Maven developers. 64 |
65 | 66 |It is strongly recommended to use the latest release version of ${project.name} to take advantage of the newest features and bug fixes.
70 |Older non-recommended releases can be found on our archive site.
71 |CollectorClassFileVisitor
.
31 | *
32 | * @author Mark Hobson
33 | * @see CollectorClassFileVisitor
34 | */
35 | class CollectorClassFileVisitorTest {
36 | private CollectorClassFileVisitor visitor;
37 |
38 | @BeforeEach
39 | void setUp() {
40 | visitor = new CollectorClassFileVisitor();
41 | }
42 |
43 | @Test
44 | void testVisitClass() {
45 | visitor.visitClass("a.b.c", null);
46 | visitor.visitClass("x.y.z", null);
47 |
48 | SetDefaultClassAnalyzer
.
42 | *
43 | * @author Mark Hobson
44 | * @see DefaultClassAnalyzer
45 | */
46 | class DefaultClassAnalyzerTest {
47 |
48 | @TempDir
49 | private Path tempDir;
50 |
51 | private Path file;
52 |
53 | @BeforeEach
54 | void setUp() throws IOException {
55 | file = Files.createTempFile(tempDir, "test", ".jar");
56 | try (JarOutputStream out = new JarOutputStream(new FileOutputStream(file.toFile()))) {
57 | addZipEntry(out, "a/b/c.class", "class a.b.c");
58 | addZipEntry(out, "x/y/z.class", "class x.y.z");
59 | }
60 | }
61 |
62 | @Test
63 | void testAnalyzeWithJar() throws IOException {
64 | SetProjectDependencyAnalysis
.
34 | *
35 | * @author Mark Hobson
36 | * @see ProjectDependencyAnalysis
37 | */
38 | class ProjectDependencyAnalysisTest {
39 | @Test
40 | void testConstructor() {
41 | SetProjectDependencyAnalyzerException
.
27 | *
28 | * @author Mark Hobson
29 | * @see ProjectDependencyAnalyzerException
30 | */
31 | class ProjectDependencyAnalyzerExceptionTest {
32 | @Test
33 | void testConstructor() {
34 | assertThat(new ProjectDependencyAnalyzerException("a")).hasMessage("a");
35 | }
36 |
37 | @Test
38 | void testConstructorWithThrowable() {
39 | Throwable throwable = new Exception();
40 | ProjectDependencyAnalyzerException exception = new ProjectDependencyAnalyzerException("a", throwable);
41 |
42 | assertThat(exception).hasMessage("a").hasCause(throwable);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.maven.shared.dependency.analyzer.asm;
20 |
21 | import java.io.IOException;
22 | import java.net.URL;
23 | import java.nio.file.Path;
24 | import java.nio.file.Paths;
25 | import java.util.Collections;
26 | import java.util.Set;
27 |
28 | import org.apache.maven.shared.dependency.analyzer.ClassesPatterns;
29 | import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer;
30 | import org.junit.jupiter.api.Test;
31 |
32 | import static org.assertj.core.api.Assertions.assertThat;
33 |
34 | class ASMDependencyAnalyzerTest {
35 | private final DependencyAnalyzer analyzer = new ASMDependencyAnalyzer();
36 |
37 | @Test
38 | void test() throws Exception {
39 | URL jarUrl = this.getClass().getResource("/org/objectweb/asm/ClassReader.class");
40 | assertThat(jarUrl).isNotNull();
41 | String fileUrl =
42 | jarUrl.toString().substring("jar:".length(), jarUrl.toString().indexOf("!/"));
43 |
44 | Set
26 | * The handler method in {@link Prepare} takes an implicit Consumer<ArtifactResolutionRequest> argument. Analyze
27 | * this class to verify the implicit reference.
28 | */
29 | public class AnalyzedClass {
30 |
31 | public void useFirst() {
32 | new Prepare().handler(this::doNothing);
33 | }
34 |
35 | private void doNothing(final Object object) {}
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/maven/shared/dependency/analyzer/testcases/analyze/ClassToExclude.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.maven.shared.dependency.analyzer.testcases.analyze;
20 |
21 | import java.util.regex.Pattern;
22 |
23 | /**
24 | * Class to be skipped during analyzed in unit test.
25 | */
26 | public class ClassToExclude {
27 | private void doNothing(final Pattern pattern) {}
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/maven/shared/dependency/analyzer/testcases/prepare/Prepare.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.maven.shared.dependency.analyzer.testcases.prepare;
20 |
21 | import java.util.function.Consumer;
22 |
23 | import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
24 | import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
25 |
26 | /**
27 | * Class to be used for verifying that analyzer picks up usage of classes with no import.
28 | */
29 | public class Prepare {
30 |
31 | @SuppressWarnings("checkstyle:UnusedLocalVariable")
32 | public void handler(Consumer