maven-2

Running test from Maven fails and stops building the jar

I am trying to build a jar using maven , this jar was build using ant. When I run tests from maven I got an: ERROR org.hibernate.tool.hbm2ddl.SchemaValidator could not complete schema validation org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'net.sourceforge.jtds.jdbc.Driver' which comes from: Caused by:...

How do I get Maven to fail when conflicting versions of the same artifact are referenced?

I'd like my Maven build to fail if the same artifact is referenced with different versions in my dependency tree. This would seem like a fairly trivial option, but I can't work out how to do it. Any clues? ...

How to build a jar using maven, ignoring test results ?

Actuality when i run tests they fails but i need to run them to get some .class files which are very important for my jar. By default when test results fails , the jar is not build , could i add a setting in pom.xml which ignore that, so I can build the jar ignoring results from tests ? I read something about "Maven Surefire Plugin" bu...

JUnit tests pass in Eclipse but fail in Maven Surefire

I have written some JUnit tests using JUnit 4 and spring-test libraries. When I run the tests inside Eclipse then run fine and pass. But when I run them using Maven (during the build process), they fail giving a spring related error. I am not sure what is causing the problem, JUnit, Surefire or Spring. Here is my test code, spring config...

Struts2 Error when Deploying: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory

I'm creating a basic Struts2, Maven webApp and getting this error when I deploy to Tomcat 6 or Jetty. Has anyone seen this? 2010-07-29 15:33:38.801::WARN: failed struts2 Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/C:/workspaces/test/test/target/work/webapp/WEB-INF/lib/struts2-core-2....

Why would extending JerseyTest vs extending TestCase cause no tests to be found.

I am attempting to get the Jersey test framework working. We are building using maven 1.x. I've created the following testcase... public class SomeResourceTest extends JerseyTest { public SomeResourceTest () throws Exception { super(new WebAppDescriptor.Builder(PACKAGE_NAME) .contextPath(PATH).bu...

How to proceed with ear build in maven2?

Hi Experts, I very new to maven2. Till yesterday i was successful in building war from maven2. My next target is to build ear file for a war file including few of jar files as well. Can you please help with that. I would be greatly thankful. Regards Gnash-85 ...

Can I have the same profile in pom.xml and in profiles.xml?

This is my pom.xml (portion of it): <profiles> <profile> <id>production</id> ... </profile> </profile> This is my profiles.xml: <profilesXml> <profiles> <profile> <id>production</id> ... </profile> </profiles> </profilesXml> Maven says: [WARNING] Overriding profile: 'production' (source: pom) wi...

Maven confused about JRE been used.

First off, I'm new to Maven, hence my problem might have a simple solution. I've created a project in eclipse and added maven dependencies. In Eclipse, it says that I am using JRE 1.5. Everything works fine in Eclipse, for instance, I can run my tests. When I try to run mvn clean install from the terminal, it gives me the following er...

How to let maven run a single test class with non-default profile activated?

I'm trying to let maven run a single test class but I need to use an additional profile (which in fact is already created). Normally when I run: mvn clean install -PmyProfile "myProfile" is being activated. So I tried: mvn -Dtest=myTest -PmyProfile test Which resulted in "[WARNING] Profile with id: 'myProfile' has not been activ...

using JSBuilder2.jar in Maven2 Web Application

Hi Folks, I have started playing with Maven2 and I'm attempting to port one of my projects from ant to maven. I have managed to build ear file, use jaxb and other bits, but there is one thing left I don't know how to approach. I have WAR module, with ExtJS code, and I'm using JSBuilder to create and package the code nicely. This is don...

What does it mean to "Mavenize" a project?

I've recently been asked to mavenize an existing project, and I don't know exactly what that means. On the maven website it outlines how to create a maven project from scratch, but what if I've already got a substantial amount of code? I'm comfortable working on the command line or in Eclipse/Netbeans. I know there are a lot of plugins...

Standard maven layout for a web application, do my .properties files go?

Assuming I have a .properties file and hibernate.cfg.xml in a standard maven web application layout where should they be placed so that they are included in my .war file when I run package? src/main/resources src/main/java src/main/webapp src/main/config ? ...

Is there a maven plugin that can diff files and output the result to file?

Hi. I've been working on integration-tests for a Java web service. The integration test now sends SOAP-requests to the server which are asserted via the SoapUI-plugin and for each of the SOAP-requests an xml file is produced and saved (a part of the integration-test phase). Is there a plugin that allows me to diff the xml files that ha...

How do you force maven to execute antrun:run task after all the package tasks in a POM with child modules?

I have a parent POM with a bunch of child modules. I want to run an antrun:run task after all the children have executed a package task (I'm using Ant to package my app since i gave up figuring out how to get assembly to work correctly). I need to have the antrun task execute after all the children - but I can't associate it with packag...

Managing maven dependancies - New Versions and Non-Repo libraries

Warning: I have just picked up Maven, so things mentioned might be wrong or not best practice. I have a medium size open source project that I am migrating to Maven from the basic NetBeans project management. This is not a developer team sharing the same room, this is 1-5 people over the internet sharing a SVN repo. Reading over the ho...

Build multiple Maven projects

I'm very new to Maven, and have a question about building multiple Maven projects. We have two Maven projects, Project A and Project B. Project A depends on an artefact generated by Project B. When changes to project A or B are checked into SVN, our local Hudson server builds the modified project (and any dependent projects) and uploa...

Build an ear using maven

Hi , I am new with maven, i have a task to change building of an ear from ant build to maven build. Are somewhere some tutorials related to this, how to build an ear using maven ? Please guide me if you know something related to this.... Thanks EDIT: Thanks a lot for posting, i read the given links, how i understood from there, th...

How can I specify the mainClass in the manifest with minijar-maven-plugin?

I'm using the minijar-maven-plugin to reduce the size of my jar-with-dependencies jar but I need to specify a mainClass like I can do easily with the maven assembly plugin. How can i specify the mainClass in the manifest while still using the minijar plugin? My minijar configuration is the default: <plugin> <artifactId>mini...

How to build multiple maven projects in one step without a common parent?

I have read that to build multiple Maven projects in one step (with automatic building of dependencies) the Maven reactor plugin can be used. However, all the examples I have seen show that in order to use this plugin, the interdependent packages are modules of a common parent project. Is it possible to use maven to build multiple proje...