Skip to content

Commit 3b8a121

Browse files
Merge pull request #22 from scanoss/feat/support-ignore-include
feat: Add suport ignore/include
2 parents 86fca29 + 11b6e3d commit 3b8a121

30 files changed

+433
-280
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ target/
1111
*.iws
1212
*.iml
1313
*.ipr
14+
.idea
1415

1516
### Eclipse ###
1617
.apt_generated

.idea/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/encodings.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.idea/runConfigurations/CmlLine___scan_folder.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.idea/uiDesigner.xml

Lines changed: 0 additions & 124 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Upcoming changes...
1313

14-
## [0.7.3] - 2024-09-12
14+
15+
## [0.9.0] - 2025-02-03
1516
### Added
16-
- Added variables `DEFAULT_BASE_URL` and `DEFAULT_BASE_URL2` to separate the scan URL from the scan path
17+
- Add support to rules: include & ignore
1718

18-
## [0.7.2] - 2024-04-17
19+
## [0.8.2] - 2025-01-23
20+
### Changed
21+
- Updates scope on dependencies pom.xml
22+
- Publish workflow
23+
24+
## [0.8.0] - 2025-01-21
1925
### Added
2026
- Added [tagging workflow](.github/workflows/version-tag.yml) to aid release generation
27+
- Added variables `DEFAULT_BASE_URL` and `DEFAULT_BASE_URL2` to separate the scan URL from the scan path
28+
- Adds support to rules: replace & remove
2129

2230
## [0.7.1] - 2024-04-12
2331
### Changed
@@ -76,10 +84,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7684
## [0.2.0] - 2023-07-04
7785
### Added
7886
- First pass at the following Classes
79-
- Fingerprinting ([Winnowing](src/main/java/com/scanoss/Winnowing.java))
80-
- Scanning ([Scanner](src/main/java/com/scanoss/Scanner.java))
81-
- REST Interface ([ScanApi](src/main/java/com/scanoss/rest/ScanApi.java))
82-
- JSON Utils ([JsonUtils](src/main/java/com/scanoss/utils/JsonUtils.java))
87+
- Fingerprinting ([Winnowing](src/main/java/com/scanoss/Winnowing.java))
88+
- Scanning ([Scanner](src/main/java/com/scanoss/Scanner.java))
89+
- REST Interface ([ScanApi](src/main/java/com/scanoss/rest/ScanApi.java))
90+
- JSON Utils ([JsonUtils](src/main/java/com/scanoss/utils/JsonUtils.java))
8391
- CLI ([CommandLine](src/main/java/com/scanoss/cli/CommandLine.java))
8492

8593
[0.2.0]: https://github.com/scanoss/scanoss.java/compare/v0.0.0...v0.2.0
@@ -94,5 +102,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
94102
[0.6.1]: https://github.com/scanoss/scanoss.java/compare/v0.6.0...v0.6.1
95103
[0.7.0]: https://github.com/scanoss/scanoss.java/compare/v0.6.1...v0.7.0
96104
[0.7.1]: https://github.com/scanoss/scanoss.java/compare/v0.7.0...v0.7.1
97-
[0.7.2]: https://github.com/scanoss/scanoss.java/compare/v0.7.1...v0.7.2
98-
[0.7.3]: https://github.com/scanoss/scanoss.java/compare/v0.7.2...v0.7.3
105+
[0.8.0]: https://github.com/scanoss/scanoss.java/compare/v0.7.1...v0.8.0
106+
[0.8.1]: https://github.com/scanoss/scanoss.java/compare/v0.8.0...v0.8.1
107+
[0.9.0]: https://github.com/scanoss/scanoss.java/compare/v0.8.1...v0.9.0

pom.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.scanoss</groupId>
88
<artifactId>scanoss</artifactId>
9-
<version>0.8.2</version>
9+
<version>0.9.0</version>
1010
<packaging>jar</packaging>
1111
<name>scanoss.java</name>
1212
<url>https://github.com/scanoss/scanoss.java</url>
@@ -181,6 +181,34 @@
181181
</descriptorRefs>
182182
</configuration>
183183
</execution>
184+
<execution>
185+
<id>without-slf4j</id>
186+
<phase>package</phase>
187+
<goals>
188+
<goal>single</goal>
189+
</goals>
190+
<configuration>
191+
<inlineDescriptors>
192+
<inlineDescriptor>
193+
<id>with-dependencies-exclude-slf4j-simple</id>
194+
<formats>
195+
<format>jar</format>
196+
</formats>
197+
<includeBaseDirectory>false</includeBaseDirectory>
198+
<dependencySets>
199+
<dependencySet>
200+
<outputDirectory>/</outputDirectory>
201+
<useProjectArtifact>true</useProjectArtifact>
202+
<unpack>true</unpack>
203+
<excludes>
204+
<exclude>org.slf4j:slf4j-simple</exclude>
205+
</excludes>
206+
</dependencySet>
207+
</dependencySets>
208+
</inlineDescriptor>
209+
</inlineDescriptors>
210+
</configuration>
211+
</execution>
184212
</executions>
185213
</plugin>
186214
<plugin>

src/main/java/com/scanoss/Scanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private Scanner(Boolean skipSnippets, Boolean allExtensions, Boolean obfuscate,
127127
.build());
128128
this.scanApi = Objects.requireNonNullElseGet(scanApi, () ->
129129
ScanApi.builder().url(url).apiKey(apiKey).timeout(timeout).retryLimit(retryLimit).flags(scanFlags)
130-
.sbomType(sbomType).sbom(sbom).customCert(customCert).proxy(proxy)
130+
.sbomType(sbomType).sbom(sbom).customCert(customCert).proxy(proxy).settings(settings)
131131
.build());
132132
this.scanFileProcessor = Objects.requireNonNullElseGet(scanFileProcessor, () ->
133133
ScanFileProcessor.builder().winnowing(this.winnowing).scanApi(this.scanApi).build());

src/main/java/com/scanoss/ScannerPostProcessor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import lombok.Builder;
3737
import lombok.NonNull;
3838
import lombok.extern.slf4j.Slf4j;
39-
import org.jetbrains.annotations.NotNull;
4039

4140
import java.util.*;
4241

@@ -77,6 +76,10 @@ public List<ScanFileResult> process(@NonNull List<ScanFileResult> scanFileResult
7776
log.info("Starting scan results processing with {} results", scanFileResults.size());
7877
log.debug("BOM configuration - Remove rules: {}, Replace rules: {}", removeSize, replaceSize);
7978

79+
if (scanFileResults.isEmpty()) {
80+
log.info("No scan results found. Skipping: {}", bom);
81+
}
82+
8083
buildPurl2ComponentDetailsMap(scanFileResults);
8184
List<ScanFileResult> processedResults = new ArrayList<>(scanFileResults);
8285
if (removeSize > 0) {
@@ -109,6 +112,11 @@ private void buildPurl2ComponentDetailsMap(@NonNull List<ScanFileResult> scanFil
109112
}
110113
// Iterate through file details
111114
for (ScanFileDetails details : fileDetails) {
115+
if (details != null && details.getMatchType() == MatchType.none) {
116+
log.warn("Skipping no match for file: {}", result.getFilePath());
117+
continue;
118+
}
119+
112120
String[] purls = details != null ? details.getPurls() : null;
113121
if (purls == null) {
114122
log.warn("Null details or empty scan file result details. Skipping: {}", details);

0 commit comments

Comments
 (0)