Add JMeter plugin programmatically - non gui mode - jmeter

I am trying to use jmeter-plugins.
Does it have to be placed only under /lib/ext folder?
Is there any way for me to refer to the plugin jar using some properties?
(like user.classpath property to refer to my custom lib)

If you don't want to put JMeter plugin jars in the lib/ext directory, then define the property search_paths in jmeter.properties.

After placing the plugin manager jar in the /lib/ext/ you need to do the following to install a particular plugin.
Download the latest cmdrunner from this URL by changing the version.
wget http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar
Copy the cmdrunner to jmeter/lib/ directory
mv cmdrunner-2.2.jar apache-jmeter-5.1.1/lib/
Execute the following command to generate script file PluginsManagerCMD
java -cp apache-jmeter-5.1.1/lib/ext/jmeter-plugins-manager-1.3.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
After the script is generated, you can use it to install a particular plugin
apache-jmeter-5.1.1/bin/PluginsManagerCMD.sh status
apache-jmeter-5.1.1/bin/PluginsManagerCMD.sh available
apache-jmeter-5.1.1/bin/PluginsManagerCMD.sh install jpgc-tst=2.5

Download cmdrunner in lib folder
cd apache-jmeter-5.4/lib
curl -O https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar
download-cmd
Download jmeter plugin Manager in lib/ext folder
cd ext/
curl -O https://repo1.maven.org/maven2/kg/apc/jmeter-plugins-manager/1.6/jmeter-plugins-manager-1.6.jar
Install plugins
cd ..
java -jar cmdrunner-2.2.1.jar --tool org.jmeterplugins.repository.PluginManagerCMD install jpgc-webdriver

Related

Download plugin jar file and put it in the lib/ext

I have a problem that I want to execute JMeterPluginsCMD.bat command so I just download the jmeter-plugins-cmd-2.2.jar file and put it in the lib/ext folder but I still cannot run JMeterPluginsCMD.bat command. I' m wondering if the JMeterPluginsCMD.bat file should show in my bin folder after putting jar in the lib/ext? If it should, then why my JMeterPluginsCMD.bat file is not shown? Please help, thanks!
If you're looking for JMeterPluginsCMD.bat file you can grab one from here:
https://github.com/undera/jmeter-plugins/blob/master/tools/cmd/src/main/resources/kg/apc/cmdtools/JMeterPluginsCMD.bat
Be aware that the recommended way of installing JMeter plugins and keeping them up-to-date is using JMeter Plugins Manager
Install JMeter Plugins Manager
Restart JMeter
Open the plugins manager and install Command-Line Graph Plotting Tool
Restart JMeter once again and you will have JMeterPluginsCMD.bat in your JMeter's "bin" folder

AEM Publisher 6.5 - No bin Directory

I am starting AEM in publish mode using the quickstart jar:
java -jar cq-publish-p4506.jar
Under the crx-quickstart directory, i see only one directory, repository. There is no bin directory created under it
crx-quickstart/
repository/
What can i do to make AEM create the bin directory with start/stop scripts?
Run
java -jar <CQ_JAR_PATH> -unpack -v
This will extract for you.
Then edit the start or quickstart files to set the run mode to publish and port to 4506.
You can then use the start/stop/quickstart scripts to start AEM.
The bin directory is under crx-quickstart, not under repository.

Error: Unable to access jarfile build/libs/gs-spring-boot-0.1.0.jar?

