maven-2

Remove nested test classes with maven2

Hi There! I use nested classes for accessing private members in JUnit tests. They are alaways named "TestProxy". I would like to remove them at Build time using maven2, to not include it into the jar file. -Is there any configuration option? -Can it be done with a plugin? If so, a prototype would be nice! ;-) Thanks Edit: Why us...

How to fetch current subversion revision number and URL with maven

I make a checkout of some branch or tag from subversion repository and then build the project with maven. Now, I'd like to get store current revision number and URL to some file. How can I do that? That is, I'd like to get revision number and URL of whatever branch/tag I have made checkout of. I know about buildnumber-maven-plugin but...

Set plugin's property on the command line in maven 2

In maven 2.x, how would one set a plugin's property on the command line instead of in the <configuration> of that plugin in the pom or in settings.xml? For example, if I was using mvn dependency:copy-dependencies(seen here) how can I set the useRepositoryLayout property without touching either the pom or my settings.xml? Thanks! ...

Maven - Jetty - org.apache.maven.lifecycle.LifecycleExecutionException: Failure

What can I do to start the server? This is the command I type to the terminal: mvn jetty:run and this is the result: [INFO] Starting jetty 6.1.9 ... 2009-04-15 18:16:00.829::INFO: jetty-6.1.9 2009-04-15 18:16:03.748::INFO: No Transaction manager found - if your webapp requires one, please configure one. 1487 [main] INFO com.opensy...

maven deploy additional jar file

I have an artifact which is being built and deployed in a particular way (not as a jar file). In the course of deployment, a war file is built. How can I configure the pom so that the artifact is also deployed as a jar file, to a different location? ...

How to get rid of maven snapshot versions

I have been using maven for a while now. But I've never learnt how to get rid of the snapshot version. Please share some articles on how to do a release of the artifacts. i.e. how do I publish my 0.0.1-SNAPSHOT versions to (say) 1.0.0 ...

Code generation in Maven

I want to autogenerate some java classes from interfaces. My first thought was to write a code generator, and integrate it as a maven plugin. I was thinking of creating a maven plugin with a codegen goal that is called during the build process. So if I choose this route, how do I provide the plugin with the interfaces to be processed? ...

define a POM property regarding the type of project version

Hi all, I would like in a maven2 POM to define a property with a different value if I am packaging a SNAPSHOT or a RELEASE (a non SNAPSHOT) of my project. I know that I can write a simple Mojo plugin that defines the property regarding the project.version (contains SNAPSHOT or not), but I cannot imagine that in the Maven's hell of exis...

using Maven SCM tag with Perforce

Does anyone have examples on how to configure the Maven SCM tag for perforce? ...

Skipping tests in some modules in Maven

I would like my Maven builds to run most unit tests. But there are unit tests in one project which are slower and I'd like to generally exclude them; and occasionally turn them on. How do I do this? I know about -Dmaven.test.skip=true, but that turns off all unit tests. I also know about skipping integration tests, described here. ...

Setting the a Property to what maven.compile.classpath Contains WITHOUT Ant

Hi, I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible. I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this...

maven, jsp files in dependency

Hi I'm using maven2 for dependency management. I have one project that contains some java files and some jsp files and another project, a web project, that depends on the first project. How do I access the jsp files from the web project? I can see that the jsp files are added to 1-0-SNAPSHOT-sources.jar and not 1-0-SNAPSHOT.jar ( which ...

Maven server authentication as profile properties

Hi all, I am trying to setup a shared authentication system on a build server. We have several maven projects that declares how the deployment should be done regarding the different teams that we have (each team has its own authentication user/password): <profile> <id>release-profile</id> <distributionManagement> <repository> ...

Maven release via Hudson

I'm setting up Hudson to use the batch-task plugin to do maven releases to our internal repository. I'm doing it via: mvn --batch-mode release:prepare mvn --batch-mode release:perform I'm interested in other methods people have used and the pros and cons of those methods. Also, any gotchas people have come across. ...

How do I upgrade the version of a maven plugin?

I am using the maven-ear-plugin version 2.3.1 - I know there is a new version available: http://maven.apache.org/plugins/maven-ear-plugin/ I can't work out how to upgrade to the latest version?? ...

How do I control execution of Maven Jetty Plugin with -Dmaven.test.skip

I am using Jetty and Selenium to automate some unit tests from my Maven 2. We only really want to run these tests as part of the CI build and would like to control it via the -Dmaven.test.skip property. I cannot find a way to apply this to the executions for the Jetty plugin. Am I missing something obvious? ...

Maven classpath order issues

Hi, Does anyone know of a way to set a specific classpath order in Maven2, rather than the random ordering I appear to experience at the moment? There are a number of legitimate reasons for wanting to do this: A vendor has supplied a patch jar, which contains overriding classes for a previously released jar and therefore the patch ja...

How to create create a release package with maven ?

I build a desktop application using Maven2. I'd like to make a release from time to time (just copy all the project's and third party jars into a single dir and generate a run.bat file). How to do it ? ...

Can Maven generate exe files and mac os x apps?

Hi all, Lets say you created a little Java Desktop app with a jar and some dependencies and possibly a license text file. I know there are plenty of Ant tasks that can generate installers, executables and proper Mac OS X applications including packaging them as ".dmg" files. Examples would be JarBundler and Launch4j Does similar things...

Using swf as a library for another swf in a maven project using flex-mojos

Hi! I have a maven project with flex-mojos 3.1.0. Can I have a module with swf packaging and configure a dependency on it in another module? When I do, I get a compilation error. project | - module1:swf | - module2:swf module2/pom.xml: <parent> <groupId>com.mygroup</groupId> <artifactId>project</artifactId> <versio...