maven-2

Jetty JNDI error within Maven Jetty Plugin

I am trying to configure a JNDI data source that can be used from an invocation of the Maven Jetty Plugin. I am trying to do this external to the WAR file, so that anyone who might later deploy our webapp with Jetty will not have to edit a configuration file inside the WAR's WEB-INF directory. I created a jetty.xml file as follows: <?...

How to deploy OSGi apps and dependencies?

OSGi seems to have an excellent benefit of having small deployable artifacts by not wrapping dozens of JAR dependencies into a lib directory. However, I can't find anything that tells me an easy, reliable way to deploy dependencies to a container. For instance, I have an application that uses CXF and several Spring subprojects. If I need...

How to avoid "line is longer than 80 characters" for my SVN embedded $Id$ property?

This is my foo.java file: /** * LICENSE blah-blah-blah * @Version $Id$ */ public class Foo { } This is how the file looks after svn update: /** * LICENSE blah-blah-blah * @Version $Id: Foo.java 396 2010-10-14 06:31:27Z [email protected] $ */ public class Foo { } The length of line no.3 is over 80 characters and I...

HowTo Unit Test Client Server Code

Hi, I'm currently writing a Java Client Server Application. So i want to implement two Libraries, one for the Client and one for the Server. The Client Server Communication has a very strict protocol, that I wan't to test with JUnit. As build tool im using Maven and a Husdon Server for continues Integration. Actually I do not have an...

Is there any XML lint maven plugin?

I'm trying to validate my XML resources during maven build cycle. Is there any plugin for this purpose, or I should use ant + xmllint manually? ...

Have Hudson call multiple exec:java with profiles

Hi, I have a maven pom in which I've define some profiles. Each profile defines its own configuration for executing an exec:java goal. This exec:java invokes a java program that will do some work, which does not relies upon artifact compilation (but what I find very useful to put in maven pom). What I would like to do is have Hudson co...

Maven SQL plugin execution order

I am facing some problem in ordering the sql execution. We have one sql script file for each table under one directory. Ex: There is user.sql and role.sql in the directory c:\SqlScripts. We are using the sql maven plugin to execute these sql files. The role table has a Foriegn key to the user table and the execution is failing because...

Maven + Mercurial for Build Numbers

I can't figure out how to get a Mercurial revision id put into my Maven build (ideally I would like it in the MANIFEST of my jars and war). The closest solution I could find is: mvn -DbuildNumber=`hg id -i` Which won't really work for Windows or my Hudson server. Luckily Hudson tags my builds but I would like some more assurance if t...

Maven mojo plugin, how to define phases that must be triggered before this goal ?

hey, I have a deploy pojo plugin (deploying a war to a remote server). I have the remote-deploy plugin in the build section of pom definition, I need package phase to be triggered before deploy-remote goal, for it the war be already created before I secure-copy it to a remote server. With the execution elements (according to a documen...

Upload file via Ant FTP task in Maven

I'm trying to upload a file using an Ant task. If I use Ant directly the file is uploaded, but if I call the ant task via Maven (using the maven-antrun-plugin) I get the following error: An Ant BuildException has occured: The following error occurred while executing this line: /home/me/proj/build.xml:15: Problem: failed to create task ...

How can the Maven unique version string be customized?

I'd like to know what options exist to customize the timestamp string used in Maven artifact deploys when <uniqueVersion>true</uniqueVersion> is set. Ideally, we'd like to include the changelist number from source control instead of a timestamp as it's a more dependable means of determining what features and bug fixes are in a given bu...

Maven: how to override the dependency added by a library

Here's my generic problem: My project P depends on A which depends on B which depends on C which depends on version 1.0.1 of D. There's a problem with version 1.0.1 of D and I want to force the use of another module. I don't know how to declare this in my project's POMs since I haven't added a dependency on D directly. It's C which de...

Logging level under maven surefire

Hi, I'm unable to adjust java logging's logging level. I'm using maven surefire (mvn test), and trying to adjust from the default INFO to e.g. FINEST. I have logging.properties file under src/test/resources/logging.properties after compile, i see under target/test-classes, i see a logging.properties file with the intended config: jav...

how to make stable release in using Maven and SVN

Hi, we are having about 100 maven artifacts in our java based project. these artifacts categorize under 5 different products. obviously some of them are shared between products. the problem is that, if you tag a product in svn for a release. the tag is not stable. because dependent shared modules are snapshot and they can be changed by...

Maven: How to add files to the root inside an EAR with maven-ear-plugin?

I need to add 2 XML files inside an EAR generated with maven-ear-plugin. Unfortunately, I haven't seen a way to add an arbitrary file to an EAR; the documentation of the plugin which reads "The EAR plugin supports the following artifacts: ejb, war, jar, ejb-client, rar, ejb3, par, sar, wsr and har". There's nothing for adding a regular ...

Who runs Maven Central and why is there a delay before repository updates are available?

According to this issue, the maven-gae-plugin released an update and it took several hours before this was available from Maven Central. Who runs Maven Central and what causes this delay? ...

log4j can't initialize with my log4j.properties

I have a simple log4j.property file and a simple program that use log4j. But when I run my jar I see only this log4j:WARN No appenders could be found for logger (package com.mycompany.hellolog4j). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. ...

What problem(s) does Maven solve?

Hi, What problem(s) does Apache Maven solve? Am I correct in thinking that it basically solves (prevents even) versioning nightmares on external third party .DLLs. Any examples of how it would help in this? DOes it also help in any way, with inter-project (or package in Java) dependencies? Finally, is it basically a build automation to...

Running mvn exec:java from a remote directory not containing the pom.xml

I have a maven project built in '/some/where' which I wish to run/execute from another directory '/foo/bar'. I am currently running commands such as: cd /some/where mvn exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client with /some/where/pom.xml I wish to do something like: cd /foo/bar mvn -p /some/where/pom.xml exec:java -Dex...

Packaging Apache configuration files with WAR

I have built a Spring 3 MVC driven RESTful web service app. I use Maven 2 to manage the application lifecycle including packaging up the WAR for distribution. As part of the end solution, I filter application requests through Apache to handle some of the GET requests for static content. This of course requires that I have several custom ...