Below you will find pages that utilize the taxonomy term “maven”
Maven3 alpha and CLI plugin for Maven2
Today I tried out the new Maven-3.0-alpha-6 on a multi-module project which uses profiles inside POM files and profiles.xml file. The first thing I noticed that Maven3 still uses the .m2 directory for local repository. I kind of thought they would change that, but I guess this is good for backward compatibility. Another thing that immediately strikes you is that Maven became more strict. I was getting warning messages because the POM file wasn’t living up to Maven’s standards of well defined build script.
Maven profiles.xml issue (MNG-3933)
If you’re using a profiles.xml file to store your profiles and want to migrate from Maven 2.0.x to Maven 2.1.x or later chances are you’ll run into a build failure. In my case the error message was “Reason: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: …”
The root cause of this from the stack trace might look like this:
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: Expected root element 'profilesXml' but found 'profiles' (position: START_TAG seen <?
Maven command-line tips
In an ever-growing sea of parameters that one needs to memorize for tens or even hundreds of command-line programs I decided to keep a list of some of the more useful and frequently used Maven parameters in case I forget anything.
This should be run from a parent POM’s directory. It lets you view the POM file that would be in effect if you were building the project. The result is a composite POM containing all your child POMs that you defined as modules in the parent POM.
Using maven
Maven is an awesome build tool for JAVA, but it has some long parameter names that I don’t like to remember, so I put my often used tasks of maven in batch files.
install.bat
mvn install:install-file -Dfile=%1 -DgroupId=%2 -DartifactId=%3 -Dversion=%4 -Dpackaging=pom -DgeneratePom=true This installs the specified .jar file in the local repository located in
C:\Documents and Settings\*User*\.m2\repository where *User* is your username. Four arguments are required: jar_file, group, artifact and version.