Jmeter plugin , does not take the keystore provided in properties - maven

Jmeter plugin does not seem to load the system variables provided in the configuration tab.
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<propertiesSystem>
<javax.net.debug>all</javax.net.debug>
<javax.net.ssl.keyStore>${basedir}/src/test/resources/clientKeystoreFin.jks</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>changeit</javax.net.ssl.keyStorePassword>
<https.socket.protocols>TLSv1</https.socket.protocols>
<sun.security.ssl.allowUnsafeRenegotiation>true</sun.security.ssl.allowUnsafeRenegotiation>
</propertiesSystem>
<ignoreResultFailures>true</ignoreResultFailures>
</configuration>
</execution>
</executions>
</plugin>
After providing this and executing the plugin does not really seem to validate the keystore, I don't find any realted logs in the jmeter log, I even tried providing the system.properties file in the ${basedir}/src/test/jmeter, as stated here
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Modifying-Properties
Even that doesn't works.
With the same system.properties file changes i was able to run from the jmeter GUI.
Can somebody help me in pointing out the problem here.

The reason was just the older version of the plugin i used. Updated to latest 1.10.1, and enabled some of the logs adding the following in the configuration
*
<overrideRootLogLevel>DEBUG</overrideRootLogLevel>
<suppressJMeterOutput>false</suppressJMeterOutput>
<jmeterLogLevel>DEBUG</jmeterLogLevel>
Now i could clearly see the ssl logs in the command prompt where i run the maven verify and the keystore file is added.Hope this would help somebody who are struck up with the same issue.

Related

JMeter automation using Maven - getting error while trying to run JMS files

Below image shows an error after running JMS publisher via JMeter:
When my automation script runs it downloads JMeter in target folder, but I see jndi.jar and jms.jar missing in lib folder when JMeter is downloaded via automation script.
Could anyone please help me on how to solve the mentioned issue?
When it comes to JMeter Maven Plugin you need to explicitly list all your dependency .jar libraries under <testPlanLibraries> section like:
<project>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>USE LAST VERSION</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- HERE YOU NEED TO ADD YOUR JMS IMPLEMENTATION JARS-->
<testPlanLibraries>
<artifact>org.apache.activemq:activemq-spring:5.15.2</artifact>
<artifact>org.apache.activemq:activemq-client:5.15.2</artifact>
<artifact>org.apache.activemq:activemq-broker:5.15.2</artifact>
</testPlanLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
This way JMeter Maven plugin will locate the .jar(s), download them and put them under JMeter Classpath so you will be able to use external libraries in your JMeter test
More information:
Adding Excluding libraries to from the classpath
How to Use the JMeter Maven Plugin

Are directions available for the maven plugin com.alexnederlof jasperreports-plugin?

I have read up on the limited information regarding com.alexnederlof jasperreports-plugin and I'm looking to convert my current ant build to use this maven plugin, but there doesn't seem to be any documentation available.
My biggest concern is run-time: If I use this plugin at build-time, what version of jasper-reports do I need to use at run-time?
Am I missing a reference somewhere? As the old adage goes, "If there isn't any documentation, then I guess I'll have to write it."
I am not sure of what you are after but, I am using this plugin in maven to generate the source .jrxml files to .jasper files and the configuration in pom goes like this:
<plugin>
<groupId>com.alexnederlof</groupId>
<artifactId>jasperreports-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>jasper</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- These are the default configurations: -->
<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
<sourceDirectory>src/main/jasperreports</sourceDirectory>
<outputDirectory>${basedir}/src/main/webapp</outputDirectory>
<outputFileExt>.jasper</outputFileExt>
<xmlValidation>true</xmlValidation>
<verbose>false</verbose>
<numberOfThreads>4</numberOfThreads>
<failOnMissingSourceDirectory>true</failOnMissingSourceDirectory>
<sourceScanner>
org.codehaus.plexus.compiler.util.scan.StaleSourceScanner
</sourceScanner>
</configuration>
</plugin>
Hope this helps

