Posted by vikashazrati on Monday, January 28, 2008
When you are starting a new project it is very easy to get started if the project structure can be built for you. Maven provides a plugin called maven-archetype-plugin which can help you generate the desired project structure depending on the application that you are trying to build.
The Archetype Plugin allows the user to build archetype containers. These archetype containers contains the pom, default source, test, resources, test-resources, and site-resources files in a specific directory structure. The content of the pom, the default files, and the directory structure depends on the what archetype container was built.
To create a simple java application you can use
mvn archetype:create -DgroupId=[your project's group id] -DartifactId=[your project's artifact id] -DarchetypeArtifactId=maven-archetype-quickstart
Likewise to create a webapp use something like this
Read the rest of this entry »
Posted in Java, Maven | Tagged: generating app with maven 2, Maven, Maven 2 project structure, Maven genapp, mvn archetype | No Comments »
Posted by vikashazrati on Saturday, December 22, 2007
Let us assume that you have a maven based project. This would mean you have a pom.xml if you are using maven 2.
Now if you execute mvn eclipse:eclipse the maven eclipse plugin generated the required .classpath and .project files so that your project can become a first class eclipse project.
However, by default the project nature added is that for a java project and hence the .project file is generated like this, with the java builder and the java nature.
<projectDescription>
<name>my-project</name>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Read the rest of this entry »
Posted in Maven | Tagged: add project nature, Eclipse, Maven, maven-eclipse-plugin, mvn, projectnature | No Comments »
Posted by vikashazrati on Thursday, July 26, 2007
If you get an error OutOfMemory error while doing mvn site, because of all the reports that you are generating, just increase the heap size for maven2. The way to do that on linux.
In your mvn.sh add this as the first line after the copyright and other comments.
export MAVEN_OPTS=”-Xmx512m”
note than Maven 2.0.6 onwards some users have reported that the double quotes give problems, hence you might want to use
export MAVEN_OPTS=-Xmx512m
Posted in Java, Maven | 2 Comments »