How to config "pom.xml" to jmeter - jmeter

My POM.xml is
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.idea.perf.test</groupId>
<artifactId>jmeter-perf-tests</artifactId>
<version>4.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>jmeter-perf-tests</name>
<properties>
<jmeterScriptFile>Jmeter-Gemini-UI-RatePlanReport.jmx</jmeterScriptFile>
<jmeterThreads>2</jmeterThreads>
<jmeterRampUpTime>1</jmeterRampUpTime>
<jmeterLoopCount>1</jmeterLoopCount>
<Port>443</Port>
<UrlProtocol>https</UrlProtocol>
<UrlDomainName>stageg.com</urlDomainName>
<PropertyList>..\..\..\src\test\properties\GeminiStressboxUI.csv</PropertyList>
<BinaryDir>..\..\..\src\test\binaries</BinaryDir>
<jmeterRunScriptFor>RPtHomePage,SelectRCRange,SelectDateRange,SelectMultiPropertyGroups</jmeterRunScriptFor>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-common</artifactId>
<version>3.2.0.3978</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-core</artifactId>
<version>3.2.0.3978</version>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>a</artifactId>
<version>1.2</version>
<classifier>id</classifier>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>blazemeter</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>a_newAmfProxyConverter</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
<dependency>
<groupId>serializeFlex</groupId>
<artifactId>org.racso.jmeter</artifactId>
<version>0.0.1</version>
<classifier/>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>amf_custom_plugin</artifactId>
<version>1.0</version>
<classifier>idea</classifier>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>b</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-assets</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/../jmeter/lib/ext</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>JMeter-AMF</artifactId>
</artifactItem>
<artifactItem>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-common</artifactId>
</artifactItem>
<artifactItem>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-core</artifactId>
</artifactItem>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>a</artifactId>
<classifier>idea</classifier>
</artifactItem>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>a_newAmfProxyConverter</artifactId>
<classifier/>
</artifactItem>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>blazemeter</artifactId>
<classifier/>
</artifactItem>
<artifactItem>
<groupId>serializeFlex</groupId>
<artifactId>org.racso.jmeter</artifactId>
<classifier/>
</artifactItem>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>b</artifactId>
<classifier/>
</artifactItem>
<artifactItem>
<groupId>org.apache.jmeter</groupId>
<artifactId>amf_custom_plugin</artifactId>
<classifier>idea</classifier>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Execute JMeter Script-->
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.9.0</version>
<configuration>
<suppressJMeterOutput>false</suppressJMeterOutput>
<overrideRootLogLevel>debug</overrideRootLogLevel>
<jmeterLogLevel>DEBUG</jmeterLogLevel>
<testFilesIncluded>
<testFilesIncluded>${jmeterScriptFile}</testFilesIncluded>
</testFilesIncluded>
<jMeterProcessJVMSettings>
<xms>4096</xms>
<xmx>4096</xmx>
<arguments>
<argument>-Xprof</argument>
<argument>-Xfuture</argument>
</arguments>
</jMeterProcessJVMSettings>
<propertiesUser>
<jmeterThreads>${jmeterThreads}</jmeterThreads>
<jmeterRampUpTime>${jmeterRampUpTime}</jmeterRampUpTime>
<jmeterLoopCount>${jmeterLoopCount}</jmeterLoopCount>
<UrlProtocol>${UrlProtocol}</UrlProtocol>
<Port>${Port}</Port>
<UrlDomainName>${rlDomainName}</UrlDomainName>
<PropertyList>${PropertyList}</PropertyList>
<BinaryDir>${BinaryDir}</BinaryDir>
<jmeterRunScript>${jmeterRunScript}</jmeterRunScript>
</propertiesUser>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Execute JMeter Reports-->
<!--<plugin>-->
<!--<groupId>com.lazerycode.jmeter</groupId>-->
<!--<artifactId>jmeter-analysis-maven-plugin</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>analyze</goal>-->
<!--</goals>-->
<!--<phase>post-integration-test</phase>-->
<!--<configuration>-->
<!--<source>${project.build.directory}/jmeter/results/*</source>-->
<!--<targetDirectory>${project.build.directory}/reports</targetDirectory>-->
<!--<generateCSVs>true</generateCSVs>-->
<!--<generateCharts>true</generateCharts>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
</plugins>
</build>
</project>
Can you please suggest where I should put this file and how I can read values from this file into JMeter?
For example:
<jmeterThreads>${jmeterThreads}</jmeterThreads> <-- How do I use this variable in a JMeter script?
Other variables I would like to use are:
<jmeterRampUpTime>${jmeterRampUpTime}</jmeterRampUpTime>
<jmeterLoopCount>${jmeterLoopCount}</jmeterLoopCount>

Assuming you define the following block:
<properties>
<jmeterThreads>1</jmeterThreads>
</properties>
You should be able to add the following section to the JMeter Maven Plugin declaration:
<configuration>
<propertiesUser>
<jmeterThreads>${jmeterThreads}</jmeterThreads>
</propertiesUser>
</configuration>
and refer the value using __P() function in your JMeter test where required as:
${__P(jmeterThreads)}
Additionally you can amend the value using -D command-line argument like:
mvn -DjmeterThreads=100 clean verify
Other properties should be handled just the same way.
References:
Adding Additional Properties To
Maven POM Reference: Properties
Five Ways To Launch a JMeter Test without Using the JMeter GUI
Full pom.xml file 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>org.apache</groupId>
<artifactId>jmeter-maven</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<jmeterThreads>1</jmeterThreads>
</properties>
<build>
<plugins>
<plugin>
<configuration>
<propertiesUser>
<jmeterThreads>${jmeterThreads}</jmeterThreads>
</propertiesUser>
</configuration>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.8.1</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>
</plugin>
</plugins>
</build>
</project>

The layout should be:
To pass parameters, enter in pom.xml as child of configuration:
<propertiesJMeter>
<BUILD_TAG>${project.version}</BUILD_TAG>
<threads>7</threads>
<duration>30</duration>
</propertiesJMeter>
And in jmeter, to use threads for example, you would use __P function:
${__P(threads,5)
This blog explains the whole process.

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

Make Intellij IDE run the Kotlin/Java annotation processing when changing Kotlin source files

Recently I have started using Kotlin v1.2 with Intellij IDEA v2017.3.
I implemented an annotation processor in Kotlin, which writes a resource file under META-INF, when a class is annotated with the supported annotation type.
I can see that the annotation processor is working with another Maven project, which is using the implementation as a dependency. If I run mvn clean compile, the file under META-INF is generated correctly in target/classes/META-INF.
My problem is that Intellij does not start the annotation processor when a source file is changed. For example, if I rename the annotated Kotlin class. The resource file is not regenerated or updated. (I haven't seen the annotation processor working yet from Intellij...)
I also enabled annotation processing and configured "obtain processors from project classpath" within the IDE like described here.
I imported the project as a Maven project here is my pom.xml - like I said: It is working when building with Maven:
<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>org.example</groupId>
<artifactId>usage</artifactId>
<version>1</version>
<properties>
<kotlin.version>1.2.0</kotlin.version>
</properties>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
<executions>
<execution>
<id>kapt</id>
<phase>generate-sources</phase>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
</sourceDirs>
<annotationProcessors>
<annotationProcessor>org.example.MyProcessor</annotationProcessor>
</annotationProcessors>
</configuration>
</execution>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<!-- Dependency containing the annotation processor -->
<dependency>
<groupId>org.example</groupId>
<artifactId>processor</artifactId>
<version>1</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

How to include files that are built (during build) in the built jar?

This might be dumb (please guide me), but I'm trying to include some binaries from a dependency in my package using Maven.
The dependency is jinput, and the binaries are "unpacked" during build. Since the binaries are unpacked after the build, they're not included in my .jar using the standard "resources"-way of including files. How can I make Maven include the binaries in my package when they aren't present during the build?
<?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.mycompany</groupId>
<artifactId>ProjectA</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>net.java.jinput</groupId>
<artifactId>jinput</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Unpack the jinput binaries to "bin" -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack jinput windows</id>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<skip>false</skip>
<artifactItems>
<artifactItem>
<groupId>net.java.jinput</groupId>
<artifactId>jinput-platform</artifactId>
<version>2.0.7</version>
<classifier>natives-windows</classifier>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>/bin</outputDirectory>
<includes>**/*.dll</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${project.builddir}</directory>
<includes>
<include>bin/*.dll</include>
</includes>
</resource>
</resources>
</build>
</project>
Instead of resources, you can use maven-jar-plugin.
I've tested the below code and it works fine.
<properties>
<my.dll.folder>${project.build.directory}/unpackedfiles</my.dll.folder>
</properties>
<dependencies>
<dependency>
<groupId>net.java.jinput</groupId>
<artifactId>jinput</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>net.java.jinput</groupId>
<artifactId>jinput-platform</artifactId>
<version>2.0.7</version>
<classifier>natives-windows</classifier>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${my.dll.folder}/bin</outputDirectory>
<destFileName>optional-new-name.jar</destFileName>
<includes>**/*.dll</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${my.dll.folder}</classesDirectory>
<classifier>sample</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Once your pom file is modified with above code, you can execute below command
mvn clean package
Then you can verify that the resulting jar file contains the required *.dll files in bin folder.
You can remove the <classifier> tag if you want to overwrite the same output jar file.