selecting test file (jmx file) not working with jmeter-maven-plugin

I want to select only one JMeter test file (jmx file) to run at one time. I have the following in my pom.xml:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<testFilesIncluded>
<jMeterTestFile>ionix-${foo.bar}.jmx</jMeterTestFile>
</testFilesIncluded>
<overrideRootLogLevel>DEBUG</overrideRootLogLevel>
<testResultsTimestamp>false</testResultsTimestamp>
</configuration>
</execution>
</executions>
</plugin>
I have multiple jmx files in src/test/jmeter. It turns out those jmx files are always run by the jmeter plugin no matter what, even if I run maven with command like below:
mvn clean -Dfoo.bar=nonsense jmeter:jmeter
According to the documentation, my settings above should only execute ionix-${foo.bar}.jmx. (Whether the file ionix-${foo.bar}.jmx exists doesn't seem to make a difference in my case.) So, what am I missing here?
Thank you very much.
Enable debug in Maven by adding -X to see what is happening .
could you list content of folder that contains jmx files

get maven to replace values based on user/build.properties

im at the point in my project where im moving data connections to the beta and production databases for testing. obviously, having the alpha database credentials stored in the source repository is fine, but the beta and production credentials, id be put in front of a firing squad for that one.
i know maven can have a {userdir}/build.properties file. this is the file i want to use to keep the db credentials out of the source repository. but i can't seem to get maven to figure out that for file x.cfg.xml it has to replace values.
so i have in one of my hibernate.cfg.xml files this line
<property name="hibernate.connection.url">#ssoBetaUrl#</property>
now how do i get maven to replace that variable with the value thats in the {userdir}/build.properties file?
edit-------------
ive been playing with the properties-maven-plugin plugin but i seem to not be able to get it to fire. i put this in my parent pom
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>read-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
</executions>
</plugin>
but when it builds, it does not fire. if im reading http://maven.apache.org/maven-1.x/reference/properties.html right it should find the build properties file in the ~/build.properties folder and go from there, but im not sure.
I think you are approaching this the wrong way around. Instead of having the build process bake the appropriate connection details into the JAR file you should instead have the program look for a configuration file at startup.
Typically, my hibernate based apps, will look for a file under %user.home&/.appname/config.properties and load DB credentials and other deployment specfic data from there. If the file is missing, a default version can be included in the JAR and copied to this location (on initial startup so you don't have to copy-paste the file to new systems) that is then edited with appropriate settings.
This way, you can use the same build to produce JAR (or WAR) files for test and production servers, the differences will be in the (presumably already deployed) configuration files. This also makes it possible to have multiple production deployments, each talking to a different database, without any complications in the build process.
You could use two plugins.
properties-maven-plugin
replacer
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>{userdir}/build.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>target/**/*.*</include>
</includes>
<replacements>
<replacement>
<token>#ssoBetaUrl#</token>
<value>http://[anyURL]</value>
</replacement>
</replacements>
</configuration>
</plugin>

JAXB2 Maven Plugin not reading Configuration

I am trying to generate some JAXB classes via my schema. I have my jaxb2 maven plugin configured the following way.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<packageName>aces.soa.schema</packageName>
<generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
<schemaDirectory>${basedir}/src/main/resources/schema/ea</schemaDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
When running the mvn jaxb2:xjc it complains that it cannot find the Schema, which is in the src/main/resources/schema/ea directory. When executing mvn -X jaxb2:xjc I see that the variables are not getting set at all. Is there something else I need to do to configure the plugin propoerly?
There's an issue with running this plugin with configuration elements in the execution elements, when the plugin is being called using:
mvn jaxb2:xjc
A workaround for me was using:
mvn generate-sources
Actually no. Having configuration outside executions configures the plugin globally. Here is the doc: http://mojo.codehaus.org/jaxb2-maven-plugin/usage.html
So, you should be able to configure each execution but it does not work some reason :( The question is still valid

Resources