maven-2

Delivering a single jar with a Maven project

I want to deliver a single .jar file to my clients, but my project is currently built with Maven, and I have several modules that generate a single .jar each. I know nesting different .jar files is not a great idea, so I am not sure how can I achieve this. Any ideas? ...

How to solve Maven dependency on rt.jar for OS X?

I have the following dependency in my pom.xml <dependency> <groupId>javax.sql</groupId> <artifactId>jdbc-stdext</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>${java.home}/lib/rt.jar</systemPath> </dependency> My problem is I'm trying to build on a Mac (10.6.4) which doesn't have an rt.jar. Is t...

how to include 2nd level dependencies using maven

I have project A which a pom.xml dependency of: <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.2</version> </dependency> commons-email depends on javax.mail-1.4.1 I ran mvn install to install projectA.jar into the local maven repo. In project B, i...

Maven 2 multi module pom

I have recently started migrating my project from ant to maven. I have two module in my application which I am able to build using maven. Now I have automated tests project which use Web Driver for testing UI functionality. What I am trying to do using maven is to build both module wars and deploy them on to tomcat. Then run automation...

Transitive dependencies in Maven2

Hi, I've just started using Maven2 after using Ant for the last 3 years. So far I like what I'm seeing but I'm still getting to grips with the structure of the tool and its integration with IntelliJ and whats going on in the background. One of the biggest draws to Maven was its ability to resolve dependencies transitively as part of th...

Changes in dependent modules cannot be seen in other module in Maven Eclipse

I am working on a multi module project with m2eclipse. I set the maven to take care of resolving workspace dependencies. But when I make change on, say, service module, change is not visible on other modules immediately. If I make new method in Service layer, it is not visible in WebApp layer. Sometimes even Run/maven install and refresh...

maven dependency range does not work as expected

Maven 2.2.1 claims to support version ranges (see e.g. http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-project-dependencies.html#pom-relationships-sect-version-ranges) I tried from a brandnew maven installation the following pom: <project> <modelVersion>4.0.0</modelVersion> <artifactId>rangetest</artifac...

Maven couldn't find LATEST version of a dependency

It's only occurred to log4j, My pom: ... <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>LATEST</version> </dependency> ~m2/repository/log4j/log4j/maven-metadata-central.xml: <?xml version="1.0" encoding="UTF-8"?> <metadata> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <ver...

deploying a versioned WAR file to tomcat

I was wondering what would be the best practice to deploy a maven packaged WAR file to tomcat. Using maven release plugin I get a versioned war file for my project eg: myservice-1.0.0.war I would like to deploy it to tomcat so that I can access it as follows eg: http://localhost:8080/myservice By default tomcat explodes the war file a...

Need presentation materials for convincing a customer to use Maven

My customer needs a more organized inventory of all 3rd-party libraries (such as JAR files) that are used in production for their projects. I am involved with a number of their Java-based projects. Their inventory has not been consistently maintained in the past and the time has come to account for all the libraries that are currently be...

How can I configure additional eclipse settings with m2eclipse?

With the maven eclipse plugin, I can configure checkstyle or sonar configurations by adding the necessary invocations to the pom.xml and calling "mvn eclipse:eclipse" to create the project configuration. Some members of my team want to just use "Import Maven project" and therefore don't get the benefits of the project preconfigurations....

How to attach an artifact with assembly-plugin during custom lifecycle

Hello, i'm trying to create a plugin with a custom lifecycle : /** * @goal my-goal * @execute lifecycle="my-custom-lifecycle" phase="attach-foo" */ public class MyMojo extends AbstractMojo { ... with src/main/resources/META-INF/maven/lifecycle.xml file : <lifecycles> <lifecycle> <id>attach-foo</id> <phases> <phas...

Access maven project version in Spring config files

I would like to display the currently running version of my web application in the page. The project is based on Maven, Spring, and Wicket. I'd like to somehow get the value of maven's ${project.version} and use it in my spring XML files, similarly to the way I use the Spring PropertyPlaceholderConfigurer to read a property file for set...

Do I need to install glassfish server to use it as embedded server in application?

Hi, I am trying to use glassfish as a embedded server in my ejb3.1 project. below are my maven dependencies.. But when I run my tests it fails to deploy ejb modules. do I need to set javaee.home or some more variable ? <dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-all</artifa...

What are the advantages of writing a Maven plugin in Groovy compared with Java?

Hi, I'm about to write several Maven plugins to ease the life of the R&D people. I'm contemplating between writing the plugin in Groovy or in Java. The plugin would most likely need to: Use Git commands such as checkout, clone, etc. Download pom.xml files of specific artifacts from a remote repository (our internal Nexus) Parse the p...

Find artifacts which occur in two maven repositories

Hereabouts we are using a pair of Maven repositories. I have been asked to find out which artifacts occur in both. Anyone care to suggest the easiest way to achieve this? Write my own Maven plugin perhaps? Cheers P ...

Maven output with displaying plugin+goal+project for each line as prefix

I really start to be fed up with my not knowing exactly what is happening inside a Maven build. Can I add extra info to console log like MDC in log4j? I want to see the followings for each line: plugin coordinate/goal project name/id/something Do you know how to do this? Is there a log configuration somewhere? I expect something like...

Packaging Javascript files in a war?

I am developing a Servlet based Java project which is to be packaged as a war using Maven. Is there a way I can include JavaScript (JS) files along with this project (they should be available at some url when the project loads on a Tomcat Server). I have looked around but have not found any working solutions. ...

Maven dependency

Hi i have a quite simple question about maven dependency. I have 2 modules of one project. So first module is dependent on second. Second module has dependencies on some libs. Second module can be itself installed as standalone app. So when i build the project the first war will contain packaged second module as well as all libs that sec...

Where to keep static fixtures (files) in Java project?

I'm testing a number of classes which manipulate files on disc. I created a number of "mocked" files which I will pass to these classes. The question is where in my directory tree I should save them? I'm using Maven. ...