Question

In a project I'm working on we are also using custom archetypes to make it easier to generate new domains/connectors. After trying to write automated tests to validate these archetypes I came across a problem with the generation of these archetypes. For some reason not all properties that are provided either using the -D flags or using the interactive mode are applied to the generated pom.xml

The archetype looks like this.

Running this command results in this pom.xml being generated. It applied the fields for the properties ${package} and ${domainInterface}, but not the ones for groupId, artifactId, version and name.

So my question is, am I doing something wrong, is the archetype broken or is that a bug in the maven archetype plugin?

Was it helpful?

Solution

I tried reproducing this by cloning the GitHub repository, installing the archetype locally and then running your command.

git clone https://github.com/openengsb/openengsb-framework.git
cd openengsb-framework/tooling/archetypes/domain
vim pom.xml

Removed the parent pom reference and then:

mvn clean install
mvn archetype:generate -DarchetypeGroupId=org.openengsb.tooling.archetypes -DarchetypeArtifactId=org.openengsb.tooling.archetypes.domain -DarchetypeVersion=3.0.0-SNAPSHOT -DgroupId=org.openengsb.domain -DartifactId=org.openengsb.domain.foodomain -Dversion=1.0.0-SNAPSHOT -Dname=FooDomain -DopenengsbVersion=3.0.0-SNAPSHOT -Dpackage=org.openengsb.domain.foodomain -DdomainInterface=FooDomain -DdomainName=foodomain -DinteractiveMode=false
cd org.openengsb.domain.foodomain/
cat pom.xml

Renders this pom.xml (only part of it pasted here):

  <properties>
    <bundle.symbolicName>org.openengsb.domain.foodomain</bundle.symbolicName>
    <bundle.namespace>org.openengsb.domain.foodomain</bundle.namespace>
    <domain.name>FooDomain</domain.name>
  </properties>

  <groupId>org.openengsb.domain</groupId>
  <artifactId>org.openengsb.domain.foodomain</artifactId>
  <version>1.0.0-SNAPSHOT</version>

  <name>FooDomain</name>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top