I follow the instructions in https://spring.io/guides/gs/spring-boot/#scratch, but when it says to run:
./gradlew build && java -jar build/libs/gs-spring-boot-0.1.0.jar
the build fails with the above error.
There is message before the failure that says:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
but everyone online says that's just a warning.
The build doesn't appear to create or download build/libs/gs-spring-boot-0.1.0.jar.
Currently completely blocked on first attempt to use Gradle.
I just had this problem.
The tutorial is in error in what you need to run. It should be
$ gradlew build && java -jar build/libs/gs-rest-service-0.1.0.jar
I think that they updated the code, but forgot to update the tutorial.
I had the same issue when build a simple project with Maven on Intellij IDEA. (Ubuntu 18.04.2).
Just typed terminal (in project directory):
$ sudo mvn package
$ java -jar ./target/(your-project-name)-(<version> at pom.xml).jar
For example my project name is hello-world-spring and version name in pom.xml is <version>0.0.1-SNAPSHOT</version>, I have to type:
$ sudo mvn package
$ java -jar ./target/hello-world-spring-0.0.1-SNAPSHOT.jar
Maybe this method can work for gradle as well.
Please check the path of the jar file build/libs/gs-spring-boot-0.1.0.jar. For your case, the jar might be in a different folder. If your code is in a module in the main project, then the jar will be in the build folder of the module.
If you git clone the repo, then the tutorial works. If you "To start from scratch, move on to Build with Gradle.", then the tutorial doesn't work. There are missing setup steps.
I got the same issue and I changed the command to java -jar target/rest-service-0.0.1-SNAPSHOT.jar (I checked the .jar file in target folder and found that the file name was incorrect).
Parent folder of my project was having spaces in it's name, i changed it to the underscore and it worked.
Looked at the command line as it was in the official guide:
./gradlew clean build && java -jar build/libs/gs-actuator-service-0.1.0.jar
First, the above command line has two parts:
(1) ./gradlew clean build //Use gradle wrapper to build
(2) java -jar build/libs/gs-actuator-service-0.1.0.jar //To run an application packaged as a JAR file
Now, one might run into issues with one part or both parts. Separating them and running just on thing at a time helped troubleshoot.
(1) didn't work for my Windows, I did the following instead and that built the application successfully.
.\gradlew.bat clean build
Now moving to (2) java -jar build/libs/gs-actuator-service-0.1.0.jar
It literally means that "Run a jar file that is called gs-actuator-service-0.1.0.jar under this directory/path: build/libs/" Again, for Windows, this translates to build\libs\ , and there's one more thing that may catch you: The jar file name can be slightly different depending on how it was actually named by the configuration in initial/setting.gradle:
rootProject.name = 'actuator-service'
Note that the official guide changed it from 'gs-actuator-service' to 'actuator-service' in their sample code but hasn't updated the tutorial accordingly. But now you know where the jar file name comes from, that doesn't matter anymore, and you have the choice to rename it however you want.
Having all the factors adjusted, below is what eventually worked in my case:
java -jar build\libs\actuator-service-0.0.1-SNAPSHOT.jar
or
java -jar C:\MyWorkspace\Spring\gs-actuator-service\initial\build\libs\actuator-service-0.0.1-SNAPSHOT.jar //with fully qualified path
If you are curious where does "-0.0.1-SNAPSHOT" come from, here it is:
in build.gradle
version = '0.0.1-SNAPSHOT'
Again, you have the choice to modify it however you want. For example, if I changed it to 0.0.2-SNAPSHOT, the command line should be adjusted accordingly
java -jar build\libs\actuator-service-0.0.2-SNAPSHOT.jar
Reference: https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html
Because you are trying to execute .jar file that doesn't exist. After building the project go to ./build/libs and check the name of freshly built .jar file and then in your project directory run:
./gradlew build && java -jar build/libs/name-of-your-jar-file.jar
or you can set version property to empty string in your build.gradle file
version = ''
after that:
./gradlew build && java -jar build/libs/your-project-name.jar
For Windows, these commands solved the problem: "Error: Unable to access jarfile springboot.jar":
cd target
java -jar springboot-0.0.1-SNAPSHOT.jar
run ./mvnw package
Now a folder named target is created and you can see a jar file inside it.
then execute java -jar target/<jarfilename>

Can we configure settings.xml to our own location in maven

Recently I am working with Apache Maven in Windows machine.
I am executing maven from Command Prompt every time.
I know that MAVEN will pick its settings.xml from C:\Users\abc\.m2\settings.xml
Question: Can't I change this settings.xml to be picked from my own provided location instead of default location, like C:\Users\abc\.m2\settings.xml
That is, instead of C:\Users\abc\.m2\settings.xml location I will configuring it in F:\myFolder\settings.xml.
If so, what are the steps I need to follow and check?
You can change the location of user settings using the -s option from the command line:
-s,--settings <arg> Alternate path for the user settings file
You could hence invoke Maven as following:
mvn clean install -s F:\myFolder\settings.xml
If you don't want to specify it at each and every invocation, since Maven 3.3.1 you can specify a .m/config folder in your project folder and a maven.config file in it providing this option.
The .m/config/maven.config file would have in your case the following content:
-s F:\myFolder\settings.xml
And it will be applied to all Maven invocation for that project.

How run mahout in action example ReutersToSparseVectors?

I want run "ReutersToSparseVectors.java". I can compile and created JAR file without problem.
I compiled this file by below command:
javac -classpath hadoop-core-0.20.205.0.jar:lucene-core-3.6.0.jar:mahout-core-0.7.jar:mahout-math-0.7.jar ReutersToSparseVectors.java
created JAR file with below command:
jar cvf ReutersToSparseVectors.jar ReutersToSparseVectors.class
When I write java -jar ReutersToSparseVectors.jar to run, give me below error:
Failed to load Main-Class manifest attribute from
ReutersToSparseVectors.jar
Do you can help me to solve this problem?
IF this example can run with hadoop, please me that how i can run this with hadoop.
instead of using -jar option, then it's better to to run:
java -cp mahout-core.jar:... mia.clustering.ch09.ReutersToSparseVectors
or you can use mvn exec:java command, as described in README for examples...
mvn exec:java -Dexec.mainClass="mia.clustering.ch09.ReutersToSparseVectors"
Or you can run this file directly from your IDE (assuming, that you correctly imported Maven project).
P.S. your command isn't working, because to run with -jar switch, the .jar file should have special entry in manifest that describes that class should be started by default...
P.P.S. It's better to use book's examples with Mahout 0.7, as they were tested for it. You can use it with version 0.7 if you need, by then you need to take source code from mahout-0.7 branch of repository with examples (link is above)

Resources