File tree Expand file tree Collapse file tree
src/sbt-test/sbt-maven/simple Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>
22
3+ lazy val checkPluginXml = taskKey[Unit ](" Verify that the generated Maven plugin descriptor exists under target." )
4+
35lazy val root = project
46 .in(file(" ." ))
57 .enablePlugins(SbtMavenPlugin )
68 .settings(
7- // Classic target layout so scripted checks keep working on sbt 2.
8- target := baseDirectory.value / " target" ,
9- Compile / classDirectory := target.value / " classes" ,
9+ checkPluginXml := {
10+ val pluginXml =
11+ if (sbtBinaryVersion.value == " 1.0" ) {
12+ target.value / " classes" / " META-INF" / " maven" / " plugin.xml"
13+ } else {
14+ target.value / " resource_managed" / " main" / " META-INF" / " maven" / " plugin.xml"
15+ }
16+ require(pluginXml.isFile, s " Expected generated plugin.xml at $pluginXml" )
17+ },
1018 crossPaths := false ,
1119 autoScalaLibrary := false ,
1220 organization := " com.example" ,
Original file line number Diff line number Diff line change 11> package
2- $ exists target/classes/META-INF/maven/plugin.xml
2+ > checkPluginXml
33> test
44> scripted
You can’t perform that action at this time.
0 commit comments