maven-2

How to skip install phase in Maven build if I already have this version installed in repo.

I have a project that consist of 3 different libraries. When I run install script it takes all libraries from repo and run mvn clean install on them. But this version of library already installed in repo. Is there a way to skip install phase if version in pom.xml equal version in my local repo. I know that I can use local repo and just ...

Is there a maven equivalent of rpm --whatprovides for a jar file?

How do I use maven or another tool to find which dependency of a dependency which provides a particular jar? Sometimes they're three or four dependencies deep. ...

maven war plugin giving strange output!

hi people, I am getting some very weird behaviour from maven that I have never seen before. Basicaly I refactored some classes, like util.constants (lower c) to util.Constants (capital C), but when I run the maven build to produce a WAR from the command line (mvn clean install), it builds the war project with util.constants (lower c). U...

Naming convention for Maven Artifacts

We are currently trying to mavenize the existing projects in our company. We have executed a POC and are currently documenting our learnings and guidelines. I have come up the following naming convention for the maven artifacts. Please share your comments on the same Note: In our company, projectname is always unique For a single level...

mvn2 release:stage: why doesn't it finish the job, or, is something supposed to come next?

The documentation for release:stage is pretty minimal. We tried it out, and found that it didn't clean up the intermediate files or otherwise finish up the job. This suggests that either (a) it is 1/2-cooked or (b) the intention is to use it as one step in a larger process. Anybody out there know which, and, if (b), what the process is ...

Glassfish Error when deploying working GF 2.1 to Glassfish 3 and switching to maven at the same time - Killing me!

Everything builds just fine in Maven and Ant, but will only deploy when building with Ant. It is an EJB jar I am deploying that is @Stateless and has @WebService tags as well [#|2010-06-30T19:23:29.045-0500|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=62;_ThreadName=Thread-1;|Exception while ...

Maven - use different java classes during 'test' and 'war' phase

I'm using maven war plugin to build war package. Before package is build test are executed. To preinitialize my database with sample data I use spring bean. I would like to have different data in my db for tests and different when application starts. I was thinking that maybe it is possible to use two different spring initializer class...

Why does eclipse not find the beans.xml files in a spring based Maven project

I have a maven project under eclipse with m2eclipse. WHen running integration tests the tests fail with the mention that the spring configuration files cannot be found on the classpath, and I get a similar error from log4j. I was under the impression that m2eclipse would add the resources directories to the classpath but apparently no...

Maven release plugin. How to use and configure release:stage

Hi all, documentation on this goal release:satage is pretty poor and was wandering if any mvn users out there used it successfully. I'm more interested on how to configure it (poms set up and so forth...) and implement it if someone is interested in putting releases to a tmp staging location where they're picked up for testing first and ...

Access internal maven repo from IVY

Hereabouts, we use a Sonatype Maven repository. This is jolly nice for our maven projetcs, but we have a legacy application that uses Ant+IVY for dependency management which now needs a dep from Maven. My IVY settings file looks like: <ivysettings> <property name="dsnexus-root" value="http://internal-url/" override="false"/> <...

Passing Maven Compiler Options From The Command-line

I am setting up several projects on a continuous integration server, some of which I don't have access to change the source code to, The server is a linux box, I am running into a problem where maven encoding needs to be changed to UTF8 to be able to compile on the box. Since I don't have access to modify the pom file, I was wondering if...

How can a Maven plugin discover its own version during execution?

I'd like to be able to discover the version of my plugin during its execution; 0.0.1-SNAPSHOT, 0.0.1, 1.0-SNAPSHOT, etc. Can this be done? The AbstractMojo class doesn't really give you much information about the plugin itself. EDIT - I am using the following code as a workaround. It assumes that the MANIFEST for the plugin can be load...

Maven module cannot install due to compilation error but will compile successfully

I have a Maven module called display. It is part of a larger reactor chain, and I have added code into a file called SomeClass.java within display which references java.text.ParseException, which is imported without a problem. My code in Eclipse shows no reference or import problems and compiles without a problem. However, when I run mvn...

Spring + Maven: separate property files for unit tests and integration tests

I'm using Spring 2.5.6 and building my project with Maven 2.2.1. We use PropertyPlaceholderConfigurer beans in Spring to load up properties for configuring things like the database. Pretty standard stuff. We also have two different sets of tests: unit tests and integration tests. I would like to be able to use different property files ...

How to prevent Maven from accessing remote repositories?

How can I enforce Maven to only use my local repository and single specific repository on intranet and not downloading anything from internet? Even my POMs all has single company's internal repository specified, maven goes to internet repositories taken from libs' POM files to fetch dependencies. ...

How to execute maven plugin execution directly from command line?

I have a plugin (antrun) with an execution configured which has an id and is not bound to any phase. Can I execute this execution directly from the command line? <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>my-execution</id> ... </execution> </executions> </plugin> An ru...

Exclude classes from a dependency in Maven

Hi, I have a project which depends on an artifact which is controlled by a supplier. This artifact contains some classes that I depend on, and some which are older and causing problems. Is there a way to get maven to automatically expand a jar, remove classes, and re-package them as a dependency? I'll try to give an example. supplier:a...

How to print the actual MAVEN_OPTIONS that are being used?

Hello I'm wondering if there is a way to print what is the actual environment variables that maven is using... something like mvn --verbose --debug ? I don't find anything with google. ...

How to use NSIS with Maven2 and continuous integration?

I want to include an installer created by NSIS into a Java project organized with Maven2. How can I incorporate this so that the installer is automatically built each time I use maven to create a distribution? I've tried the following: http://mojo.codehaus.org/nsis-maven-plugin/plugin-info.html The only way I could include the plugin ...

How to specify a repository for a dependency in Maven

In projects with several dependencies and repositories, the try-and-error approach of Maven for downloading dependencies is a bit cumbersome and slow, so I was wondering if there is any way to set an specific repo for some declared dependencies. For example, I want for bouncycastle to check directly BouncyCastle's Maven repo at http://r...