Skip to content

Commit c2d778d

Browse files
committedJul 13, 2022
#1092 parent 0.59.0
1 parent a33b127 commit c2d778d

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed
 

‎pom.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
3333
<parent>
3434
<groupId>com.jcabi</groupId>
3535
<artifactId>parent</artifactId>
36-
<version>0.57.2</version>
36+
<version>0.59.0</version>
3737
</parent>
3838
<groupId>com.qulice</groupId>
3939
<artifactId>qulice</artifactId>
@@ -96,6 +96,11 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
9696
</distributionManagement>
9797
<dependencyManagement>
9898
<dependencies>
99+
<dependency>
100+
<groupId>org.antlr</groupId>
101+
<artifactId>antlr4-runtime</artifactId>
102+
<version>4.9.2</version>
103+
</dependency>
99104
<dependency>
100105
<groupId>org.projectlombok</groupId>
101106
<artifactId>lombok</artifactId>

‎qulice-checkstyle/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
152152
<excludes combine.children="append">
153153
<exclude>checkstyle:/src/test/resources/com/qulice/checkstyle/.*</exclude>
154154
<exclude>pmd:.*/src/test/resources/.*</exclude>
155+
<exclude>dependencies:org.antlr</exclude>
155156
<exclude>xml:/src/main/resources/com/qulice/checkstyle/checks.xml</exclude>
156157
<exclude>xml:/src/test/resources/com/qulice/checkstyle/ChecksTest/.*</exclude>
157158
</excludes>

‎qulice-maven-plugin/src/main/java/com/qulice/maven/DependenciesValidator.java

+13-4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
* Validator of dependencies.
5151
*
5252
* @since 0.3
53+
* @checkstyle ReturnCountCheck (100 line)
5354
*/
5455
final class DependenciesValidator implements MavenValidator {
5556

@@ -62,13 +63,14 @@ final class DependenciesValidator implements MavenValidator {
6263
public void validate(final MavenEnvironment env)
6364
throws ValidationException {
6465
final Collection<String> excludes = env.excludes("dependencies");
65-
if (!env.outdir().exists()
66-
|| "pom".equals(env.project().getPackaging())
67-
|| excludes.contains(".*")
68-
) {
66+
if (!env.outdir().exists() || "pom".equals(env.project().getPackaging())) {
6967
Logger.info(this, "No dependency analysis in this project");
7068
return;
7169
}
70+
if (excludes.contains(".*")) {
71+
Logger.info(this, "Dependency analysis suppressed in the project via pom.xml");
72+
return;
73+
}
7274
final Collection<String> unused = Collections2.filter(
7375
DependenciesValidator.unused(env),
7476
Predicates.not(new DependenciesValidator.ExcludePredicate(excludes))
@@ -93,6 +95,13 @@ public void validate(final MavenEnvironment env)
9395
StringUtils.join(used, DependenciesValidator.SEP)
9496
);
9597
}
98+
if (!used.isEmpty() || !unused.isEmpty()) {
99+
Logger.info(
100+
this,
101+
// @checkstyle LineLength (1 line)
102+
"You can suppress this message by <exclude>dependencies:...</exclude> in pom.xml, where <...> is what the dependency name starts with (not a regular expression!)"
103+
);
104+
}
96105
final int failures = used.size() + unused.size();
97106
if (failures > 0) {
98107
throw new ValidationException(

0 commit comments

Comments
 (0)
Please sign in to comment.