问题
I'm starting my work on the project related to creating some custom set of jmeter components that would be bundled in my custom jmeter distribution.
Those custom components are part of the Maven project and what I would like to do is try to integrate this maven project with latest jmeter project to be able to build and deliver jmeter build that contains my custom set of components with all related dependency jars.
Problem is that jmeter project is ant project. I've came across this: http://maven.apache.org/guides/mini/guide-using-ant.html, maven-antrun-plugin which gives a possibility to embed ant task inside the maven pom.
Since I've never worked with ant (only worked with maven), my idea of using this plugin inside pom would be to define following targets:
- download jmeter source from svn repository
- build jmeter distribution
- after building maven project (after install phase), copy jars (component and dependency jars) to the jmeter lib to form the final jmeter distribution with my custom components.
My question is: Do you find this approach as the right one (are there some things to consider while doing this) and if not, can you suggest me some other ways of achieving the same goal?
Thanks in advance
回答1:
Since JMeter 2.6, Apache JMeter artifacts are published on maven2 repositories.
See:
- http://mvnrepository.com/artifact/org.apache.jmeter/
See for an example :
- https://github.com/Ronnie76er/jmeter-maven-plugin/wiki
So what you can do is have your maven project that references these artifacts as dependencies.
And if you want to generate a full bundle containing JMETER+You Plugins then use AntRunner to :
- Unzip the official distribution
- Copy your artifact in jmeter/lib/ext and dependencies in jmeter/lib
- rezip it
来源:https://stackoverflow.com/questions/12459394/integrating-jmeter-as-part-of-maven-project