maven-2

Restricting local Nexus repository to access Central

We are planning to release our corporate nexus repository to the developers. The problem in hand is that, we would like to enforce standards on the versions of jars that could be downloaded from the repository. For example, If we already have Spring framework version 3 available in nexus as an organization standard, then the developers c...

JAXWS wsimport stopping recompile

I am using NetBeans with the JaxWS maven plugin. My app has about 5 different wsdls I need to load. My problem is I want to stop maven or wsimport from recompiling my wsdl every time. I would like to be able to work/compile offline. If no connection is available do not attempt to pull down. This seems like staleFile or Keep would fi...

Replace a Source file in maven compile

Hi, I have to replace a java source file during maven compile if a special profile is active. I thought about just excluding the file from the standard src/main/java/ and including it from another source directory like src/main/java2/. But since the files have to have the same name and package the exclude always wins and the file from t...

maven - strange nfs problem when building

Hi, I have a maven project which builds OK locally (windows). When i try to build it on our svn server (linux) it hangs when running tests. I see a tmp file which is created: nfs0000000001e9c8a900000017 in the following dir from my test module: /project_name-test/target/surefire-reports The config in the pom is: <plugin> ...

How to display buildnumber in spring-based web application

I need to display build number in my index.jsp page <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <title>Title (build: BUILDNUMBER ) </head> The build number can be supplied by maven into a *.properties file. What is the best way to read *.properties file and display a property with Spring? ...

modify properties file in META-INF

I'm using maven and storing a properties file in src/main/resources which I can read fine like: properties.loadFromXML(this.getClass().getClassLoader(). getResourceAsStream("META-INF/properties.xml"); Is it possible to then write to this file when it is packaged up as a jar? I've tried the following: propertie...

Servlets, development, and a CDN for static files

I'm working on a Java site (jQuery, Wicket, Maven, Spring, Hibernate) and we have just started using a CDN to serve static files on our production server. We use a placeholder for the CDN domain, and have added it to every static file that references a static file. The placeholder gets replaced by Maven through properties filters with Ma...

maven-cobertura-plugion does not show the sources.

When I generate a Cobertura report by running "mvn cobertura:cobertura" (or "mvn site") then a report is generated which shows the test coverage for my classes but when I click on a class then the message "Unable to locate de/ailis/foo/Bar.java. Have you specified the source directory?" is displayed. How can I fix this? I configured the ...

Eliminate Maven POM redundancy

Hi, I have a parent POM with the following config <groupId>com.example</groupId> <artifactId>parent</artifactId> <version>1.2-SNAPSHOT</version> Each child project which inherits from this parent POM, has a config such as the following: <parent> <groupId>com.amadeus.jcp.ui.skinning.skinning-system</groupId> <artifactId>paren...

Download all Maven plugins

Is there an easy way to download all the official Maven plugins (http://maven.apache.org/plugins/index.html) with one command? I'm setting up an offline repository for use within a corporate environment and I wanted to make sure that I had all the official maven plugins available. ...

What is the best way of packaging Java software for running on Windows?

What's the best way to package Java software for running on Windows? Is there a standard for writing .BAT files which can discover the latest installed JRE on the machine? Are there any Maven plugins for this? What's the deal with executable Jar files? ...

Maven pom.xml - Project Aggregation

We have a aggregation .pom set up to include several, individual modules, similar to the Maven documentation: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> <packaging>pom</packaging> <modules> <module>my-module</module> <module>...

Maven Plugin error

Im a new user in maven. I have few doubts. I have some BAT files that has to executed via maven While executing my default commands, I need to echo the status like "Started first task" When the task gets failed user should get error message popup etc., Automatic repository update through maven Maven calling ant to build *.war Copying...

can't resolve another child project when running mvn tomcat:run

I'm developing a maven project with following structure: main // project which packaging is pom |-- datalevel-project |-- service-project `-- web-ui-project I'm trying to run project on tomcat but when I command mvn tomcat:run on the folder of main project I get an error while it is building the service-project: Failed to resolve ...

Having trouble getting m2eclipse and jetty to load SunJCE

In the lower levels of the application I am working on, the application uses SunJCE to encryt something (I'm pretty sure exactly what it is doing is not relevant to this question). Please let me know if you need more info on that and I'll dig it up. We always use a Sun JDK,so the having the dependency of the SunJCE is not a big issue f...

Creating multi module Maven Projects in Eclipse

Trying to create a multi module maven project in eclipse. Parent Pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; <modelVersion>4.0.0</modelVersion> <groupId>parent</gro...

Java Metro Security: StreamMessage has been already consumed

I'm using metro 2.0.1 for a client application who connects to WCF Service With security. Everything works fine in my unit tests but when I call the method in my Java application I get the following exception: Exception in thread "main" java.lang.AssertionError: StreamMessage has been already consumed. See the nested exception for where...

Maven2 sharing dependencies across parent and children (without redeclaring dependencies in children).

With maven1 I was using the extend tag to tell my children project to use their parent configuration. All dependencies declared in the parent were available in extending (children) projects. Now with maven2 I'm using the inheritance/composition feature and I have to redeclare my dependencies (minus the version number) in every child pr...

How to specify the commandline parameter expression to maven-help-plugin?

I want to specify the expression to evaluate on the command line, so the plugin does not go into interactive mode. According to the docs, the expression parameter should do the trick. I tried: mvn help:evaluate -Dexpression=project.groupId and mvn help:evaluate -Dexpression=xxx but the expression is ignored, and the plugin enters...

Is it possible to use a file other than one named "pom.xml" for maven 2?

I googled around a bit and couldn't find any way to do it, but was wondering if I could have a project with multiple poms for various situations, then tell maven to use 'this' one or 'that' one. The underlying issue is we have a project that needs to be built "for production" in one manner, and "for development" in another due to vagari...