maven-2

Maven replacement?

What would you suggest as a replacement to the Maven Java build toolset? Just plain Ant scripts? SCons? ...

How to configure JPA for testing in Maven

Is there a way to set up a second persistence.xml file in a Maven project such that it is used for testing instead of the normal one that is used for deployment? I tried putting a persistence.xml into src/test/resources/META-INF, which gets copied into target/test-classes/META-INF, but it seems target/classes/META-INF (the copy from the...

Add a dependency in Maven

How do I take a jar file that I have and add it to the dependency system in maven 2? I will be the maintainer of this dependency and my code needs this jar in the class path so that it will compile. ...

Pom Dependency

Which dependency should be added in pom file to import org.apache.tiles.controller? ...

How to use Maven Surefire plug-in with different groups for test and integration-test?

I want to use testng with the Surefire plug-in of Maven. The idea is to tag some tests with a group integrationTest and run the plug-in twice: for goal test excluding the group integrationTest and for goal integration-test including the group integrationTest only. I found some material for running the plug-in for both goals and that wor...

How can I setup Continuum to build on svn commits?

I had never tried Continuum as a build server until recently when a project required it. I appreciate the integration with Maven builds however I have been unable to find a way to have Continuum build my projects on every Subversion commit (like CruiseControl). There are several issue/bugs reported related to this topic of triggering b...

Hierarchy of maven projects without scattering the version number

If you use Maven2 as a build system for a project containing many artefacts, you have the version number of the resulting build scattered in all pom.xml. In many of them even twice - in the version tag of the artefact itself and in the version tag of the parent. Thus, you have to change and check in new versions of all pom.xml on every v...

Running junit tests in parallel ?

I'm using junit 4.4 and maven and I have a large number of long-running integration tests. When it comes to parallellizing test suites there are a few solutions that allow me to run each test method in a single test-class in parallel. But all of these require that I change the tests in one way or another. I really think it would be a m...

Syncing web project dependencies maven -> eclipse

I've got m2eclipse plugin installed and there's no problem syncing compile time dependencies that appear in pom.xml. Now, I add JPA + Hibernate(or whatever) dependency that maven catches up just fine when doing mvn jetty:run. The problem is, Eclipse doesn't. So I don't get those extra .jars deployed on the referenced tomcat when I laun...

Can I force Maven 2 to require a property to be specified on the command line?

I'm setting up a maven build, and the destination server needs to be specified on the command line as a property (which is then used to select the appropriate profile), eg mvn -Denv=test I'd like the build to fail if the property's not set - is that possible? Yes, I'm a Maven newbie. EDIT: I've seen this link, which seems to imply i...

maven look for new versions of dependencies

Is there any way to make maven look for new versions of dependencies? for example, i have commons-lang commons-lang 2.3 version 2.4 could be out, I dont know. i'd rather not check is manually(by writting 2.4 in this case), because i have many dependencies. I think i saw some trick to make maven use latest ...

Where should I put Velocity template files for a command line utility built with Maven?

I have a small command line utility project that I'm using Maven to manage. The utility is a very simple app to populate a Velocity template and dump the results to a new file. My problem is where to put my Velocity templates. When I put them in src/test/resources/foo/bar/baz, mvn test fails because it can't find the referenced template,...

Maven install folder structure problem j2ee (spring, struts ..)

Hi i'm using maven 2.1-SNAPSHOT as eclipse plugin. My project structure is like this: src/main/java    -model    -service    -action src/test/java    empty atm src/main/resources    empty atm src/test/resources    empty atm src/main/webapp    -js     -dojo    -META-INF    -WEB-INF      web.xml      appcontext.xml    ...

mvn release:perform without source ending up in artifactory

Hello What is the proper way to do mvn release:perform so that source code does not end up in my artifactory? All help appreciated. I know I have seen this documented somewhere Thanks ...

How to manually install an artifact in Maven 2?

Hi, I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command mvn install:install-file -Dfile=jta-1.0.1B.jar But Maven gave a build error which reads like: Invalid task '.01B.jar': you must specify a valid lifecycle phase, or a goal in th...

Has anyone succesfully loaded a YAML file using SnakeYAML from a local Maven repo?

If I reference the SnakeYAML jar directly from a test program (see bottom), everything works. If I'm inside my Maven-created project, I get the following output from my unit tests: java.lang.NoSuchMethodError: java.util.LinkedList.push(Ljava/lang/Object;)V at org.yaml.snakeyaml.scanner.ScannerImpl.addIndent(ScannerImpl.java:482) ...

Are lots of inheritied single-plugin profiles in Maven a good idea?

In our infrastructure, we have lots of little Java projects built by Maven2. Each project has its own pom.xml that ultimately inherits from our one company "master" parent pom. We've recently started adding small profiles to our parent pom, disabled by default, that, when enabled, execute a single plugin in a conventional manner. Examp...

Which scopes are present during maven site lifecycle

Which maven scopes are available during report generation for a maven site? Are any available. I'm trying to share a FindBugs filter file between several modules without having it end up in any of the application jars. I was thinking of putting in a commons project, which will package it in a separate jar with a classifier of "build-too...

Where should I put application configuration files for a Maven project?

I'm using the Maven Application Assembler plugin to generate stand-alone executables from my Java project. The application reads in configuration files, including Spring files. The Application Assembler plugin has an option (activated by default) to add a etc/ directory to the application's classpath, but what should I do to have the plu...

Nested Maven properties evaluated in refering POM rather than defining POM

I'm defining a report configuration in my parent pom which will be run in each child and grandchild project. Like so: <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>1.2</version> <configuration> ...