From d041546fda14fcede144b81f643c95e4d6d420f1 Mon Sep 17 00:00:00 2001 From: Samuel Meuli Date: Thu, 17 Oct 2019 13:54:43 +0200 Subject: [PATCH] Improve `archetype:generate` command (#107) * Improve default and descriptions of archetype parameters * Change variable usage to make POM valid XML * Update `maven-archetype-plugin` * Change `artifactId` variable default value --- pom.xml | 2 +- .../META-INF/maven/archetype-metadata.xml | 59 +++++++++++++------ .../resources/archetype-resources/pom.xml | 5 +- .../projects/angular/reference/pom.xml | 4 +- .../projects/react/reference/pom.xml | 4 +- 5 files changed, 46 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 271d29e..c92041e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 - 3.0.1 + 3.1.2 true ${skipTests} diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index 78a0ae2..52f88c6 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -106,43 +106,64 @@ + - + + + + + + ^[a-zA-Z0-9\_]+$ - mysamplespa - - - My Sample SPA - - - - ${projectTitle} + + + + ^[a-zA-Z0-9\.\-_]+$ - + + ^(angular|react)$ - react - - - - ^[a-zA-Z0-9\.\-_]+$ - + + + + ^[a-zA-Z0-9\.\-_]+$ - ${groupId}.${projectName} + ${projectName} - + + ^[a-z0-9\.]+$ ${groupId}.${projectName} - + + ^\d+(\.\d+){0,2}(\-SNAPSHOT)?$ 1.0.0-SNAPSHOT + + + + ${projectTitle} + diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index 380b036..726ca84 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -34,10 +34,7 @@ core - #if (${optionFrontend} == 'angular') angular-app - #end - #if (${optionFrontend} == 'react') react-app - #end + ${optionFrontend}-app ui.apps ui.content all diff --git a/src/test/resources/projects/angular/reference/pom.xml b/src/test/resources/projects/angular/reference/pom.xml index 924b728..8a936c5 100644 --- a/src/test/resources/projects/angular/reference/pom.xml +++ b/src/test/resources/projects/angular/reference/pom.xml @@ -34,8 +34,8 @@ core - angular-app - ui.apps + angular-app + ui.apps ui.content all diff --git a/src/test/resources/projects/react/reference/pom.xml b/src/test/resources/projects/react/reference/pom.xml index 55b3c37..36e35ec 100644 --- a/src/test/resources/projects/react/reference/pom.xml +++ b/src/test/resources/projects/react/reference/pom.xml @@ -34,8 +34,8 @@ core - react-app - ui.apps + react-app + ui.apps ui.content all