I am trying to create an own archetype which uses the following archetype-metadata.xml:
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="basic">
<fileSets>
<fileSet filtered="true">
<directory>src/main/java/__packageInPathFormat__</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
The pom.xml of the archetype looks 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.test</groupId>
<artifactId>my-archetype</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Archetype - my-archetype</name>
<properties>
<swaggerApiName>GreatApiName</swaggerApiName>
</properties>
</project>
There is a JaxRsActivator class which looks like this:
package ${package};
// many imports...
@ApplicationPath("res")
@SwaggerDefinition(
tags = {@Tag(name = "${swaggerApiName}",
description = "${swaggerApiDescription}")})
public class JaxRsActivator extends Application {
}
My goal is to replace the name and description dynamically.
According to this answer (https://stackoverflow.com/a/25523766/5444681) it should work. But it only works for ${package}
.
What am I doing wrong?
For some reason it works now with this archetype-metadata.xml:
I am not sure why it wasn't working before -- since this was the first approach I tried.