Issue
I have a maven project with large pom file, I want one of my dependencies to be always the latest version which is deployed to our local antifactory server.
the name of this dependency is "WebInfra" and I use maven 3.x so the "LATEST" keyword is not working for me.
I'll put the pom file here and I'll be happy to find a solution for this problem. I need other dependencies to stay in their fixed version and only this dependency should upgraded to the latest version each time I call mvn clean deploy
on it.
I see "Versions Maven Plugin" and set its includes and excludes but not working for me :
I have webinfra-1.jar and then I deployed webinfra-2.0-SNAPSHOT into artifactory server but when I run mvn versions:use-latest-versions nothing happens. I expect my pom change into version 2.0-snapshot. What's going wrong here ?
<?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">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.dpdouran.web</groupId>
<artifactId>WebERP</artifactId>
<packaging>war</packaging>
<version>1.3-SNAPSHOT</version>
<name>WebERP</name>
<distributionManagement>
<repository>
<id>Douranrepository</id>
<name>Douranrepository</name>
<url>http://192.168.100.243:8082/artifactory/Douranrepository/</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>Douranrepository</id>
<name>Douranrepository</name>
<url>http://192.168.100.243:8082/artifactory/Douranrepository/</url>
</repository>
</repositories>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.1</gwtVersion>
<!-- GWT needs at least java 1.5 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Defaults -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
<!-- thirdparties -->
<dependency>
<groupId>org.thirdparty.grouped</groupId>
<artifactId>Thridparty</artifactId>
<version>1</version>
</dependency>
<!-- Douran artifacts -->
<dependency>
<groupId>org.dpdouran.accounting</groupId>
<artifactId>accounting</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.bi</groupId>
<artifactId>WebAnalytic</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.bi</groupId>
<artifactId>WebDashboard</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.bi</groupId>
<artifactId>ireport</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.bi</groupId>
<artifactId>reporting</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>WebCommon</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>baseinfo</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>coding</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>common</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>custom-editor</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>filemanager</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>formula</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>image</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>oa</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>webfilemanager</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.common</groupId>
<artifactId>weboa</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>BFonts</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>DecisionTable</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>ITIL</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>configfiles</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>db</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>dynamicreports</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.custom</groupId>
<artifactId>encrypt</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Attendanc</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Command</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Common</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Evaluation</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Knowledge</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_PayRoll</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Personnel</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Pishnehadat</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Recruitment</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Refahi</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>HR_Training</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>WebHumanResource</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.humanresource</groupId>
<artifactId>organizationchart</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.infrastructure</groupId>
<artifactId>Infra</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.infrastructure</groupId>
<artifactId>WebInfra</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.infrastructure</groupId>
<artifactId>WebInfraService</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.infrastructure</groupId>
<artifactId>webskin</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>WebSupport</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>production</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>projectmanagement</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>realestate</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>risk_management</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.logistics</groupId>
<artifactId>support</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>Manager</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>NetworkCommon</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>NetworkGraph</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>NetworkMonitoringUI</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>NetworkUtil</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>NetworkWebService</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>WebNetworkDiscovery</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>WebNetworkMonitoring</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>WebStockChart</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.network</groupId>
<artifactId>websocket-api</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.workflow</groupId>
<artifactId>WebCartable</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.workflow</groupId>
<artifactId>cartable</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.workflow</groupId>
<artifactId>workflow</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.dpdouran.workflow</groupId>
<artifactId>webworkflow</artifactId>
<version>1</version>
</dependency>
</dependencies>
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<includes>
<include>org.dpdouran.infrastructure:*</include>
</includes>
<excludes>
<exclude>org.codehaus.plexus:plexus-utils</exclude>
<exclude>com.google.gwt:*</exclude>
<exclude>javax.validation:*</exclude>
<exclude>org.codehaus.mojo:*</exclude>
<exclude>org.apache.maven.plugins:*</exclude>
</excludes>
</configuration>
</plugin>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!-- <goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal> -->
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see
gwt-maven-plugin documentation at codehaus.org -->
<configuration>
<extraJvmArgs>-Xmx8192M -Xss2048M </extraJvmArgs>
<!-- -Dfoo=bar -->
<runTarget>WebERP.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<!-- <i18nMessagesBundle>org.dpdouran.web.client.Messages</i18nMessagesBundle> -->
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Solution
You need to have two separate runs of Maven:
- Update the version with the versions maven plugin on command line.
- Run something like
mvn clean verify
to build the project.
You cannot change the version while building the project.
BTW: You configured Java 5. Are you really sure you want this?
Answered By - J Fabian Meier