How to exclude applied groups from report - maven

I am using jqassistant 1.2.0 with asciidoc 1.5.3 - all in maven.
My question is a specific question for the maven plugin "jqassistant". I am scanning a large java war from a server using "mvn clean install" as the default command line prompt.
I need "classpath:Resolve" in my analysis (so that all links between nodes are generated). However i don't want the concepts of that to show up in the report... is there a way to do this?

Currently this is not yet possible but would be a good enhancement for upcoming needed changes to the reporting part of jQAssistant. It's already possible to add a report type to rules and it would be possible to provide something like reportType="none". It would be required to inherit that property within groups in case of pre-defined rules like "classpath:Resolve".

Related

Automatically force update pom to newer versions from inside a test

This is not related to update the pom dependencies using a maven goal. I already have that sorted out.
So I am responsible for creating, packaging and maintaining common utilities. These common utilities are in turn used by all the teams in the org. Problem is that the teams using these utilities do not update the dependencies unless it is the last resort. We would like them to use the latest release version of our common utilities barring very few.
Now I have come across this Maven Versions Plugin by mojohaus which I think serves my need by using two goals - versions:update-properties and versions:use-latest-releases. It serves my purpose except two things:
I do not see a way to exclude certain groupid:artifactid from the update dependency/property
We really want this to be a compulsory thing (maybe part of the Test execution - this is for test automation utilities mainly) rather than a maven goal. Because if it is a maven goal, it needs to be invoked separately and hence becomes optional for teams.
We know that forcefully updating to latest version might cause some issues with defect re-produciblity, but we are willing to take that risk. Our utilities are really test products.
Any direction/help on this is appreciated.
Edit: We run our tests using maven goals clean install already. So they use existing pom. We want dependencies update to happen before the tests run. Also it is desirable to commit the changes to source control (bitbucket) if possible.
We have our tests setup using Jenkins but teams also run multiple test on local machines.
Edit: Found the answer to #1. The plugin provides to exlude regex for group and artifact id. using tags excludes and excludesList
Sorry for insisting. From the Maven point of view I see two main solutions:
Your projects and your utility jar are tightly coupled and every project always needs to use the latest version. Then you can bundle all projects and your utility in one multi-module project. This makes sure that everything is up to date all the time, but it requires that all projects and your utilities are always build together (not separately).
You distribute your utilities to different projects which build and release at different times. Then it is up to the projects to decide when to update. There is unfortunately no standard way to deprecate jars.
If I understand you correctly, you want something "in the middle". This may be hard to achieve.

Is it possible to use a maven archetype to prompt for an input during archetype:generate?

I'm exploring the use of maven archetypes to generate a starter project. What I'd like to do is prompt the user for input, and then do something with that answer. I know it's possible to prompt for additional properties using archetype.properties. Is it possible to take the input from these properties and do custom processing of the project structure during project generation?
Specifically what I want to do is include or exclude sample code from a starter project. Some people will want to see a working example and then delete once they're ready to start, while others just want to get started with a blank project.
There are some open issues against the Maven Archetype plugin which (I think) relate to your use case:
https://issues.apache.org/jira/browse/ARCHETYPE-424
https://issues.apache.org/jira/browse/ARCHETYPE-274
These have been open (and largely inactive) for a long time, so they don't appear to be likely candidates for completion.
In the absence of built-in support for your use case and assuming there are just two possible outcomes (1. exclude sample code, 2. include sample code) then perhaps you coud provide two archetypes?
Alternatively, you could provide a single archetype and include a link to sample code (hosted elsewhere, perhaps on GitHub if the sample code is to be freely accesible) in a readme in the root of the generated project.

How to skip a maven build step without modifying the pom itself?

