The manual execution of tasks like creating a git branch, setting the pom-versions, committing the changed pom.xml to setup a feature-branch can be automated.
See my example project at https://github.com/markiewb/create-feature-branch-script-for-maven
The most important part is the binding of the plugin to a Maven phase.
In large Maven-based projects consisting of several high-level frameworks sooner or later there will come the time, when there are two versions of the same dependency in the classpath. For example: two versions of the same logging framework.
One approach to solve such ambiguity is to choose one of the versions (which is hopefully compatible) and to use it as an explicit dependency. Nevertheless other dependencies may still introduce other version as transitive dependencies. This may be caused by different groupIds, which will result in two similar named jar.
Once you got a candidate you can start finding all the possible sources of the dependency.
mvn dependency:tree -Dverbose -Dincludes=log4j:log4j
will show you the dependency-tree, but only the relevant excerpt. Using this information you can now add your exclusions to the affected pom.xml files.
Exclusions are configured via the exclusion-tag , which excludes specific transitive dependencies. For example:
By the way: Java IDEs can help you doing this.
After that you can make sure the faulty dependency versions will never ever be included again. This can be done using the maven-enforcer-plugin 
<!-- exclude all versions lower than 1.2.17-->
Situation: You have a parent pom with defined dependencies in the “dependency management”-section. This way you do not have to provide versions for your dependencies. Standard-Maven-Stuff.
New situation: BUT for some reason you have to switch to another totally different parent pom with totally different “dependency management”-section. Your previously declared dependencies have no version, so there will be errors when invoking maven on this pom.
One solution: A cool thing you can do since Maven 2.0.9 is the import of the “dependency management”. So still no versions required for your previously declared dependencies…
This is accomplished by declaring a pom artifact as a dependency with a scope of “import”.
The offical documentation can be found here
Are you faced to a 401 status code when invoking
Like this one?
Embedded error: Failed to transfer file: http://server:port/dir/projectname//./changes-report.html. Return code is: 401
- check your pom.xml if the site-id in the distribution-section of the
pom.xml matches any server-id setting in your
- check if the password is still valid!
For example the following
settings.xml DO NOT match. Note the difference between BARNAME and FOONAME! This cannot work.
<!-- does not match FOONAME -->
<?xml version="1.0" encoding="UTF-8"?>
<!-- does not match BARNAME -->
Today i had to do some merging of artifacts (code and pom.xml). Then i wondered, why the tests didn’t run properly.
java.lang.OutOfMemoryError: Java heap space” was the reason. But why? I didn’t change the tests and i carefully merged the configuration. So i connected VisualVM to the surefire process and saw that only ca. 67MB max heap were available. I reviewed my MAVEN_OPTS, but my settings didn’t apply…
The culprit is a bug. See http://jira.codehaus.org/browse/SUREFIRE-501.
The workaround is to place your max heap configuration in the configuration section of the plugin. As seen in the linked bug issue:
<!-- http://jira.codehaus.org/browse/SUREFIRE-501 -->