Skip to content

Commit c0bfa01

Browse files
authored
Merge branch 'main' into fix_docker_podman_check_main
2 parents d4f5fc6 + 8c20764 commit c0bfa01

5 files changed

Lines changed: 116 additions & 13052 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ contribution. See the [DCO](DCO) file for details.
114114

115115
<!-- Real links -->
116116
[0]: https://www.conventionalcommits.org/en/v1.0.0/
117-
[1]: https://github.com/trustification/exhort-api-spec/blob/main/api/v4/openapi.yaml
117+
[1]: https://github.com/guacsec/trustify-da-api-spec/blob/main/api/v4/openapi.yaml
118118

119119
<!-- Badge links -->
120120
[10]: https://badgen.net/badge/Java%20Version/11/5382a1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ repositories {
104104
<dependency>
105105
<groupId>com.redhat.exhort</groupId>
106106
<artifactId>exhort-java-api</artifactId>
107-
<version>0.0.8-SNAPSHOT</version>
107+
<version>0.0.9-SNAPSHOT</version>
108108
</dependency>
109109
```
110110
</li>
@@ -188,7 +188,7 @@ Excluding a package from any analysis can be achieved by marking the package for
188188
<dependency> <!--exhortignore-->
189189
<groupId>...</groupId>
190190
<artifactId>...</artifactId>
191-
<version>0.0.8-SNAPSHOT</version>
191+
<version>0.0.9-SNAPSHOT</version>
192192
</dependency>
193193
```
194194
</li>

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.redhat.exhort</groupId>
77
<artifactId>exhort-java-api</artifactId>
8-
<version>0.0.8-SNAPSHOT</version>
8+
<version>0.0.9-SNAPSHOT</version>
99
<name>Exhort Java API</name>
1010
<description>Exhort Java API</description>
1111
<url>https://github.com/trustification/exhort-java-api#readme</url>
@@ -19,9 +19,9 @@
1919
<maven.compiler.release>17</maven.compiler.release>
2020
<!-- Dependencies -->
2121
<exhort-api.version>1.0.6</exhort-api.version>
22-
<jackson.version>2.19.1</jackson.version>
22+
<jackson.version>2.19.2</jackson.version>
2323
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
24-
<jakarta.mail.version>2.0.3</jakarta.mail.version>
24+
<jakarta.mail.version>2.0.4</jakarta.mail.version>
2525
<cyclonedx.version>10.2.1</cyclonedx.version>
2626
<!-- Testing Dependencies -->
2727
<assertj.version>3.27.3</assertj.version>
@@ -61,7 +61,7 @@
6161
<repositories>
6262
<repository>
6363
<id>github</id>
64-
<url>https://maven.pkg.github.com/trustification/exhort-api-spec</url>
64+
<url>https://maven.pkg.github.com/guacsec/trustify-da-api-spec</url>
6565
</repository>
6666
</repositories>
6767

@@ -679,7 +679,7 @@ limitations under the License.]]>
679679
<configuration>
680680
<shadedArtifactAttached>true</shadedArtifactAttached>
681681
<shadedClassifierName>cli</shadedClassifierName>
682-
682+
683683
<!-- Filters to exclude problematic files -->
684684
<filters>
685685
<filter>
@@ -697,17 +697,17 @@ limitations under the License.]]>
697697
</excludes>
698698
</filter>
699699
</filters>
700-
700+
701701
<!-- Transformers to handle overlapping resources -->
702702
<transformers>
703703
<!-- Main class transformer -->
704704
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
705705
<mainClass>com.redhat.exhort.cli.App</mainClass>
706706
</transformer>
707-
707+
708708
<!-- Service files transformer for Jackson and other services -->
709709
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
710-
710+
711711
<!-- Append NOTICE files -->
712712
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
713713
<resource>META-INF/NOTICE</resource>
@@ -718,7 +718,7 @@ limitations under the License.]]>
718718
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
719719
<resource>META-INF/NOTICE.md</resource>
720720
</transformer>
721-
721+
722722
<!-- Append LICENSE files -->
723723
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
724724
<resource>META-INF/LICENSE</resource>
@@ -731,7 +731,7 @@ limitations under the License.]]>
731731
</transformer>
732732

733733
</transformers>
734-
734+
735735
<!-- Create non-verbose output -->
736736
<createDependencyReducedPom>false</createDependencyReducedPom>
737737
</configuration>

