maven-2

How do you run the maven-gae-plugin "mvn gae:run" command from inside Eclipse?

From the command line, the maven-gae-plugin can be run by calling: mvn gae:run I am working in a Maven project with a POM file that declares the use of the maven-gae-plugin. I can run this maven command from the command-line in Windows. But, after setting up the source code as a project inside Eclipse, I don't know how to run this c...

Working with Maven

I downloaded Java source code of some project that works with Maven. After checking out the code to Eclipse, and then building it from the command line, I followed the instructions and imported it from Eclipse as: File > Import > Maven Projects. Now I have the core source code and many additional sub projects that seem to have the same t...

Different behavior/content of Spring/Hibernate/SessionFactory when running Maven+Surefire vs Eclipse+jUnit

I try to be quick. In fact, one of my jUnit test is failing when running the Maven command of my project (mvn install, so with the Surefire plugin) while it's successful when I run it in Eclipse. I tried many things and the only difference I managed to see is that : - With Maven/Surefire in debug-mode, in the Hibernate-SessionFactory I...

Maven Profile - Activate Profile depending on packaging

Hi all, I have a POM which declares web application stuff that is common to my projects. I use this as the parent for all web applications. Is it possible to activate a profile only when the packaging is war? I have tried the property approach, but that doesn't work (as it isn't a system/environment property). Since this fails the b...

run maven tests from classpath

In order to clean up something of a giant mess, I set out to put the code of my tests all in one ordinary java project (all in src/main/java), and then declare that as a <scope>test</scope> dependency in another project, and expect the tests to run. No such luck. surefire wants to just run the tests that it can see in the sources. I ca...

Adding Richfaces to a Maven Project being Deployed to JBoss AS 6

I'm having trouble with adding Richfaces to my Maven project, which is deploying to JBoss AS 6. Here is my pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; <mode...

How to get Maven project version to the bash command line

Previous I issued a question on how to change Maven project vesion from command line which lead me to a new issue. Previously I was able to get the version number since the version was stored as a property that was easy to grep and parse from the command line (bash). Now that the pom.xml element is used for this, it no longer is unique...

Pom/Project Properties via Eclipse maven2

I packaging my java project with maven, using the M2 Plug in Eclipse I need to provide a value for the following pom property (module_version), for local packaging this will have a value like “local-SNAPSHOT” <groupId>com.group</groupId> <artifactId>server</artifactId> <packaging>jar</packaging> <version>${module_version}</vers...

Hibernate-annotations 3.4.0.GA and slf4j?

I have a maven project A that use hibernate-annotations 3.4.0.GA which use the slf4j-api version 1.5.5 (checked through the dependency tree in the pom.xml file). Further project A specifies slf4j-log4j12 version 1.4.2 as a dependency. I have another maven project B which depend on project A. In project B I have specified the following d...

Using multiple Classes with Maven/Hudson and TestNG

We use several testing classes within one test folder. When I run mvn test, all tests are run and I can see the output in the shell. But the resulting testng-results.xml only has the results of the last class which was tested in it. This isn't too bad for me, but our hudson server only displays these last results and only marks a build a...

Does Eclipse do a binary-compatibility-check of jars as they are added to a project?

While I was singing the praises of Maven's dependency management, an Eclipse user told me (an IntelliJ user) they don't need stuff like that because any time they add a jar to a project Eclipse will test it's binary compatibility against other jars in the project. Is this true? Is this Eclipse itself or a plugin? Is there similar functi...

merging changes from a maven relase branch yields conflicts due to changed versions in poms

Hi, following standard practice, I have an svn trunk for feature development, and a forked-off branch for building releases. The branch has been created using the maven release plugin, which is also used for creating releases. As it happens, the occasional bug will be fixed on the branch, and those changes need to be merged back into the...

Generate Websphere 6.1 compatible EAR file using Maven

Hi everyone, I've been looking around for some time and couldn't find a clear explanation for this. We're using a Websphere server to run a Web application developed using Rational Software Architect 7. This application is composed of a war project and 4 jar projects. To make the final ear file there is a sixth project which contains t...

Selecting the certain resource files into WAR from the default src/main/resources location with Maven

I am trying to control which files make into the WAR package that is created by mvn package goal. Specifically, I want to exclude some files from the default src/main/resources folder for each package (I am trying to do builds/package for different environments). I tried using maven-war-plugin but failed. If I add this configuration (fo...

Maven: Packaging dependencies alongside project JAR?

I've like Maven to package a project with run-time dependencies. I expect it to create a JAR file with the following manifest: ..... Main-Class : com.acme.MainClass Class-Path : lib/dependency1.jar lib/dependency2.jar ..... and create the following directory structure: target |-- .... |-- my-project.jar |-- lib |-- dependency1.ja...

How do I prevent Maven 2 from searching remote repositories for specific local depedencies?

How do I prevent Maven 2 from searching remote repositories for specific dependencies that are in the local repository only? ...

Maven release plugin fails when creating tag

Hi everyone, I'm trying to use Maven release plugin 2.0 to tag the version and hopefully deploy the resulting jar to the repository. I got stuck at release:prepare, getting this cryptic error [INFO] Checking in modified POMs... [INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file C:\Users\ME~1\AppData\Local\Temp\maven-...

How can I force Maven to use Ehcache 2.2.0 with Hibernate 3.3.2GA?

Assuming that the two are compatible, how can I force Maven 2 to use Ehcache 2.2.0 instead of Ehcache 1.2.3 with Hibernate 3.3.2.GA? Essentially, I wish to replace the puzzling and practically cyclic dependency chain Hibernate Ehcache Integration 3.3.2.GA => Ehcache 1.2.3 => Hibernate 3.2.0.cr3 => Ehcache 1.2 with Hibernate Ehca...

Maven - How to find correct groupId/artifactId to include dependency in POM

In general, what is the best strategy for finding the groupId and artifactId for a well-known dependency for use in a Maven POM? For example, how would I find the correct entry for the MySQL JDBC driver? It's not mentioned on the mysql.com site, so I would usually spend time looking for another POM that already uses the Maven repository ...

How to lock maven plugin version

How can I lock the version of a Maven plugin I want to use? I have the PMD plugin configured like so: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.5</version> <configuration> <outputDirectory>...