Skip to content

Commit 1a29b9f

Browse files
committed
Fix test
1 parent 0a6c7c4 commit 1a29b9f

File tree

5 files changed

+28
-187
lines changed

5 files changed

+28
-187
lines changed

.mvn/maven.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-Dorg.slf4j.simpleLogger.showDateTime=true
22
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
3+
-ntp

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ This plugin is based on the [Gradle Plugin](https://github.com/Kotlin/kotlinx-ko
3737
</plugin>
3838
</plugins>
3939
```
40+
41+
### Known issues
42+
- During executing tests the following message might appear: `The MojoDescriptor for the goal prepare-agent cannot be null`
43+
- Solved by running `mvn compile` first as it needs a `plugin.xml` in `target/classes/META-INF/maven/`.

pom.xml

+21
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<kotest.version>5.6.1</kotest.version>
2323
<ktlint-maven-plugin.version>1.16.0</ktlint-maven-plugin.version>
2424
<maven-plugin-annotations.version>3.8.2</maven-plugin-annotations.version>
25+
<maven-plugin-plugin.version>3.8.2</maven-plugin-plugin.version>
2526
<maven-plugin-testing-harness.version>3.3.0</maven-plugin-testing-harness.version>
2627
<maven-project.version>2.2.1</maven-project.version>
2728
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
@@ -247,6 +248,26 @@
247248
</consoleOutputReporter>
248249
</configuration>
249250
</plugin>
251+
<plugin>
252+
<groupId>org.apache.maven.plugins</groupId>
253+
<artifactId>maven-plugin-plugin</artifactId>
254+
<version>${maven-plugin-plugin.version}</version>
255+
<executions>
256+
<execution>
257+
<goals>
258+
<goal>descriptor</goal>
259+
</goals>
260+
<phase>compile</phase>
261+
</execution>
262+
<execution>
263+
<id>default-descriptor</id>
264+
<goals>
265+
<goal>descriptor</goal>
266+
</goals>
267+
<phase>none</phase>
268+
</execution>
269+
</executions>
270+
</plugin>
250271
</plugins>
251272
</build>
252273
</project>

src/test/kotlin/io/github/mavi/kover/plugin/BaseMojoTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@file:Suppress("DEPRECATION")
2-
31
package io.github.mavi.kover.plugin
42

53
import io.kotest.assertions.withClue
@@ -17,6 +15,8 @@ import java.io.File
1715
abstract class BaseMojoTest : AbstractMojoTestCase() {
1816
internal lateinit var session: MavenSession
1917

18+
override fun getPluginDescriptorPath(): String = getBasedir() + "/target/classes/META-INF/maven/plugin.xml"
19+
2020
override fun setUp() {
2121
val basedir = File("${javaClass.getResource("/")?.path}/projects/default")
2222
File(basedir, "target").deleteRecursively()

src/test/resources/META-INF/maven/plugin.xml

-185
This file was deleted.

0 commit comments

Comments
 (0)