src/main/java/com/redhat/exhort/providers/JavaMavenProvider.java

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,41 @@ private List<DependencyAggregator> getDependencies(final Path manifestPath) thro
238238
// when a "dependency" tag starts, it will be initiated,
239239
// when a "dependency" tag ends, it will be parsed, act upon, and reset
240240
DependencyAggregator dependencyAggregator = null;
241+
boolean insideDependencyManagement = false;
242+
boolean insideExclusions = false;
243+
boolean insidePlugins = false;
241244
while (reader.hasNext()) {
242245
reader.next(); // get the next event
246+
if (reader.isStartElement() && "dependencyManagement".equals(reader.getLocalName())) {
247+
insideDependencyManagement = true;
248+
continue;
249+
}
250+
if (reader.isEndElement() && "dependencyManagement".equals(reader.getLocalName())) {
251+
insideDependencyManagement = false;
252+
continue;
253+
}
254+
if (reader.isStartElement() && "plugins".equals(reader.getLocalName())) {
255+
insidePlugins = true;
256+
continue;
257+
}
258+
if (reader.isEndElement() && "plugins".equals(reader.getLocalName())) {
259+
insidePlugins = false;
260+
continue;
261+
}
262+
if (reader.isStartElement() && "exclusions".equals(reader.getLocalName())) {
263+
insideExclusions = true;
264+
continue;
265+
}
266+
if (reader.isEndElement() && "exclusions".equals(reader.getLocalName())) {
267+
insideExclusions = false;
268+
continue;
269+
}
243270
if (reader.isStartElement() && "dependency".equals(reader.getLocalName())) {
244-
// starting "dependency" tag, initiate aggregator
245-
dependencyAggregator = new DependencyAggregator();
271+
// starting "dependency" tag, initiate aggregator only if not inside dependencyManagement
272+
// or plugins
273+
if (!insideDependencyManagement && !insidePlugins) {
274+
dependencyAggregator = new DependencyAggregator();
275+
}
246276
continue;
247277
}
248278

@@ -256,9 +286,10 @@ private List<DependencyAggregator> getDependencies(final Path manifestPath) thro
256286
continue;
257287
}
258288

259-
if (reader.isStartElement()) {
289+
if (reader.isStartElement() && !insideExclusions) {
260290
// NOTE if we want to include "scope" tags in ignore,
261291
// add a case here and a property in DependencyIgnore
292+
// Only process these elements if we're not inside exclusions
262293
switch (reader.getLocalName()) {
263294
case "groupId": // starting "groupId" tag, get next event and set to aggregator
264295
reader.next();
@@ -282,8 +313,11 @@ private List<DependencyAggregator> getDependencies(final Path manifestPath) thro
282313
}
283314

284315
if (reader.isEndElement() && "dependency".equals(reader.getLocalName())) {
285-
// add object to list and reset dependency aggregator
286-
deps.add(dependencyAggregator);
316+
// add object to list and reset dependency aggregator only if not inside
317+
// dependencyManagement or plugins
318+
if (!insideDependencyManagement && !insidePlugins && dependencyAggregator != null) {
319+
deps.add(dependencyAggregator);
320+
}
287321
dependencyAggregator = null;
288322
}
289323
}
@@ -383,7 +417,9 @@ private String selectMvnRuntime(final Path manifestPath) {
383417
try {
384418
// verify maven wrapper is accessible
385419
Operations.runProcess(manifest.getParent(), mvnw, ARG_VERSION);
386-
log.fine(String.format("using maven wrapper from : %s", mvnw));
420+
if (debugLoggingIsNeeded()) {
421+
log.info(String.format("using maven wrapper from : %s", mvnw));
422+
}
387423
return mvnw;
388424
} catch (Exception e) {
389425
log.warning(
@@ -393,7 +429,9 @@ private String selectMvnRuntime(final Path manifestPath) {
393429
}
394430
// If maven wrapper is not requested or not accessible, fall back to use mvn
395431
String mvn = Operations.getExecutable(MVN, ARG_VERSION);
396-
log.fine(String.format("using mvn executable from : %s", mvn));
432+
if (debugLoggingIsNeeded()) {
433+
log.info(String.format("using mvn executable from : %s", mvn));
434+
}
397435
return mvn;
398436
}
399437

0 commit comments

Comments
 (0)