maven-2

What is the best way to obtain a list of site resources when writing a Maven2 site plugin?

When creating a plugin that executes in the default life-cycle, it's easy to obtain a reference to the project and its resources, but I'm getting a null instead of a MavenProject object when creating plugins that execute in the site life-cycle. Any hints, tips or suggestions? ...

How do you create automated tests of a Maven plugin using JUnit?

I've got a (mostly) working plugin developed, but since its function is directly related to the project it processes, how do you develop unit and integration tests for the plugin. The best idea I've had is to create an integration test project for the plugin that uses the plugin during its lifecycle and has tests that report on the plug...

Thinking of learning Maven

I have a side project I do = in Java. It's a pretty straight-forward webapp. It runs in Tomcat on a Linux Server and uses a MySQL database. The majority of the code was written with the Spring Framework. It has a lot of Unit Tests in place. When I'm coding it's in Eclipse. When I deploy the application I run a few shell scripts to move...

How do I get maven to "stamp" a build number into a properties file

I would like to be able to, as part of a maven build, set the build number (doesn't matter exactly what) in a properties file/class (so I can show it in a UI). Any ideas? ...

Best way to access the runtime configuration of a maven plugin from a custom mojo?

I am writing a custom maven2 MOJO. I need to access the runtime configuration of another plugin, from this MOJO. What is the best way to do this? ...

Why does maven 2 try to download dependencies that I already have ?

When I launch the "mvn install" command, maven sometimes tries to download dependencies that it has already downloaded. That's expected for SNAPSHOT but why does maven do that for other JARs? I know I can avoid that behavior by "-o" flag but I just wonder what the cause is. ...

Maven dependency exclusion for War file, but inclusion for tests

I have a maven POM file for a web service. For one of the dependencies I have to specify several exclusions for jar files that are already kept at a higher-level in the web-application server (accessible to all web-applications, not just this particular one). One example of such exclusion is the JAR containing my JDBC driver. Example (w...

How do you force a maven MOJO to be executed only once at the end of a build?

I have a MOJO I would like executed once, and once only after the test phase of the last project in the reactor to run. Using: if (!getProject().isExecutionRoot()) { return ; } at the start of the execute() method means my mojo gets executed once, however at the very beginning of the build - before all other child modules. ...

How do you refresh maven dependencies from eclipse?

We recently started using maven for dependency management. Our team uses eclipse as it's IDE. Is there an easy way to get eclipse to refresh the maven dependencies without running mvn eclipse:eclipse? The dependencies are up to date in the local maven repository, but eclipse doesn't pick up the changes until we use the eclipse:eclipse c...

Adding referenced eclipse projects to maven dependancies

Right now, I have two Eclipse projects - they both use Maven 2 for all their jar-dependency goodness. Inside eclipse, I have project Foo included in project Bar's build path, so that I can use Foo's classes from project Bar. This works really well in eclipse land, but when I try: mvn compile inside Bar's directory, it fails because ...

Eclipse: Dependency Management

What are some methods of utilising Eclipse for Dependency Management? ...

How to properly setup a multi module SpringMVC application created by appfuse in Eclipse?

I am trying to setup a multi module SpringMVC appfuse applicaiton in Eclipse but it seems that I'm facing lots of errors in Eclipse after I import the project in Eclipse. Can anyone please help me with a step by step guideline showing the ideal way to setup such application in Eclipse? ...

How can I build an Adobe Air project with Maven?

Has anyone successfully built an Adobe Air application with Maven? If so, what are the steps to get it working? I have been trying to use flex-mojos to build an Air applications. When I set the packaging type to "aswf", as suggested in the DashboardSamplePom, Maven complains that aswf is an unknown packaging type. I also found their ...

Viewing repository information from within Eclipse, when code was checked out using svn tortoise

Hi all, I am using svn tortoise to checkout a maven project from a repository, I then open eclispe, and use the m2eclipse plugin to import a maven project. The maven projeect comes in okay, and I can build it fine. The problem is that eclipse using subversive, isn't marking files/ resources as being in source control (even though I se...

Questions about use of snapshot in Maven2

I am writing a POM file for a in-house jar artifact. The artifact depends on several other in-house artifacts which our team writes. When declaring the dependencies of the target, should I limit those dependencies to fixed release version or leave them to SNAPSHOT version. If too many other SNAPSHOT versions of depended modules, it creat...

What is the easiest way to start tomcat in embedded mode from the cargo-maven2-plugin?

I have defined tomcat:catalina:5.5.23 as a dependency to the cargo plugin, however I still get the following exception: java.lang.ClassNotFoundException: org.apache.catalina.Connector at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findCla...

Host Maven Repository

Hi all, I would like to host a Maven repository for a framework we're working on and its dependencies. Can I just deploy my artifacts to my ftp host using mvn deploy, or should I manually deploy and/or setup some things before being able to deploy artifacts? Do I need a tool like Apache Archiva? Note: I only have ftp access to server I ...

How can i speed up my maven2 build?

I'm using a local artifactory to proxy the request, but the build and test phases are still a bit slow. It's not the actual compile and tests that are slow, it's the "warmup" of the maven2 framework. Any ideas? ...

What are main/best Maven respositories to use?

What are the main/best Maven repositories to use that will include the majority of your open source Java package dependencies. Also in what order should these be included? Does it matter? ...

maven-buildnumber-plugin

Hi all, i use the maven-buildnumber-plugin to generate my version number for JAR/WAR/EAR packages. So when doing a compile i'll get for example ${project.version}-${buildNumber}, because is set to this value. But when using mvn deploy just ${project.version} is the filename, samen when i set in pom.xml to XX ${buildNumber} then the fi...