We have a maven based Java EE project controlled by the customer. For internal reasons, we cannot execute one of the build steps, but the rest works fine and produces the jar we want.
Since editing the pom file would require taking care when committing to customer's SVN and copying the pom file would require taking care to sync changes comming from there, we are looking for a way to skip this specific step in the build section during the maven call itself, so to say mvn clean install but-leave-out-this-build-plugin-step, is there any?
Edit:
The plugin in question is the rpm-maven-plugin, which prevents the build from running on Windows. We found information how to make it work which won't really fit in our current setup. And since we cannot modify the customer's pom, I was looking for a way to trigger the skipping externally. But maybe there are other ways to just ignore/skip/fake this step?
It depends on what plugin you want to skip. Many plugins have ability to be skipped via system property (-Dblabla).
For deploy plugin it is -Dmaven.deploy.skip=true, for surefire -DskipTests=true.
Read plugin documentation, maybe you can find skip property
The rpm plugin hase a property disabled, unfortunately it is not accessible by a property. So, if setting this property in the customer's pom (or asking for editing it) with a default value of false is an option, this may be the solution.

Will Maven support this application setup?

I'm going to try to phrase this so that it is not an opinion based question. I have been doing some reading into other Maven questions and I do not think this is a duplicate, but if it is, please point me in the right direction.
I am writing a series of WebDriver JUnit tests to test the front end of my institution's web page. The tests are also configurable so as to be used both for regression testing as well as testing new features as they get added to the front end. Essentially module is executed based on the user's selected preferences which will create custom configuration options and custom scripts to execute the tests and then ultimately runs the scripts.
My project is using Maven to manage the dependencies, but was originally using Ant to execute the module and then generate the JUnit report. The question is if Maven would be able execute the project in a similar manner to Ant, as well as be able to generate the JUnit reports (or something equivalent).
Many thanks.
There is a maven-selenium-plugin that can be used to run Selenium tests and maven-failsafe-plugin can be used with it to generate your results. If you would like to see an example in use you could search for "stests" in Rice's pom.xml.
Configuration of properties in your tests can be handled in a variety of ways, I usually make use of System properties and/or property files. Dynamically configuring which tests to run I haven't found a solution I am happy with.

How to use existing Checkstyle files in SonarQube

My co-workers and I would like to incorporate SonarQube into our existing projects. Our normal development process for Java projects involves running Checkstyle on code changes to ensure they follow our style rules, committing the project to our code repository and having Jenkins build and package the latest version. We’d like to add SonarQube to this final step (through the Jenkins plugin) but we don’t want to duplicate all of our Checkstyle rules in SonarQube, since this would require us to maintain two separate sets of rules and make things more complicated if we need to make changes to the rules. We don’t want to completely switch to SonarQube since we’d like to still run Checkstyle before we commit code to our repository. We’d also prefer to maintain our own Checkstyle files as the main set of style rules as opposed to maintaining the style rules on SonarQube and downloading the generated XML files for our local development.
So is there any way to “upload” (so to speak) our existing set of Checkstyle XML files to SonarQube for it to use in its evaluation?
Thanks for the help.
AFAIK, it is not possible to have Sonar use the Checkstyle definitions from the repository. Is is, however, possible to have Sonar use the current Checkstyle suppression filter from the repository.
As for the rules definitions, I think you will have to maintain them in Sonar, and when anything is changed, also change the copy in the repository which is used by eclipse-cs. This is redundant, but at least it affects only one person - the rest of the team can reap the benefits. This approach also enables intentional differences, e.g. when some Eclipse-specific issue is checked (say, something concerning source folders, which don't exist in Sonar).
The path to the suppressions filter file can be configured in Sonar to refer to the location where your stuff is checked out for Sonar analysis. So that part can be maintained in the repository without any redundancy.
From my point of view, you should make a choice: use SonarQube or Checkstyle but not both.
Checkstyle on code changes to ensure they follow our style rules => Can't you replace this step with SonarQube. See for example: http://docs.codehaus.org/display/SONAR/Using+SonarQube+in+Eclipse or http://docs.codehaus.org/display/SONAR/Issues+Report+Plugin

Resources