Maven Chronos plugin - maven-2

I have a problem with Maven Chronos plugin. Is it possible to tell plugin a mask for name of jmx files to execute?
Thx

It is still not possible to use the chronos plugin to proces files based on a mask. It is possible to select a folder containing tests (.jmx-files), which should be good enough for most cases.

I have a problem with Maven Chronos plugin. Is it possible to tell plugin a mask for name of jmx files to execute?
No, this is currently not supported, the chronos plugin is limited to process only one .jmx/.jtl that you must "hard code" in the POM. But an issue has been logged as MOJO-1460 to enhance the plugin and make it able to process multiple scenario. It's not exactly what you're asking for but it might provide a decent alternative (and there is a patch attached).
Do you know if I can run multiple jmeter tests with any other plugin?
I double checked and it appears that the maven-jmeter-plugin can do that (and even supports includes and excludes if required).
A more recent version of the plugin (using JMeter 2.3) was hosted on Google's code and can now be found on github.

Related

Is there a way to run Karate tests as an integration test suite against a pre-booted spring boot server?

Is there any good way to get Karate tests to test a Spring-Boot microservice in the "integration-test" phase of a Maven build? What I mean is: is there an anti-pattern/workaround that works well OR am I out of luck because this was an afterthought of the Karate development?
Facts I have gathered so far:
It says here: "the surefire plugin is not hardcoded into Karate"
Is there a way to run Karate test during maven's integration test phase?
Running Karate tests in context of maven-failsafe-plugin does not work at all. Easy to reproduce on my test project url below. Two problems foremost:
When running from maven-failsafe, Karate will generate .txt and .html files but does not generate .json Cucumber output files.
Therefore, you can get no HTML report from the cucumber-reporting plugin (which I require)
I created a project to demonstrate these facts: https://github.com/djangofan/karate-api-sample
Running integration tests requires that I start Spring Boot before the test suite and then stop the spring boot server afterwards. Maven SureFire does not have this capability BUT the maven failsafe plugin does: the maven build helper plugin has a pre-integration-test hook for it. Limited only by Maven surefire, I am out of luck.
I see an example in the karate/karate-demo project of starting the spring boot server from code. This is not easy to accomplish when I am trying to test a web service that is already established. Is this my only option: to use surefire with a class filter and code to bootstrap?
Given no good answer, I will just revert to using cucumber-java + resteasy, which I am pretty sure will work with maven failsafe: https://maven.apache.org/surefire/maven-failsafe-plugin/examples/cucumber.html
First, this is not Karate.js not sure where that came from :)
When running from maven-failsafe, Karate will generate .txt and .html files but does not generate .json Cucumber output files.
Sorry, cannot replicate.
For failsafe, just use the naming conventions and it will work, e.g. **/IT*.java
Maven SureFire does not have this capability BUT the maven failsafe plugin does:
So use failsafe as mentioned above. If you are not able to do that, please change your project to demonstrate the issue and we promise to fix it. Also refer these instructions: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
Given no good answer, I will just revert to using cucumber-java + resteasy
That is of course your choice. At least in my (biased :) opinion you will miss all the JSON assertion value that Karate adds, and the parallel execution + aggregation of reports. I am sure you will help as far as possible so that we can make the experience better for all who need this solution - but else, hey - no worries :P

Eclipse plugin is listed with other plug-ins, but UI contributions are missing

I wrote two Eclipse plugins that work fine when I use Eclipse to run them in another instance of Eclipse. I'd like to distribute the plugins to a relatively small number of people for feedback and was hoping that the dropins folder would provide a quick and dirty solution. When I put the plugins in the dropins folder of my Eclipse installation (Indigo), I see the plugins listed with other plugins in the installation details. The UI contributions are missing and I haven't been able to find any error messages in the logs or otherwise.
As stated, I'm looking for a quick and dirty solution. I intend to build an update site in the future, but would prefer to invest time into that only after getting feedback on the plugins because this is a side project.
It sounds like your plugin is loaded, but isn't started. A 'quick and dirty' solution is to have it use the org.eclipse.ui.startup extention point so it is activated on startup.
Another possibility is that your UI additions just aren't activated for the perspective, which you can fix by running Window > Customize Perspective.

