maven-2

Maven2: is there a way to make the build fail in case of unknown profile parameter?

We have three different maven2 profiles: prod, dev and test. One should be able to build with either one of those three profiles, or without any profile. In other words, following commands are acceptable: maven install maven -Pdev install maven -Ptest install maven -Pprod install In case someone writes for example maven -Ppord install,...

Maven2 Custom Profile For Testing

I want to create a custom profile for in my Maven2 pom.xml file to isolate test-related dependencies and settings, using the surefire plugin, but am somewhat confused by the documentation. Ultimately, I don't want junit/etc to be in the production deployment package. Does anyone have an example that can get me started? ...

How do I get Hudson to generate a Findbugs report without failing due to an exception?

Update As of Hudson Findbugs plug-in version 4.3 this is no longer an issue End Update As an example of my problem, I'm trying to build the following project http://www.sonatype.com/books/mvnex-book/reference/multimodule.html I added the following to simple-parent/pom.xml <reporting> <plugins> <plugin> <groupId>org.codeh...

Maven - Replace property in project.pom file when installing in repository

I have a parent project that defines a property, for example: <properties> <myproject-version>1.0</myproject-version> </properties> In a 'child' project I use <parent> <groupId>com.home</groupId> <artifactId>my-modules</artifactId> <version>${myproject-version}</version> </parent> Everything works nice, ...

Using Maven to Deploy to Weblogic Clusters

org.codehaus.mojo weblogic-maven-plugin 2.9.1 We're currently using the weblogic maven plugin successfully to deploy to our local WebLogic 9.2 instances. When we try to deploy to a remote environment we have a problem. We use a two machine cluster, with the admin server and managed server on one machine, and another managed server on a...

A Unicode Maven ArtifactId

I just tried creating a project in Maven whose artifactId is made up entirely of non-English characters ("日本国"). I get the following feedback from Maven: ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: com.worlde...

maven plugin newer updates

Is there a mechanism to track maven plugin version updates automatically. Since most of the time in dependencyManagement you hard-wire the version numbers for every plugin. Is there an administrative command to find this information on what newer versions are vailable for plugins declared in pom.xml? ...

How can I use different JARs for compiling and testing in maven?

I compile my programm against javaee-api. But for Junit testing I must use a specific implementation like glassfish's javaee.jar to avoid errors like java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/Persistence (see also 1). So avoid using methods, that are only a...

Maven LifeCycleExecutor with an incomplete configuration error

I am using the latest version 1.341 of the Hudson CI to build my maven-2 project (built using 2.2.0). But I get some warnings which I don't see if executed via a command prompt. Can someone let me know, how to debug this issue? ---------------------------------------------------------- Executing Maven: -B -f d:\work\software\data\hud...

The container 'Maven Dependencies' references non existing library

Hi, I use SpringSource Tool Suite 2.3.0. Recently I added the commons-compress dependency to pom.xml as required by jackrabbit 2.0 dependency. Updating maven dependencies console shows: "Missing artifact org.apache.commons:commons-compress:jar:1.0:compile" I checked the Problems view and it shows the following error: The container 'Mav...

Running all bound instances of a goal on the command line

I have a bunch of SQL commands bound to the pre-integration-test phase whose job is to create a "test" database and point the application to it. Sometimes, I want to just "rebuild" my test database without all the other stuff in the lifecycle. For example, if my test is catastrophically failing and screwing up the test database, I may ...

Modifying POM settings from plugin code.

Hi, I've just recently started writing Maven plugins and was wondering if there is a common way to modify the values within the pom.xml file e.g. changing an artifacts version number. With the exception of the line being modified I would want the remaining formatting within the xml file to be preserved. I'm just about to start manually...

Creating a web-service client directly from the source

Hi, I am trying to generate the WS client jar directly from the @Webservice class(es). Let's take this example : package com.example.maven.jaxws.helloservice; import javax.jws.WebService; @WebService public class Hello { public String sayHello(String param) { ; return "Hello " + param; } } I can gener...

Add mojo to custom lifecycle defined by another maven plugin

I'm using a maven plugin that defines a custom packaging type and lifecycle for my projects. Lets call this packaging "foo", defined by the "foo-plugin". I have no control over said plugin, but I want to extend it's lifecycle definition in my plugin. I am writing another plugin, lets call this one the "bar-plugin". I want a certain goal...

Problems setting up a dynamic web project in eclipse using Java EE and Tomcat

I am trying to get a simple helloworld test project going so I can build upon it. I am using Java EE with maven in Eclipse and am getting a Requested reseource is not available error from tomcat in my web browser. Right now all I have is a test jsp page to print Hello World which is all I am trying to get working. I created a maven pro...

How do I stop Maven 2.x from trying to retrieve non-existent pom.xml files for dependencies every build?

In my project, there are a number of dependencies that are transitively included from other dependencies that do not have pom.xml files available in any of our corporate repositories. These are internal jar-only libraries supported by various teams which have been uploaded into repositories for convenience from non-Maven teams, however t...

Maven expression for src/main/resources

How can I specify the main resource directory in Maven as a File? I'm using ${project.resources[0]}, but that is a org.apache.maven.model.Resource, whereas I need a java.io.File. I need this for usage in the rpm-maven-plugin: <mapping> <directory>${app.home}/cfg</directory> <sources> <source> <location>${project.resource...

Use method parameters names when generating WSDL from Java using wsgen and maven?

I'm generating a WSDL from a Java class using the @WebService annotation and running wsgen, triggered by a Maven build target. The problem I have is the generated WSDL defines the parameters for the web service operations as arg0, ar1, arg2, etc instead of using the parameter names from the code. These names are not helpful to clients ...

Bundling different java classes in a single jar files in a single jar

basically what I have is an application server running liferay portal. and we also have custom portlets that have shared custom libraries as well as third party ones. for instance dwr-3.0, several drools jar files, spring-webmvc, spring, etc. the problem is that is a nightmare for server administration, because when there is a deploy so...

How does the maven file structure work?

We are planning on restructuring a complex project with many modules/pieces, what ever you wanna call it. In order to move toward a standard directory structure, we would like to adopt the maven file structure. So the big question is: Can anybody provide a description of the maven file structure, where we don't have to dig through all ...