maven-2

Should be a groupId unique in multimodule project?

I have a maven multimodule project. What the best practices for creating groupId? Can I use one common groupId for all modules or unique per each? ...

Building a DLL via Maven with mojo-native

I can build a simple dll consisting of a source file, a header file and a definition but now I am progressing beyond a simple toy dll and working towards something more real (ie: more complex). The DLL I am trying to compile has 2 source files, 2 headers and the dreaded stdafx pair. To compile normally you would use /Yc for the pch and...

Algorithm for troubleshooting "Maven doesn't work for me" problems

One of the most common and annoying problems I encounter with Maven is the building process failing/passing depending on who, when and on which machine is executing the process. More formally - in ideal world I would expect the build process to be repeatable. As a programmer I would say that I expect the build process to be like a pure ...

Maven Quick-start Guide

I'm tasked with getting a development environment set up for a new program at work. The lead has chosen Eclipse as the IDE for its OSGi support and Maven as the build utility. I've struggled through getting Maven integrated with Eclipse and I'm grudgingly declaring success and moving forward. My question: is there any sort of guide to ...

How to figure out which jars are needed?

How can I systematically determine which jars I'll need, and thus should include in my pom.xml file (I'm using maven as my project management tool)? When learning spring, to keep things simple, added all the jars (even the ones I never used) to the classpath. Right now for the most part, I'm guessing which jars to include. For exampl...

Can't get JPA2 running with Hibernate and Maven

Have been trying the whole day long and googled the ** out of the web ... in vain. You are my last hope: Here's my code: The Entity: package sas.test.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Employee { @Id private int id; private String name; private long salary; publi...

Maven Assembly: include a dependency with a different classifier

I would like to build two different versions of a WAR in Maven (I know that's a no-no, that's just the way it is given the current situation). In the version of a WAR depicted by an assembly, I want to replace a dependency by the same dependency with a different classifier. For example, I was expecting this assembly to work: <assembly> ...

maven: multi-module project assembly into single jar

I have a multi-module project and want to create a single jar containing the classes of all my modules. Inside my parent POM, I declared the following plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>bin</descriptorRef> <...

Maven build issue with Hibernate for Windows

Hi! I'm getting build errors for for my Maven enabled project related to the Hibernate extension. - It's a very basic app, and I was able to solve this issue on my Linux box by manually installing some required artifacts: mvn install:install-file -DgroupId=javassist -DartifactId=javassist -Dversion=3.9.0 -Dpackaging=jar -Dfile=foo.jar...

Project organization in perforce

Hello. I created several web applications that use the same static files (css, js, images). When I use svn for version control, I use an external repository (svn: externals) to add files to the current project. For example: - Project_1 ---- Webapp -------- Static (external to static's repo) - Project_2 ---- Webapp -------- Stati...

Unit Test in Maven requires access to the src/main/webapp Directory

Hello all, I am trying to unit test a webapp that I am developing in Maven/Eclipse. It is a Spring MVC webapp, and I need some unit tests to test my model controller. To do this, I need to use my webapp config .xml files to inject the controller, however, all my configuration (and other associated files that the configs reference) are ...

Checking for corrupt war file after mvn install

Is there a maven command that will verify that a WAR file is valid and not corrupt? Or is there some other program or technique to validate zip files? I'm on Ubuntu 9.10, so a linux solution is preferred. On occasion, I end up with a corrupt WAR file after doing mvn clean and mvn install on my project. If I extract the WAR file to my h...

Maven and version of jar in final artifact

I'm a beginner with maven 2 and I have a problem with the version of a jar in my project. I have the following dependency declared in my pom.xml: <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> But when I build my war, I get version 1.0.3 of that ar...

Java-Maven: How to add manually a library to the maven repository?

I'm trying to generate a jasperReport, but I receive this: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Times New Roman' is not available to the JVM. See the Javadoc for more details. After searching on the net, I found that I need to add a jar to the classpath with the font. So, I create a jar file with the ttf fil...

Maven Embedded Glassfish Plugin - how to set the temporary directory?

Hi all, I am using the Maven Embedded Glassfish Plugin and it works great, but unfortunately it creates a temporary directory in my main project directory. I would like it to use target so that every time I clean the project, the embedded directory also gets wiped. Is there a setting for that? Walter ...

How to get GWT 2.0 and Restlet 2.0 to play nice

Hello, I am having trouble getting Restlet to play nice with GWT in the same project. I have been trying the examples from Restlets website to no avail I am using Eclipse, Maven2 plugin, GWT, and Restlet GWT. I have never used server side code in this GWT project before and I know there is some custom setup involved. I am deploying loc...

How to get Maven Artifact version at runtime?

I have noticed that in a Maven artifact's JAR, the project.version attribute is included in two files: META-INF/maven/${groupId}/${artifactId}/pom.properties META-INF/maven/${groupId}/${artifactId}/pom.xml Is there a recommended way to read this version at runtime? ...

Maven webapp with maven-eclipse-plugin doesn't generates <dependent-module>

I use the eclipse:eclipse goal to generate an Eclipse Project environment. The deployment works fine. The goal creates the var classpath entries for all needed dependencies. With m2eclipse there was the Maven Container which defines an export folder which was WEB-INF/lib for me. But i don't want to rely on m2eclipse so i don't use it an...

Apache Commons EmailValidator and SeamListener Exception (not deploying)

Hi, friends When using Apache Commons EmailValidator through Maven, I have the following problem that doesn't deploy my app: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener java.lang.LinkageError: loader constraints violated when linking org/xml/sax/EntityResolver class I'v...

@RunWith causes Maven to ignore my Test running with my own runner

I am moving from using only Intellij to manage my build system to Intellij/Maven. When I run my integration test "MapSimulationTest" with my own runner via @RunWith(KmlParameterizedRunner.class) Intellij correctly handles the situation, the directory specified by the system property "user.dir" is scanned for .kml files and each is teste...