@@ -96,18 +96,19 @@ public void execute() throws MojoExecutionException, MojoFailureException {
96
96
getLog ().info ("Skipping config dump" );
97
97
return ;
98
98
}
99
- final Path outputFile = getSbomFile ().toPath ();
99
+ final Path outputFilePath = getSbomFile ().toPath ();
100
100
CycloneDxSbomGenerator .newInstance ()
101
101
.setManifest (ApplicationManifest .fromConfig (
102
102
ApplicationManifestConfig .builder ()
103
103
.setApplicationModel (resolveApplicationModel ())
104
104
.build ()))
105
- .setOutputFile (outputFile )
105
+ .setOutputFile (outputFilePath )
106
+ .setFormat (format )
106
107
.setEffectiveModelResolver (EffectiveModelResolver .of (getResolver ()))
107
108
.setSchemaVersion (schemaVersion )
108
109
.setIncludeLicenseText (includeLicenseText )
109
110
.generate ();
110
- getLog ().info ("The SBOM has been saved in " + outputFile );
111
+ getLog ().info ("The SBOM has been saved in " + outputFilePath );
111
112
}
112
113
113
114
private ApplicationModel resolveApplicationModel ()
@@ -158,17 +159,18 @@ private File getSbomFile() {
158
159
}
159
160
160
161
protected MavenArtifactResolver getResolver () {
161
- return resolver == null
162
- ? resolver = workspaceProvider .createArtifactResolver (BootstrapMavenContext .config ()
163
- .setUserSettings (session .getRequest ().getUserSettingsFile ())
164
- // The system needs to be initialized with the bootstrap model builder to properly interpolate system properties set on the command line
165
- // e.g. -Dquarkus.platform.version=xxx
166
- //.setRepositorySystem(repoSystem)
167
- // The session should be initialized with the loaded workspace
168
- //.setRepositorySystemSession(repoSession)
169
- .setRemoteRepositories (repos )
170
- // To support multi-module projects that haven't been installed
171
- .setPreferPomsFromWorkspace (true ))
172
- : resolver ;
162
+ if (resolver == null ) {
163
+ resolver = workspaceProvider .createArtifactResolver (BootstrapMavenContext .config ()
164
+ .setUserSettings (session .getRequest ().getUserSettingsFile ())
165
+ // The system needs to be initialized with the bootstrap model builder to properly interpolate system properties set on the command line
166
+ // e.g. -Dquarkus.platform.version=xxx
167
+ //.setRepositorySystem(repoSystem)
168
+ // The session should be initialized with the loaded workspace
169
+ //.setRepositorySystemSession(repoSession)
170
+ .setRemoteRepositories (repos )
171
+ // To support multi-module projects that haven't been installed
172
+ .setPreferPomsFromWorkspace (true ));
173
+ }
174
+ return resolver ;
173
175
}
174
176
}
0 commit comments