maven-2

How to handle maven versions in a multi module project?

I have a maven project infrastructure like this: /trunk/all/pom.xml /trunk/all/libs/lib1/pom.xml /lib2/pom.xml ... /trunk/all/projects/p1/pom.xml /p2/pom.xml ... You see, I have a lot of libraries and a lot of projects using these libraries. All this is combined to ...

Include WebSphere runtimes

What's the best way to include the WebSphere runtimes when building a ear file using Maven? Using ant, I just added the absolute path to the lib directory in the classpath. What I've read on the subject, it seems like people say to use system scoped dependencies. For this, however, I need to include each jar independently (and there i...

How to specify jetty-env.xml file for Maven Cargo plugin for Jetty?

I am migrating from Maven's jetty plugin to the Cargo plugin (cargo-maven2-plugin) because Cargo will happily run WARs from dependent Maven modules. Within out web-app we have taken great pains to externalize all configuration through JNDI. These JNDI definitions are web-app specific and therefore are placed in a jetty-env.xml file tha...

Parent properties inside maven antrun plugin

There is a multi-module project. Inside the child I need to do some complicated stuff (integration test with deploying to application server and so on). So there is an integrationtest child, and from this module I need the root of the parent to reach other modules. I do not want to use "..". There is a property in integrationtest POM: <...

Maven directory structure

I'm new to Maven and I've been reading all morning tutorials (amazing tool). This new Java project I started looking at however doesn't use the default directory structure. Instead of src/main/java for sources it uses something like src/org/myapp. When I run mvn package on the project (where pom.xml is located) I get a message saying t...

How to configure embedded OpenEJB container for tests properly?

This is my SLSB: @Stateless public class MyService { PersistenceContext(unitName = "abc") EntityManager em; public boolean exists(int id) { return this.em.find(Employee.class, id) != null; } } This is my persistence.xml (I'm using Glassfish v3): <persistence> <persistence-unit name="abc"> <provider>org.hibernate.ejb...

Spring annotation configuration does not find directories/classes in JARs

I have the same problem as these guys: http://stackoverflow.com/questions/1242656/spring-annotation-based-controllers-not-working-if-it-is-inside-jar-file http://forum.springsource.org/showthread.php?t=64731 ...but the difference is that I use Maven 2 as a build tool. How do I achieve the same effect using Maven 2? I saw this soluti...

Define Eclipse project encoding as UTF-8 from Maven

Hi, I want to have the encoding of my project's file to be set to UTF-8. Following maven FAQ answer, I set the project.build.sourceEncoding property to UTF-8. unfortunatly, it has no effect. Then, by looking at a m2eclipse JIRA, I tried a workaround by defining compiler plugin sourceEncoding, but it neither worked, as I try to do that ...

how to compile src/test/java with maven when test code and main java code depends on the same jar file?

I am beginning to learn Maven and ran into a problem when I am trying to compile the test source code in a maven project. My main java source code is dependent on a jar file so I have a dependency declared in my pom file as following: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instanc...

How to override/prevent Maven Install Plugin behavior

Hi all, this is an odd request but here is the scenario. I am writing custom maven plugins that basically manipulate build versions then will install or deploy the modified jar. The plugin is called both via command line and a build profile. The plugins all have similar behavior, so the solution will work for all. Currently I am manipu...

Why embedded OpenEJB fails to deploy my application?

Hi, I can't understand why an embedded OpenEJB container fails at the beginning with very un-informative message (sorry for a long log): Running com.XXX.MyTest Apache OpenEJB 3.1.3 build: 20101015-05:42 http://openejb.apache.org/ INFO - openejb.home = [skipped...] INFO - openejb.base = [skipped...] INFO - Configuring Service(id=...

Is license information of a project's dependencies required when releasing a maven project as open source?

I am about to release a project I have been working with for some time as open source, but before I release it to the wild I want the code to be licensed properly. The project has several dependencies, on e.g. Jetty and Spring, and uses Maven for dependency management. Now, my question is: do I need to care about and/or add license infor...

Maven Exec Plugin not using system path on windows?

How can this not work in windows? <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2</version> <executions> <execution> <id>deploy-dev-ssh</id> <phase>install</phase> <goals> <goal>exec</goal> </goals> </execution> </execut...

How to remove duplicate content from pom.xml for Maven?

Hi, guys I ran into such a situation, when packaging a project using maven, I'd like both the source package and the binary package, and they have the same manifest.mf file. Then I have to write the same entry in both plugin configuration of maven-source-plugin and maven-jar-plugin, like this: <plugins> <plugin> ...

Why do I need to change project compliance to 1.5?

Hi! I created a project with maven2 on eclipse. After I added the hibernate-annotations dependency, i was trying to create a class using hibernate annotations(@Entity, @Table...), but it was giving me this error : Change project compliance and JRE to 1.5 I fixed it, but cannot understand why it requires this as long as my jdk is ...

Maven2 release plugin doens't want to tag

Hi all, We have a multi-module project on which I wanted to use the release plugin. The setup in subversion is /svn/repo/project -- branches -- tags -- trunk -- -- project -- -- pom.xml -- -- module1 -- -- -- pom.xml -- -- module2 -- -- -- pom.xml -- -- module3 -- -- -- pom.xml -- -- module4 -- -- -- pom.xml This proje...

Using Maven to run a remote command

What is the best way to have Maven execute a command on a remote server? Before I use a wagon to move my newly created jar to our development environment, I want to shut down a service that depends on it. The best I can come up with so far is to use the exec-maven-plugin to execute the remote command via ssh. Is there are better/more p...

are there any examples of how to use maven-jar-plugin ?

Hi, I am very new to Maven and would like to see an example of how one uses the maven jar plugin. I already visited here but did not find any examples. On the documentation page, there were some parameters listed for this goal but what I was looking for is how one places them in the 'goal' or 'executions' tag. Thanks. ...

Why datasource is not found in JNDI after injection from jndi.properties?

This is my persistence.xml: <persistence> <persistence-unit name="MyUnit"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/abcDS</jta-data-source> </persistence-unit> </persistence> This is jndi.properties file from src/test/resources which is supposed to create a datasource during testing...

ArtifactNotFoundException: The skin does not exist Exception during Maven build

We are using maven as a build tool for project. Till last week our build was going through successfully. Suddenly today we are getting following exception: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------...