adding a "outdated " maven dependency from different url (repository) - pom.xml

let say we would like to add this maven dependency in our POM.xml file from http://maven.jahia.org/maven2/ to a exiting POM file. What are some good(industry) practices of adding com.sun(or tools) dependency super pom ? new to maven, example or short reasonings are appreciated.
<!-- https://mvnrepository.com/artifact/com.sun/tools -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
</dependency>
<!-- Note: (http://maven.jahia.org/maven2/) -->
The existing POM file like this:
<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/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.example</groupId>
<artifactId>example</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>example-common</artifactId>
<packaging>jar</packaging>
<description>example</description>
<properties>
<example-version>7.2.0</example-version>
</properties>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>example-sdk</artifactId>
<version>${example-version}</version>
</dependency>
<dependencies>
</project>

This is a bit of an old question, but I had the same issue, and this worked.
Add into your project pom (also possible in maven settings if you need it for several projects), the Jahia repo.
<project>
...
<repositories>
<repository>
<id>jahia</id>
<name>jahia</name>
<url>http://maven.jahia.org/maven2/</url>
</repository>
</repositories>
...
</project>
If it's in the maven settings, then you put it inside of a profile but need to activate the profile when running maven (-Pprofilename) or via activation by default in settings.xml:
<profile>
...
<activation>
<activeByDefault>true
...
</profile>

Related

pom.xml error, unable to find what is wrong in my pom.xml

Screenshot of pom.xmlI am starting with Spring Project. Have the below error in the pom.xml (Spring Tool Suite)
Started a new project using Spring Tool Suite.
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>SpringInAction</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SpringInAction</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
On the eclipse, a Big red Cross :).................................
I got my problem resolve following these steps:
right click on your project
maven->update project
then check
Force update of Snapshots/Releases
ok
As I can't see your error details, instead,
in case that does not help: you can check this thread

referencing modules in pom packaging

How do I reference a module that is included in a pom.xml?
In the pom.xml referenced below how would I include the modules on the this pom so that it can be referenced in other projects as so:
<dependency>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
<dependencies>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.3</version>
</dependency>
</dependencies>
</project>
I think the best you can do is to put your sub-modules in the dependencyManagement section of your parent POM like so:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>module1</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>module3</artifactId>
<version>${project.version}</version>
</dependency>
<dependencies>
</dependencyManagement>
Then you can configure each of your sub-modules with whatever dependencies they need, without having to worry about the correct version number.
<!-- module2's dependencies -->
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>module1</artifactId>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>module3</artifactId>
</dependency>
<dependencies>
If you declared all the sub-modules as dependencies of the parent POM, then you'd end up with cyclic dependencies. For example:
[parent] -> [module1] -> [parent]
Maven doesn't like that.

Maven prefixing WEB-INF/classes into JAR dependency

