File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -106,8 +106,21 @@ MAIN_NAME="HelloCodenameOne"
106106
107107LOCAL_MAVEN_REPO=" ${LOCAL_MAVEN_REPO:- $HOME / .m2/ repository} "
108108ba_log " Using local Maven repository at $LOCAL_MAVEN_REPO "
109+ mkdir -p " $LOCAL_MAVEN_REPO "
109110MAVEN_CMD=(" $MAVEN_HOME /bin/mvn" -Dmaven.repo.local=" $LOCAL_MAVEN_REPO " )
110111
112+ ARCHETYPE_PLUGIN_VERSION=" 3.2.1"
113+ ARCHETYPE_PLUGIN_JAR=" $LOCAL_MAVEN_REPO /org/apache/maven/plugins/maven-archetype-plugin/$ARCHETYPE_PLUGIN_VERSION /maven-archetype-plugin-$ARCHETYPE_PLUGIN_VERSION .jar"
114+
115+ if [ ! -f " $ARCHETYPE_PLUGIN_JAR " ]; then
116+ ba_log " Preloading Maven archetype plugin version $ARCHETYPE_PLUGIN_VERSION into $LOCAL_MAVEN_REPO "
117+ if ! xvfb-run -a " ${MAVEN_CMD[@]} " -B org.apache.maven.plugins:maven-archetype-plugin:" $ARCHETYPE_PLUGIN_VERSION " :help -Ddetail -Dgoal=generate; then
118+ ba_log " Failed to cache maven-archetype-plugin $ARCHETYPE_PLUGIN_VERSION ; archetype generation may download dependencies" >&2
119+ fi
120+ else
121+ ba_log " Maven archetype plugin $ARCHETYPE_PLUGIN_VERSION already cached"
122+ fi
123+
111124ba_log " Generating Codename One application skeleton"
112125xvfb-run -a " ${MAVEN_CMD[@]} " -q --offline archetype:generate \
113126 -DarchetypeArtifactId=cn1app-archetype \
You can’t perform that action at this time.
0 commit comments