Skip to content

Commit cd38b0a

Browse files
committed
Add archetype catalog fallback to seedstack.org
1 parent 97a3357 commit cd38b0a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version 2.6.1 (2017-08-04)
2+
3+
* [new] Fallback to seedstack.org archetype catalog if nothing is found on the default remote or locally.
4+
15
# Version 2.6.0 (2017-08-03)
26

37
* [new] Add the ability to template project file names in project archetypes.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>org.seedstack</groupId>
2121
<artifactId>seedstack-maven-plugin</artifactId>
22-
<version>2.6.0-SNAPSHOT</version>
22+
<version>2.6.1-SNAPSHOT</version>
2323
<packaging>maven-plugin</packaging>
2424

2525
<properties>

src/license/THIRD-PARTY.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Please fill the missing licenses for dependencies :
1414
#
1515
#
16-
#Thu Aug 03 17:33:53 CEST 2017
16+
#Fri Aug 04 17:22:50 CEST 2017
1717
classworlds--classworlds--1.1-alpha-2=
1818
commons-collections--commons-collections--3.1=
1919
dom4j--dom4j--1.6.1=

src/main/java/org/seedstack/maven/GenerateMojo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import java.util.Collections;
4848
import java.util.HashMap;
4949
import java.util.HashSet;
50-
import java.util.Locale;
5150
import java.util.Map;
5251
import java.util.Set;
5352

@@ -71,6 +70,7 @@
7170
public class GenerateMojo extends AbstractMojo {
7271
private static final String ARCHETYPE_PLUGIN_GROUP_ID = "org.apache.maven.plugins";
7372
private static final String ARCHETYPE_PLUGIN_ARTIFACT_ID = "maven-archetype-plugin";
73+
private static final String SEEDSTACK_ORG = "http://seedstack.org/maven/";
7474
private PebbleEngine stringTemplateEngine;
7575
private PebbleEngine fileTemplateEngine;
7676
@Parameter(defaultValue = "${project}", required = true, readonly = true)
@@ -320,6 +320,10 @@ private Set<String> findProjectTypes(String archetypeGroupId, String archetypeVe
320320
getLog().info("No remote archetype found with version " + archetypeVersion + ", trying the local catalog");
321321
possibleTypes.addAll(findArchetypes(archetypeGroupId, archetypeVersion, archetypeManager.getDefaultLocalCatalog()));
322322
}
323+
if (possibleTypes.isEmpty()) {
324+
getLog().info("No local archetype found with version " + archetypeVersion + ", falling back to seedstack.org");
325+
possibleTypes.addAll(findArchetypes(archetypeGroupId, archetypeVersion, archetypeManager.getRemoteCatalog(SEEDSTACK_ORG)));
326+
}
323327
if (possibleTypes.isEmpty()) {
324328
getLog().info("No suitable archetype found");
325329
}

0 commit comments

Comments
 (0)