Using Liquibase extensions with Maven - maven

I am trying to use Liquibase Oracle extensions from maven-liquibase-plugin but I'm not able to get it working. I have no issue with the same changeLog file from the command line, but in Maven I get the following error message
SEVERE 21/11/11 14:49:liquibase: Error thrown as a SAXException: Unknown Liquibase extension: dropTrigger. Are you missing a jar from your classpath?
The changelog file I'm using
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ora="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet author="PE1926" id="ONCHANGE" runOnChange="true">
<ora:dropTrigger schemaName="" triggerName="TRIGGER_01"/>
<rollback>
<sqlFile path="latest/trg/TRIGGER_01.sql" endDelimiter="$"/>
</rollback>
</changeSet>
Here is a pom.xml extract
[...]
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-oracle</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals><goal>status</goal></goals>
</execution>
</executions>
<configuration>
<changeLogFile>src/main/resources/update.xml</changeLogFile>
<propertyFile>${db-resources.dir}/liquibase.properties</propertyFile>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
I've also tried to add liquibase-oracle as plugin dependency but I get the same error message.
Is this the correct way of using Liquibase extensions from Maven? Am I missing something?

Add all liquibase dependencies as plugin dependencies.

I didn't need to add any other dependencies - this did it for me:
<pluginManagement>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${version.liquibase}</version>
<configuration>
<propertyFileWillOverride>true</propertyFileWillOverride>
<driver>oracle.jdbc.OracleDriver</driver>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
<changeLogFile>liquibase-master-changelog.xml</changeLogFile>
<!-- ensure a liquibase.properties is available in each module that runs liquibase -->
<propertyFile>liquibase.properties</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-oracle</artifactId>
<version>${version.liquibase.ora-ext}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
</plugin>
</pluginManagement>

Related

OSGi: How to embed dependencies in a wrapper bundle

We want to use the google-maps-services in our AEM project. To be able to use it in the OGSi environment I creates a wrapper bundle that embeds the jar and exports the com.google.maps package.
Sadly the bundle cannot be started, because it is missing the following dependencies:
com.google.appengine.api
io.opencencus.stats
io.opencencus.tags
okhttp3
okio
I tried to embedd them as well, but for some reason this doesn't seem to work as well.
What am I doing wrong?
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent></parent>
<artifactId>thirdparty-google-maps-services-bundle</artifactId>
<name>aem-main - Thirdparty - google-maps-services-bundle</name>
<description>Wrapper bundle for Google Maps API</description>
<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Bundle-Category: thirdparty
Import-Package: javax.annotation;version=0.0.0
Export-Package: com.google.maps.*
Embed-Dependency: google-maps-services,okhttp,okio,opencensus-api,appengine-api-1.0-sdk
-exportcontents: ${packages;VERSIONED}
-snapshot: ${tstamp;yyyyMMddHHmmssSSS}
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-baseline-maven-plugin</artifactId>
<configuration>
<failOnMissing>false</failOnMissing>
</configuration>
<executions>
<execution>
<id>baseline</id>
<goals>
<goal>baseline</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>sling-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<!-- ====================================================================== -->
<!-- D E P E N D E N C I E S -->
<!-- ====================================================================== -->
<dependencies>
<dependency>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-services</artifactId>
<version>0.18.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.4</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.17.2</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>0.25.0</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.88</version>
</dependency>
</dependencies>
</project>
After many try and errors, I found what was missing. You need to export the other dependencies as well:
Export-Package: io.opencensus.tags,io.opencensus.stats,com.google.appengine.api.urlfetch,okhttp3.*,okio.*com.google.maps.*
And you need to import this for runtime:
Import-Package: javax.net.*;version=0.0.0

jOOQ can't auto generate classes

I'm trying to auto generate the jOOQ java code for my MySql database, but it's not working. I'm using jOOQ for my JSP project from maven.
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MyHomeProject</groupId>
<artifactId>MyHomeProject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>13</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<executions>
<execution>
<id>generate-mysql</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<jdbc>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/myprojectdb?useSSL=false&serverTimezone=UTC</url>
<user>webuser</user>
<password>webuserP#$$*oR6</password>
</jdbc>
<generator>
<database>
<name>org.jooq.meta.mysql.MySQLDatabase</name>
<includes>.*</includes>
<excludes></excludes>
<inputSchema>public</inputSchema>
</database>
<target>
<packageName>com.myproject.home.jooq</packageName>
<directory>${basedir}\src</directory>
</target>
</generator>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
<!-- jOOQ -->
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.13.2</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-meta</artifactId>
<version>3.13.2</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen</artifactId>
<version>3.13.2</version>
</dependency>
<!-- Other dependencies here -->
<!-- ... -->
<!-- ... -->
<!-- ... -->
</dependencies>
</project>
I'm running this project on eclipse with Tomcat. When I want to run the web application, I clean the project, then Project>properties>Deployment Assembly>Add>Java Build Path Entries>Maven Dependencies.
When I run the project, no java code for database is generated.
As it says in the documentation, since I'm using maven with jOOQ, I can auto generate the JAVA code without need to use cli. And without the need to create a library.xml file.
My issue is that jOOQ doesn't auto generate JAVA files with this pom.xml file. What am I doing wrong? Is there another configurations I need to make?
You specified:
<inputSchema>public</inputSchema>
MySQL doesn't have such a schema by default. Please use the schema of your actual database instead (case sensitive), or omit the inputSchema to generate code for all schemas.

