46
46
import org .apache .maven .plugin .BuildPluginManager ;
47
47
import org .apache .maven .plugin .MojoExecutionException ;
48
48
import org .apache .maven .project .MavenProject ;
49
- import org .codehaus .plexus .logging .Logger ;
50
49
import org .eclipse .aether .RepositorySystem ;
51
50
52
51
import java .io .IOException ;
@@ -104,7 +103,6 @@ public final class SBOMGenerator {
104
103
private final BuildPluginManager pluginManager ;
105
104
private final RepositorySystem repositorySystem ;
106
105
private final String mainClass ;
107
- private final Logger logger ;
108
106
109
107
private static final String SBOM_NATIVE_IMAGE_FLAG = "--enable-sbom" ;
110
108
private static final String SBOM_FILE_FORMAT = "json" ;
@@ -135,7 +133,7 @@ private static final class AddedComponentFields {
135
133
private static final class Plugin {
136
134
static final String artifactId = "cyclonedx-maven-plugin" ;
137
135
static final String groupId = "org.cyclonedx" ;
138
- static final String version = "2.8 .1" ;
136
+ static final String version = "2.9 .1" ;
139
137
static final String goal = "makeAggregateBom" ;
140
138
141
139
private static final class Configuration {
@@ -151,14 +149,12 @@ public SBOMGenerator(
151
149
MavenSession mavenSession ,
152
150
BuildPluginManager pluginManager ,
153
151
RepositorySystem repositorySystem ,
154
- String mainClass ,
155
- Logger logger ) {
152
+ String mainClass ) {
156
153
this .mavenProject = mavenProject ;
157
154
this .mavenSession = mavenSession ;
158
155
this .pluginManager = pluginManager ;
159
156
this .repositorySystem = repositorySystem ;
160
157
this .mainClass = mainClass ;
161
- this .logger = logger ;
162
158
this .outputDirectory = mavenProject .getBuild ().getDirectory ();
163
159
}
164
160
@@ -185,9 +181,6 @@ public void generateIfSupportedAndEnabled(Config config) throws MojoExecutionExc
185
181
186
182
Path sbomPath = Paths .get (outputDirectory , SBOM_FILENAME );
187
183
try {
188
- /* Suppress the output from the plugin. */
189
- int loggingLevel = logger .getThreshold ();
190
- logger .setThreshold (Logger .LEVEL_DISABLED );
191
184
executeMojo (
192
185
plugin (
193
186
groupId (Plugin .groupId ),
@@ -204,7 +197,6 @@ public void generateIfSupportedAndEnabled(Config config) throws MojoExecutionExc
204
197
),
205
198
executionEnvironment (mavenProject , mavenSession , pluginManager )
206
199
);
207
- logger .setThreshold (loggingLevel );
208
200
209
201
if (!Files .exists (sbomPath )) {
210
202
return ;
0 commit comments