I created an archetype that has a controlled dependency on one of my projects. Is it possible to tell the archetype to always use the latest version of this dependency when a new project is created with my archetype? Using RELEASE does not work for me, since I do not want to change the version every time the project is built.
<?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>${groupId}</groupId> <artifactId>${artifactId}</artifactId> <version>${version}</version> <packaging>jar</packaging> <dependencies> <dependency> <groupId>com.mycompany.someproject</groupId> <artifactId>someDependency</artifactId> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>com.mycompany.myproject</groupId> <artifactId>myArtifact</artifactId> <version>LATEST</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> </project>
I read this question, but the proposed solution with the maven version plugin does not seem to be suitable for two reasons. Firstly, I want to change the version when creating the project, and secondly, I do not want to change the versions of all the dependencies, but only one.
Edit: above pom.xml from archetypal resources (updated), below pom.xml from my archetype project itself.
<?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>com.mycompany.maven.archetype.be</groupId> <artifactId>maven-archetype-be-_moduleList</artifactId> <version>1.3-SNAPSHOT</version> <relativePath>../maven-archetype-be</relativePath> </parent> <artifactId>archetype-be-api</artifactId> <packaging>maven-archetype</packaging> <dependencies /> <name>archetype-be-api</name> </project>
EDIT2: RELEASE and LATEST don't seem to work at all in managed dependencies at all. Can someone confirm or deny this statement?
source share