Parallel execution with maven-surefire-plugin is throwing PluginResolutionException

I am trying to execute my feature files via TestRunner.java files (by mentioning them in pom.xml) , in parallel using maven-surefire-plugin, for which i have set up pom.xml as below, but when i run pom.xml as maven test, its throwing PluginResolutionException when the version is 3.0.0-M3, when i have update the version to 2.19.1, the maven test is not running my feature files but the build is shown as successful
I have tried with different versions but not worked
Also I have tried replacing the configuration part with below changes
still my feature files are not executed but the build is
successful
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<!--
<parallel>classes</parallel>
<forkMode>perthread</forkMode>
<threadCount>3</threadCount>
-->
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
PS: After reading the below artical
https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html#Running_tests_in_parallel
I understand that there is link between the Junit version and surefireflugin i use in my project, bow one thing is for sure, the correct combination of Junit and maven-surefire-plugin is very much necessary, i have tried with below combinations
JUnit 4.7
plugin 3.0.0-M3
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.0.0-M3</version>
</dependency>
</dependencies>
</plugin>
JUnit 4.12
plugin 2.20
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<parallel>classes</parallel>
<threadCount>3</threadCount>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
</plugin>
but its not helpful, I suppose i am doing mistake in choosing this versions and the config of plugin with proper parameters, please help me
My complete pom is as below
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.practise.raja</groupId>
<artifactId>SeleniumConcepts</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files (x86)\Java\jdk1.8.0_211\bin\javac</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<parallel>classes</parallel>
<forkMode>perthread</forkMode>
<threadCount>3</threadCount>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expected:
My feature files should run in parallel
Actual:
My feature files are not executed
After changing the dependencies and plugin as suggested by sureshmani, this is how it looks
Finally i am able to solve this, to my initial pom, have started doing below changes. Which ran my feature files in parallel
Change 1: I happen to add the dependency for cucumber-jvm-parallel-plugin along with plugin ,so i have deleted the plugin
Change 2: I have realized that the cucumber-jvm-parallel-plugin is not able to recognize the feature files when I have them placed src/main/java , some of the posts said i have to move all feature files to src/main/resources/feature , where features is package
Change 3: I have realized that cucumber-jvm-parallel-plugin is not able to recognize the resources like step def's and drivers etc, so i have used build-helper-maven-plugin where i have declared the resources as below
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java/</source>
<source>src/main/resources/</source>
<source>features</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Change 4: cucumber-jvm-parallel-plugin in the maven life cycle in my IDE, because for some reason maven is not able to consider this plugin in it execution
Eclipse --> Windoes --> Preferences --> Maven->LifeCycleMappings-> copy paste below code
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<goals>
<goal>generateRunners</goal>
</goals>
<versionRange>[4.2.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
Then , click on "Reload workspace lifecycle mapping metadata" button in Preference
Maven modal
My final pom looks like this
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.practise.raja</groupId>
<artifactId>JUnitCucumberParallelExecutionPractise</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JUnitCucumberParallelExecutionPractise</name>
<description>JUnitCucumberParallelExecutionPractise</description>
<dependencies>
<!-- <dependency>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>5.0.0</version>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
<properties>
<src.main.java>src/main/java</src.main.java>
</properties>
<build>
<resources>
<resource>
<directory>${src.main.java}</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java/</source>
<source>src/main/resources/</source>
<source>features</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files (x86)\Java\jdk1.8.0_211\bin\javac</executable>
</configuration>
</plugin>
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version> 4.2.0</version>
<executions>
<execution>
<id>generateRunners</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generateRunners</goal>
</goals>
<configuration>
<featuresDirectory>src/main/resources/features</featuresDirectory>
<glue>
<package>com.qa.stepdef</package>
</glue>
<outputDirectory>${project.build.directory}/generated-test-
sources/cucumber</outputDirectory>
<cucumberOutputDir>${project.build.directory}</cucumberOutputDir>
<format> json </format>
<strict>true</strict>
<monochrome>false</monochrome>
<useTestNG>false</useTestNG>
<namingScheme>simple</namingScheme>
<namingPattern>Parallel{c}IT</namingPattern>
<parallelScheme>FEATURE</parallelScheme>
</configuration>
</execution>
</executions>
</plugin>
<!-- Specify a custom template for the generated sources (this is a path
relative to the project base directory) -->
<!-- <customVmTemplate>src/test/resources/custom-runner-template.java.vm
</customVmTemplate> -->
<!-- Specify a custom package name for generated sources. Default is no
package. -->
<!--<packageName></packageName> <plugins> <plugin> <name>json</name>
</plugin>
<plugin> <name>html</name> </plugin> <plugin> <name>pretty</name> </plugin>
</plugins> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/*IT.class</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Even after these changes, an error started showing at <execution> in pom, it says
Plugin execution not covered by lifecycle configuration: com.github.temyers:cucumber-
jvm-parallel-plugin:4.2.0:generateRunners (execution: generateRunners, phase:
generate-
But, its fine, i am able to run the feature files in parallel even with this above
error
test-sources)

Error in NonGUIDriver java.lang.IllegalArgumentException

I am trying to run a jmeter script using 'mvn verify' and getting below error. I am new to Jmeter and tried out solutions from previous post but in vain. How to resolve this?
[INFO] Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML <>, missing class com.thoughtworks.xstream.converters.ConversionException:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dap-Jmeter</groupId>
<artifactId>Jmeter</artifactId>
<version>1</version>
<packaging>jar</packaging>
<name>jmeter-maven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>1.App</start-class>
<java.version>1.8</java.version>
<msgpack.version>0.7.0-p3</msgpack.version>
<lombok.version>1.14.8</lombok.version>
<rest.assured.version>2.3.3</rest.assured.version>
</properties>
<dependencies>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-standard</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-extras-libs</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
</executions>
<configuration>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
</jmeterExtensions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Check target/jmeter/logs folder, it should have full log file for your test(s), my expectation is that your test relies on a plugin or a third-party .jar file which is missing in the JMeter Classpath, if you need all this stuff like RestAssured and Lombok in your test you need to add them a little bit differently to wit
<configuration>
<testPlanLibraries>
<artifact>org.msgpack:msgpack-core:0.7.0-p3</artifact>
<articact>org.projectlombok:lombok:1.14.8</articact>
<artifact>com.jayway.restassured:rest-assured:2.3.3</artifact>
</testPlanLibraries>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
<articact>kg.apc:jmeter-plugins-standard:1.4.0</articact>
</jmeterExtensions>
<downloadExtensionDependencies>false</downloadExtensionDependencies>
</configuration>
Full pom.xml just in case:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>com.example.jmeter</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<testPlanLibraries>
<artifact>org.msgpack:msgpack-core:0.7.0-p3</artifact>
<articact>org.projectlombok:lombok:1.14.8</articact>
<artifact>com.jayway.restassured:rest-assured:2.3.3</artifact>
</testPlanLibraries>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
<articact>kg.apc:jmeter-plugins-standard:1.4.0</articact>
</jmeterExtensions>
<downloadExtensionDependencies>false</downloadExtensionDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
References:
Adding jar's to the /lib directory
Adding jar's to the /lib/ext directory
JMeter Maven Plugin Wiki
Five Ways To Launch a JMeter Test without Using the JMeter GUI
The below POM solved the issue.
<dependencies>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-extras-libs</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-casutg:2.4</artifact>
<artifactId>kg.apc:jmeter-plugins-extras-libs:1.3.1</artifactId>
</jmeterExtensions>
<!-- The plugin uses some broken dependencies
An alternative is to set this to true and use excludedArtifacts, see below
-->
<downloadExtensionDependencies>false</downloadExtensionDependencies>
</configuration>
</plugin>
</plugins>
</build>

maven-processor-plugin to ignore undefined symbols

I've JPA 2 maven project and I want to process sources to have the static meta model. What I did I took JBoss' static meta model processor and set it up to run during generate-sources phase. Now, obviously I have some classes that reference the meta model and compilation itself goes fine. But maven-processor-plugin itself generates errors complaining that it can't find symbols from meta model like this:
[INFO] --- maven-processor-plugin:2.2.4:process (process) # ng-grid-java ---
[ERROR] diagnostic: c:\...\service\position\PositionSpecifications.java:13: cannot find symbol
symbol : class Position_
Which is logical because it actually generates these classes, but is not right since it brings errors to an otherwise correct project. Or maybe I'm using it wrong? Am I missing something?
Update: I have been able to inhibit the error output by using configuration parameter outputDiagnostics but I'm not sure that's the right way.
The solution could be adding the generated classes to project classpath using the build-helper-maven-plugin, as follows:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>artifactId</artifactId>
<groupId>groupId</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>jpa-metamodel-generation</artifactId>
<dependencies>
<!-- Hibernate JPA metamodel generator -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.2.0.Final</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<!-- Plugin to generate JPA metamodel -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<outputDirectory>${project.build.directory}/metamodel</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
</plugin>
<!-- Build helper plugin to add generated sources to classpath -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/metamodel</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I have setted the phase-s of the plugins like:
build-helper-maven-plugin --> <phase>process-sources</phase>
and
maven-processor-plugin --> <phase>compile</phase>

Resources