How to write an IntelliJ IDEA Plugin?

IDEA has many plugins to use. I.e. IDEtalk is one of them which I use. How can I code a simple plugin that just connects to Internet and shows a web page? (no need for an address bar but it is not a problem to be). I want my plugin's shortcut's button locate at my IDE as like IDEtalk, Commander, Maven Projects etc.
Any ideas?
Check the documentation and the source code of the other plug-ins available in the public git repository of the Community Edition.
There is a Creating Your First Plugin guide on JetBrains web site. It covers all the needed steps from plugin creation to deployment to the plugin repository.
You might also want take a look in the source code of a simple plugin like Twitter Integration Plugin which I recently implemented. Or check a more complex one like this one.

Ignore Sibling-Modules During Maven Javadoc/Site Compilation

I have a Maven-managed project which contains a few modules, one of which is the actual library of interest. The other modules are just add-ons or examples that build off of the library. I'm looking to generate the Maven site for this library and have it automatically deployed (as a standalone site and not as part of a multi-module site) but I am having trouble with the Javadoc plugin.
When executing the javadoc:javadoc goal, the javadoc plugin is attempting to access the jar for the other modules causing a failure.
I have created a simple example which demonstrates this phenomenon. Make sure you run the clean goal before any others so that the flaw be shown. Though executing the packaging first would solve this error, this cannot be done because the use case occurs during the Maven-managed release process which starts from a clean state.
Is there a way for me to disable this functionality in the javadoc plugin so I only get the documetation for the library module?
I can think of two options depending on your preference. Both include using profiles. If you want the default build to create the javadocs for your library of interest. Make the other modules use a property inside of the default profile in order to skip the javadocs.
If you are okay with passing in a profile, just have the javadocs only run in the profile.

Delivering a single jar with a Maven project

I want to deliver a single .jar file to my clients, but my project is currently built with Maven, and I have several modules that generate a single .jar each.
I know nesting different .jar files is not a great idea, so I am not sure how can I achieve this.
Any ideas?
If you really want to go this direction, there are several ways to do that:
with the Maven Assembly Plugin and maybe the jar-with-dependencies predefined assembly descriptor (that will unpack dependencies)
with the Maven Shade Plugin (similar to the above one but gives more flexibility)
with the Maven One-Jar Plugin (that uses One-JAR and its custom classloader to allow nesting of JARs)
Depending on your exact requirements and constraints, you might prefer one or the other.
First of all, ask yourself if you have a really good reason for packaging your application and all of its dependencies in to a single jar. I haven't found a very many good reason for this at all (with most reasons being related to organizational policy foolishness or just plain ignorance). The way to go is to keep libraries in their own jars and supplying a .zip/.tar.gz containing all of your libraries and your application with either
An executable .jar with the
classpath setup appropriately in
your MANFIEST.MF file
a .bat/.sh
script that invokes java and builds
an appropriate classpath based on
your deps
Conversely, use JNLP (better known as Java Web Start).
If you really want to have maven bundle all of your dependencies and your application under a single jar, what you want to use is the "jar-with-dependencies" predefined assembly. The maven assembly plugin usage page also shows how you might this up as well.
You can try Maven Shade plugin too.
http://maven.apache.org/plugins/maven-shade-plugin/
General instructions on how to use the Shade Plugin can be found on the usage page. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the plugin's wiki page.
In case you still have questions regarding the plugin's usage, please feel free to contact the user mailing list. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the mail archive.
If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.
Actually, nesting .jar files is not possible. A jar can't have other jars in it.
.war and .ear files can contain jars, and that's a good solution if you're delivering a J2EE application.
If your app is just J2SE, however, I recommend looking at the Maven Assembly plugin. As the name implies, it allows you to create a single binary distribution of your build.