Update: Solved! Posted solution as my own answer. Will be accepting it in two days when I'm allowed to.
A little back story
I've been chasing down this rabbit hole for the past few days, and my question has drastically changed shape over that time. Initially, I thought I had an issue with Spring Boot, because it failed to parse one of my #Configuration annotated classes. Debugging that, I determined that Spring was looking in all the right places for one of my JAR-bound dependencies, but was coming up with a FileNotFoundException when trying to load a class from the JAR.
I was thrown off by this, because the JAR in question was quite verifiably on the classpath. I could print out the classpath during app startup, and see my JAR living nice and cozy inside.
So I simplified. And simplified. Eventually, I got things down to a project with two Java source files, and a tiny placeholder JAR pulled through Maven. This JAR only contains one file: tiny/jar/BaseTest.class.
This worked perfectly. From there, I swapped the dependency JAR on this small project. . . and startup failed. So I compared the JARs and noticed something odd.
The realization
While my small JAR contained a folder hierarchy of:
tiny/jar/BaseTest.class
The larger JAR looked like:
WEB-INF/classes/com/company/...
This WEB-INF/classes prefix is the poison which is killing Spring Boot's class loader. It expects to find classes starting from the root: com/company/... -- no prefix allowed.
I believe that Maven's dependency management is doing something tricky here. When my JAR is created using the clean install goal, it has the com/company/... root inside of it. If I manually copy this version of the JAR into my servers WEB-INF/lib folder, everything works, recognizes, and fires up perfectly.
But when Maven is used to bring in the dependency, WEB-INF/classes is prefixed on to my folder hierarchy, breaking everything.
The question
Does anyone know how I can prevent Maven from altering the directory structure of my JAR? The JAR is 100% correct until Maven pulls it in as a dependency, and suddenly the WEB-INF/classes prefix appears.
Here are the three POM files for reference. I've cut out a large swath of dependencies, but left everything else intact for easier reading.
Tiny Jar POM
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tiny</groupId>
<artifactId>jar</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<name>jar</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
</project>
Big Jar POM
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>company-foundation</artifactId>
<version>0.7.0-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.4.0.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin> <!-- Sonar -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</build>
<repositories>
<!-- To use snapshots, you must also use the Sonatype Snapshots respository -->
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Project POM
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>dependency-issue</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>jar-dependency-issue</name>
<description>Barebones Spring Boot project used to demonstrate a JAR loading issue.</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>demo.JarDependencyIssueApplication</start-class>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- To run on a separate server, we need to mark tomcat starter as provided. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>com.company</groupId>
<artifactId>company-foundation</artifactId>
<version>0.7.0-SNAPSHOT</version>
</dependency>
-->
<dependency>
<groupId>tiny</groupId>
<artifactId>jar</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Solved my problem! I just got done poring over the configuring of my projects, comparing them for any suspicious deviations. Turns out that my larger JARs project in Eclipse had its Deployment Assembly (Found under Properties > Deployment Assembly) set to:
Source ============ Deploy Path
src/main/java --------> /WEB-INF/classes
src/main/resources -> /WEB-INF/classes
This caused my server to deploy the JAR into an internal /WEB-INF/classes folder.
Changing the Deploy Path setting to / fixed the problem! Everything is working perfectly now! Woo!

In multimodule maven project, how to execute proper goal for each module?

