My Bamboo instance is using Maven version 3.3.3. But I keep getting this error
Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.0.3:jmeter (jmeter-tests) on project test: The plugin com.lazerycode.jmeter:jmeter-maven-plugin:2.0.3 requires Maven version 3.1.1
This is an extract from the pom.xml file
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<testFilesDirectory>${project.basedir}/src/test/jmeter</testFilesDirectory>
<ignoreResultFailures>true</ignoreResultFailures>
<testResultsTimestamp>false</testResultsTimestamp>
</configuration>
</plugin>
Related
I'm using jacococ 0.8.7 version, maven 3.3.9 version, jDK 1.8 while I was running from Jenkins I'm facing below exception. what could be the issue? it worked when I used jacoco 0.7.4
command using in Jenkins:
-Dmaven.test.failure.ignore=true -U clean org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent org.jacoco:jacoco-maven-plugin:0.8.7:report test
Error
Execution default-cli of goal org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent failed: A required class was missing while executing org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent: org/jacoco/core/runtime/AgentOptions
pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
My goal is to generate Spring Boot REST Client using OpenAPI 3.0.
I would like to first generate the OpenAPI specification file (springdoc-openapi-maven-plugin) of my API and then generate the client code from this file (swagger-codegen-maven-plugin) using Maven.
My problem is that swagger-codegen-maven-plugin is executed before springdoc-openapi-maven-plugin. So, the output file generated by springdoc-openapi-maven-plugin does not exist when swagger-codegen-maven-plugin executes.
How to execute springdoc-openapi-maven-plugin before swagger-codegen-maven-plugin given the following Maven build plugins configuration?
My Maven build plugin configuration:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<apiDocsUrl>myServerUrl:myPort/v3/api-docs</apiDocsUrl>
<outputFileName>openApiFile.json</outputFileName>
<outputDir>${project.basedir}/src/main/resources</outputDir>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.24</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openApiFile.json</inputSpec>
<language>typescript-angular</language>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
The issue was that springdoc-openapi-maven-plugin is executed during integration-test phase while swagger-codegen-maven-plugin default phase is generate-sources which is executed before integration-test in the build lifecycle.
I just specified a phase for swagger-codegen-maven-plugin which is after integration-test: <phase>post-integration-test</phase>.
I've this problem with Jacoco maven plugin in IntelliJ IDEA 2020.
I put the Jacoco plugin configuration in my pom.xml maven file and then executed the mvn clean install command. It generates the target\site folder but when I open the index.html file it shows me a coverage of 0%, listing all my classes, although I get a 92% coverage in IntelliJ's integrated tool. The jacoco.exec file is generated in target folder, but it's empty!
How can I fix this issue?
Here's my pom.xml fragment:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>14</source>
<target>14</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<configuration>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
<goal>check</goal>
</goals>
<configuration>
<rules>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I'm using the latest Java version (14).
Thanks in advance!
I'm new with Gradle and confused to change maven code to gradle, I get code from ApacheKarafCookbook and want to use gradle as build tool. I tried use gradle init and its not working.
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.0.201403182114</version>
<executions>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<propertyName>jcoverage.command</propertyName>
<includes>
<include>com.packt.*</include>
</includes>
<append>true</append>
</configuration>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
How do I change to gradle?
gradle init will not do auto conversion of maven plugins, phases and targets. You'll have to do that bit by hand. Here's some documentation on how to setup and use the gradle jacoco plugin.
I've created custom plugin (http://search.maven.org/remotecontent?filepath=sk/lukasvasek/project-version-dategenerator-mvn/0.0.001/project-version-dategenerator-mvn-0.0.001.pom). When I install it locally (mvn install) i can use goal dateversionoverrider withou problem. Hovewer when I download this plugin from maven central repo I'm getting error:
[ERROR] Could not find goal 'dateversionoverrider' in plugin sk.lukasvasek:project-version-dategenerator-mvn:0.0.001 among available goals
what am I missing?
Thanks in advance
ok so problem was in descriptor, so I changed it to code below and it works.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<configuration>
<goalPrefix>project-version-dategenerator</goalPrefix>
</configuration>
<executions>
<execution>
<id>default-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-descriptor</id>
<goals>
<goal>helpmojo</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>