how to import java files from ejb module in web app?

i create ear project and i have 2 module named:
mavenproject4-web
mavevnproject4-ejb
i try to import some interface and entity from ejb module in web module.But i can't.
i tried to add ejb module as dependency into web module by pom.xml.Then my problem fixed.Is it right way?
after adding dependency i tried to run project and i got this exception:
Severe: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [mysessionbeans.StudentDAOImpl/entityManager] in the scope of the module called [mavenproject4-ear#mavenproject4-ejb-1.0.jar]. Please verify your application.
my persistence xml is in "src/main/resources" in ejb module.Detail information about project structure in image:
My web app pom.xml
<?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>
<parent>
<artifactId>mavenproject4</artifactId>
<groupId>az.lsim</groupId>
<version>1.0</version>
</parent>
<groupId>az.lsim</groupId>
<artifactId>mavenproject4-web</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>mavenproject4-web</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>az.lsim</groupId>
<artifactId>mavenproject4-ear</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Thanks
The ejb jar file will need to be in the ear file. But I also think that the persistence.xml file needs to be in META-INF folder in the EJB jar file. I suspect that the way you have it there, it's in the root folder. Try moving it to src/main/resources/META-INF/persistence.xml
See http://docs.oracle.com/cd/E14101_01/doc.1013/e13981/pkgapp001.htm

How can I add classpath location by using mojo appassembler plugin while creating batch file

I am using appassembler plugin from mojo for creating a runnable batch/shell script for my application. I have to add a particular directory to my classpath, so what changes should I do in my pom.xml configuration for mojo's plugin.
Currently classpath is generated with all required library path in my batch file as below
set CLASSPATH=%BASEDIR%\abc.jar;%REPO%\*.properties
All I need to do is add a separate variable like MY_PATH and add it to the classpath as below
set MY_PATH=%BASEDIR%\resources
set CLASSPATH=%BASEDIR%\abc.jar;%REPO%\*.properties;%MY_PATH%
To add to further there is a tag <configurationDirectory> but that I have already provided for a different directory, now if I have to add further more directory then what would be solution?
How can i achieve it? Below is the 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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>jgcode-framework-parent</artifactId>
<groupId>com.jaggs</groupId>
<version>1.0.2</version>
</parent>
<groupId>com.jaggs.server</groupId>
<artifactId>jaggs-code-server</artifactId>
<version>1.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.jaggs.password</groupId>
<artifactId>mypassword</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<configuration>
<repositoryLayout>flat</repositoryLayout>
<installArtifacts>false</installArtifacts>
<assembleDirectory>${project.build.directory}/appassembler</assembleDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<platforms>
<platform>windows</platform>
<platform>unix</platform>
</platforms>
<defaultJvmSettings>
<initialMemorySize>256M</initialMemorySize>
<maxMemorySize>256M</maxMemorySize>
</defaultJvmSettings>
<programs>
<program>
<name>ManualDataEntry</name>
<mainClass>com.jaggs.bean.ManualDataEntry</mainClass>
</program>
</programs>
<configurationDirectory>\..\..\jaggs\sec\configuration\</configurationDirectory>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assemble.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>com.jaggs.bean.ManualDataEntry</mainClass>
</manifest>
<manifestEntries>
<Class-Path>/jaggs/sec/configuration/</Class-Path>
</manifestEntries>
</archive>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
</configuration>
<executions>
<execution>
<id>my-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<escapeString>\</escapeString>
</configuration>
</plugin>
</plugins>
</build>

Resources