I have three maven projects in my prototype:
bookman (main project)
|-- bookman-back-lend (module, simple service app)
\-- bookman-front-web (module, simple web app)
This is very simple example book lending app (for library or something) to learn various technologies and all of that.
Problem is that I can't make parent pom to execute goals in module poms.
Calling mvn clean package wildfly:deploy in any module individually works without problem. It compiles, deploys, war is replaced, Wildfly 8 does its thing, etc. But if I call parent POM with mvn clean package (I'm not even sure what to call...), it doesn't do much - certainly it does not deploy to wildfly any of modules. Wildfly does not budge. In parent POM, calling mvn clean package wildfly:deploy does not work, of course.
Here is 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mader.bookman</groupId>
<artifactId>bookman</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Main BookMan superproject.</name>
<description>Main BookMan superproject.</description>
<modules>
<module>bookman-front-web</module>
<module>bookman-back-lend</module>
</modules>
</project>
And module POMs, with some stuff cut out for brevity (I assume they aren't related to my problem).
bookman-front-web/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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>bookman-front-web</artifactId>
<packaging>war</packaging>
<name>Frontend project - webpage.</name>
<description>Web page to handle lending books.</description>
<parent>
<groupId>org.mader.bookman</groupId>
<artifactId>bookman</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<properties>
...
</properties>
<repositories>
...
</repositories>
<dependencyManagement>
...
</dependencyManagement>
<dependencies>
...
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<defaultGoal>clean package wildfly:deploy</defaultGoal>
<plugins>
<plugin> <!-- To use, run: mvn clean package wildfly:deploy -->
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
</plugins>
</build>
</project>
And bookman-back-lend/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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>bookman-back-lend</artifactId>
<packaging>war</packaging>
<name>Backend project - lending.</name>
<description>Business logic to handle books, users and act of lending.</description>
<parent>
<groupId>org.mader.bookman</groupId>
<artifactId>bookman</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<properties>
...
</properties>
<repositories>
...
</repositories>
<dependencyManagement>
...
</dependencyManagement>
<dependencies>
...
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<defaultGoal>clean package wildfly:deploy</defaultGoal>
<plugins>
<plugin> <!-- To use, run: mvn clean package wildfly:deploy -->
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
</plugins>
</build>
</project>
It should be possible to have customized goals to execute for each module individually, right? Right? Otherwise those aggregate POMs are rather useless.
Unfortunately, questions like this suggest that maven goal executed on parent POM is exactly same goal to execute on child POMs. Who thinks up something like that? What if I need completely different goals in each child module?
All answers I found are few years old, maybe... just maybe... sanity prevailed and maven now allows something like that? After all, all information neccessary to do this should be accessible, like defaultGoal tag.
Problem was solved in radical way. Maven is dead, long live Gradle.
I was tinkering with it last few days and I already moved prototype to point where it actually works. While there is still tons of work left, I already know I will not be looking back.
So, yeah... if you have requirements that cannot be done easily or at all with Maven for various reasons, then consider Gradle. In fact, consider Gradle anyway.

Updating versions in multi-module Maven project

I am trying to release our multi-module Maven project and I can't figure out how to properly update the version numbers in our POMs.
The maven release plugin doesn't update versions in the parent POM dependencyManagement section - that seems to be a known bug.
I tried to use the versions plugin, but I have two issues with that:
the plugin only updates my toplevel POM; probably because the multi-module project POM is not the paremt POM of the modules's POMs
more significantly, how can I mimic the behavior of the release plugin to automatically compute the versions to set (e.g. 1.0.0) from the current version in the POMs (e.g. 1.0.0-SNAPSHOT)... without giong into perl scripting?
Any suggestion that doesn't involve scripting, and doesn't require me to declare dependency versions outside of dependencyManagement would be very appreciated!
Here are the 4 POMs (module POMs in their module subdirectory):
============ pom-parent.xml ==================
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>dummy-parent</artifactId>
<version>2.5</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
<artifactId>module1</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
============= multi-module pom: pom.xml ================
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acme</groupId>
<artifactId>dummy-parent</artifactId>
<relativePath>pom-parent.xml</relativePath>
<version>2.5</version>
</parent>
<groupId>com.acme</groupId>
<artifactId>multi-module</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
<module>module2</module>
</modules>
<scm>
<developerConnection>scm:svn:https://svnserver.fairisaac.com:8443/nowhere</developerConnection>
</scm>
</project>
============== module1 POM: module1/pom.xml ================
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acme</groupId>
<artifactId>dummy-parent</artifactId>
<relativePath>../pom-parent.xml</relativePath>
<version>2.5</version>
</parent>
<groupId>com.acme</groupId>
<artifactId>module1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
============= Module 2 POM: module2/pom.xml =============
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acme</groupId>
<artifactId>dummy-parent</artifactId>
<relativePath>../pom-parent.xml</relativePath>
<version>2.5</version>
</parent>
<groupId>com.acme</groupId>
<artifactId>module2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
<artifactId>module1</artifactId>
</dependency>
</dependencies>
</project>
========= Edit ==============
... and it gets better, if I replace the explicit version in the dependencyManagement section with
<version>${project.version}</version>
... maven 3.0.4 fails with an NPE:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.478s
[INFO] Finished at: Fri Apr 12 12:09:08 CEST 2013
[INFO] Final Memory: 9M/120M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project multi-
module: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare failed. NullPointerExcep
tion -> [Help 1]
This is not a bug, the first pom.xml you showed is outside your multi-module project. The maven-release-plugin will consider it an external dependency, thus it won't change the version.
But there is a flaw in your design, you have to move the
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
<artifactId>module1</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
to your multi-module pom.
I'm assuming your idea is to declare the module version in one place and share it among all modules. So, the module version goes into the multi-module pom dependencyManagement.
Usually external poms like this are used to put company information, repository paths, things like this, and they are shared by many different projects.

Resources