Skip to content

Commit 5367f02

Browse files
committed
Fix test
1 parent 79a391a commit 5367f02

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/sbt-test/sbt-maven/simple/build.sbt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
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+
35
lazy 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",

src/sbt-test/sbt-maven/simple/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
> package
2-
$ exists target/classes/META-INF/maven/plugin.xml
2+
> checkPluginXml
33
> test
44
> scripted

0 commit comments

Comments
 (0)