@@ -227,48 +227,48 @@ object MojoImplementation {
227227 // plugin/config presence (e.g. shared config, no bound execution) does not produce a JAR.
228228 .filter(_.getExecutions.asScala.exists(_.getGoals.asScala.contains(" shade" )))
229229 .flatMap { plugin =>
230- // Merge execution-level config (where the `shade` goal is usually bound) over plugin-level.
231- val pluginCfg = Option (plugin.getConfiguration).map(_.asInstanceOf [Xpp3Dom ])
232- val execCfgs = plugin.getExecutions.asScala
233- .flatMap(e => Option (e.getConfiguration).map(_.asInstanceOf [Xpp3Dom ]))
234- val cfg = (execCfgs ++ pluginCfg)
235- .reduceOption((dominant, recessive) => Xpp3Dom .mergeXpp3Dom(dominant, recessive))
236- def child (name : String ): Option [String ] =
237- cfg
238- .flatMap(d => Option (d.getChild(name)))
239- .flatMap(c => Option (c.getValue))
240- .map(_.trim)
241- .filter(_.nonEmpty)
242-
243- val build = p.getBuild
244- def warnMissing (jar : File ): Option [File ] = {
245- log.warn(
246- s " Reactor module ' ${p.getArtifactId}' is built by maven-shade-plugin but its shaded " +
247- s " JAR was not found at $jar. Its relocated/bundled classes are NOT in target/classes, " +
248- s " so dependents will fail to compile. Run `mvn package` on ' ${p.getArtifactId}' " +
249- s " (shade binds to the package phase) before exporting to bloop. "
250- )
251- None
252- }
230+ // Merge execution-level config (where the `shade` goal is usually bound) over plugin-level.
231+ val pluginCfg = Option (plugin.getConfiguration).map(_.asInstanceOf [Xpp3Dom ])
232+ val execCfgs = plugin.getExecutions.asScala
233+ .flatMap(e => Option (e.getConfiguration).map(_.asInstanceOf [Xpp3Dom ]))
234+ val cfg = (execCfgs ++ pluginCfg)
235+ .reduceOption((dominant, recessive) => Xpp3Dom .mergeXpp3Dom(dominant, recessive))
236+ def child (name : String ): Option [String ] =
237+ cfg
238+ .flatMap(d => Option (d.getChild(name)))
239+ .flatMap(c => Option (c.getValue))
240+ .map(_.trim)
241+ .filter(_.nonEmpty)
242+
243+ val build = p.getBuild
244+ def warnMissing (jar : File ): Option [File ] = {
245+ log.warn(
246+ s " Reactor module ' ${p.getArtifactId}' is built by maven-shade-plugin but its shaded " +
247+ s " JAR was not found at $jar. Its relocated/bundled classes are NOT in target/classes, " +
248+ s " so dependents will fail to compile. Run `mvn package` on ' ${p.getArtifactId}' " +
249+ s " (shade binds to the package phase) before exporting to bloop. "
250+ )
251+ None
252+ }
253253
254- child(" outputFile" ) match {
255- case Some (out) =>
256- // Explicit output path; resolve relative entries against the module base directory.
257- val f = new File (out)
258- val jar = if (f.isAbsolute) f else new File (p.getBasedir, out)
259- if (jar.exists()) Some (jar) else warnMissing(jar)
260- case None =>
261- // With shadedArtifactAttached the shaded JAR is a secondary (classified) artifact and
262- // the module's main artifact stays unshaded, so target/classes remains correct.
263- val attached = child(" shadedArtifactAttached" ).exists(_.equalsIgnoreCase(" true" ))
264- if (attached) None
265- else {
266- val base = child(" finalName" ).getOrElse(build.getFinalName)
267- val jar = new File (build.getDirectory, s " $base.jar " )
254+ child(" outputFile" ) match {
255+ case Some (out) =>
256+ // Explicit output path; resolve relative entries against the module base directory.
257+ val f = new File (out)
258+ val jar = if (f.isAbsolute) f else new File (p.getBasedir, out)
268259 if (jar.exists()) Some (jar) else warnMissing(jar)
269- }
260+ case None =>
261+ // With shadedArtifactAttached the shaded JAR is a secondary (classified) artifact and
262+ // the module's main artifact stays unshaded, so target/classes remains correct.
263+ val attached = child(" shadedArtifactAttached" ).exists(_.equalsIgnoreCase(" true" ))
264+ if (attached) None
265+ else {
266+ val base = child(" finalName" ).getOrElse(build.getFinalName)
267+ val jar = new File (build.getDirectory, s " $base.jar " )
268+ if (jar.exists()) Some (jar) else warnMissing(jar)
269+ }
270+ }
270271 }
271- }
272272 }
273273
274274 val reactorArtifactIds = session.getProjects().asScala.map(_.getArtifactId).toSet
@@ -330,7 +330,9 @@ object MojoImplementation {
330330 // classpath. Keyed by canonical path to match the explicit list and Maven-resolved entries.
331331 def canon (p : String ): String = new File (p).getCanonicalPath
332332 val shadedByOutputDir : Map [String , String ] =
333- shadedDeps.map { case (d, jar) => canon(d.getBuild.getOutputDirectory) -> jar.getAbsolutePath }
333+ shadedDeps.map {
334+ case (d, jar) => canon(d.getBuild.getOutputDirectory) -> jar.getAbsolutePath
335+ }
334336 def substituteShaded (path : String ): String = shadedByOutputDir.getOrElse(canon(path), path)
335337
336338 val configDir = mojo.getBloopConfigDir.toPath()
0 commit comments