mirror of
https://github.com/jlengrand/helidon.git
synced 2026-03-10 08:21:17 +00:00
remove old archetype build scripts (#2037)
This commit is contained in:
@@ -46,8 +46,6 @@ mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
|
||||
-Dmaven.test.failure.ignore=true \
|
||||
-Pexamples,archetypes,spotbugs,javadoc,sources,tck,tests,pipeline
|
||||
|
||||
examples/quickstarts/archetypes/test-archetypes.sh
|
||||
|
||||
#
|
||||
# test running from jar file, and then from module path
|
||||
#
|
||||
|
||||
@@ -99,7 +99,7 @@ readonly WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)
|
||||
readonly PREPARE_HOOKS=( )
|
||||
|
||||
# Hooks for deployment work
|
||||
readonly PERFORM_HOOKS=( ${WS_DIR}/examples/quickstarts/archetypes/deploy-archetypes.sh )
|
||||
readonly PERFORM_HOOKS=( )
|
||||
|
||||
source ${WS_DIR}/etc/scripts/pipeline-env.sh
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# Helidon Archetypes
|
||||
|
||||
These are scripts for creating and deploying the Helidon quickstart archetypes.
|
||||
To simplify maintenance of the quickstart examples and archetypes we generate
|
||||
the archetypes on the fly using a shell script.
|
||||
|
||||
We also want to keep the example poms clean, which further limits our option
|
||||
(don't want any archetype configuration in the example poms).
|
||||
|
||||
So, we resorted to the following scripts:
|
||||
* `create-archetype.sh`: Creates a single archetype from an existing project
|
||||
* `create-archetypes.sh`: Creates all the Helidon archetypes
|
||||
* `set-version.sh`: Iterates over the quickstart examples poms and changes the
|
||||
`helidon.version` property in the poms to be the specified version.
|
||||
* `deploy-archetypes.sh`: calls create-archetypes.sh to create and build the
|
||||
archetypes, and then deploys them.
|
||||
|
||||
## Making changes to quickstart examples and trying the archetypes
|
||||
|
||||
For local development you can change the examples at will
|
||||
and try them out. Once you are done messing with the examples
|
||||
and you want to try out the archetypes, do this:
|
||||
|
||||
```
|
||||
bash test-archetypes.sh
|
||||
```
|
||||
@@ -1,375 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
trap 'echo "ERROR: Error occurred at ${BASH_SOURCE}:${LINENO} command: ${BASH_COMMAND}"' ERR
|
||||
set -eo pipefail
|
||||
|
||||
usage(){
|
||||
echo ""
|
||||
echo "Usage: `basename ${0}` [OPTIONS] PARAMETERS"
|
||||
echo ""
|
||||
echo "Create an archetype from an existing project."
|
||||
echo ""
|
||||
echo "Parameters:"
|
||||
echo " --projectdir=PATH input project directory to create an archetype from"
|
||||
echo " --groupid=XXX groupId of the input project"
|
||||
echo " --artifactid=XXX artifactId of the input project"
|
||||
echo " --version=XXX version of the input project"
|
||||
echo " --name=XXX name of the input project"
|
||||
echo " --package=XXX base Java package of the input project"
|
||||
echo " --archetype-name=XXX name of the generated archetype"
|
||||
echo " --archetype-description=XXX description of the generated archetype"
|
||||
echo " --archetype-groupid=XXX groupId of the generated archetype"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --clean delete the generated archetype directory if it exists"
|
||||
echo " --exludes=XXX regular expression for files to exclude"
|
||||
echo " --maven-args arguments for the maven command to execute post generation (e.g. install)"
|
||||
echo " --help print the usage and exit"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# parse command line arguments
|
||||
for ((i=1;i<=${#*};i++))
|
||||
{
|
||||
arg="${!i}"
|
||||
case "${arg}" in
|
||||
"--projectdir="*)
|
||||
readonly PROJECT_DIR="${arg#*=}"
|
||||
;;
|
||||
"--groupid="*)
|
||||
readonly GROUPID="${arg#*=}"
|
||||
;;
|
||||
"--artifactid="*)
|
||||
readonly ARTIFACTID="${arg#*=}"
|
||||
;;
|
||||
"--version="*)
|
||||
readonly VERSION="${arg#*=}"
|
||||
;;
|
||||
"--name="*)
|
||||
readonly NAME="${arg#*=}"
|
||||
;;
|
||||
"--package="*)
|
||||
readonly PACKAGE="${arg#*=}"
|
||||
;;
|
||||
"--archetype-name="*)
|
||||
readonly ARCHETYPE_NAME="${arg#*=}"
|
||||
;;
|
||||
"--archetype-description="*)
|
||||
readonly ARCHETYPE_DESCRIPTION="${arg#*=}"
|
||||
;;
|
||||
"--archetype-groupid="*)
|
||||
readonly ARCHETYPE_GROUPID="${arg#*=}"
|
||||
;;
|
||||
"--excludes="*)
|
||||
readonly EXCLUDES="${arg#*=}"
|
||||
;;
|
||||
"--maven-args="*)
|
||||
readonly MAVEN_ARGS="${arg#*=}"
|
||||
;;
|
||||
"--clean")
|
||||
readonly CLEAN="true"
|
||||
;;
|
||||
"--help")
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "ERROR: Unknown option: ${arg}"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo ""
|
||||
MISSING_PARAMS=false
|
||||
if [ -z "${PROJECT_DIR}" ] ; then
|
||||
echo "ERROR: Missing required parameter --projectdir"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${GROUPID}" ] ; then
|
||||
echo "ERROR: Missing required parameter --groupid"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${ARTIFACTID}" ] ; then
|
||||
echo "ERROR: Missing required parameter --artifactid"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${VERSION}" ] ; then
|
||||
echo "ERROR: Missing required parameter --version"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${NAME}" ] ; then
|
||||
echo "ERROR: Missing required parameter --name"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${PACKAGE}" ] ; then
|
||||
echo "ERROR: Missing required parameter --package"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${ARCHETYPE_GROUPID}" ] ; then
|
||||
echo "ERROR: Missing required parameter --archetype-groupid"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${ARCHETYPE_NAME}" ] ; then
|
||||
echo "ERROR: Missing required parameter --archetype-name"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if [ -z "${ARCHETYPE_DESCRIPTION}" ] ; then
|
||||
echo "ERROR: Missing required parameter --archetype-description"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if ${MISSING_PARAMS} ; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readonly DEFAULT_EXCLUDES="^[a-z]*\.gradle$|^\.idea$|^\.iml$"
|
||||
if [ -z "${EXCLUDES}" ] ; then
|
||||
readonly EXCLUDES="${DEFAULT_EXCLUDES}"
|
||||
fi
|
||||
|
||||
# verify project directory
|
||||
if [ ! -d "${PROJECT_DIR}" ] ; then
|
||||
echo "ERROR: Invalid project directory: ${PROJECT_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# absolute path to project directory
|
||||
PROJECT_DIR_PATH=$(cd "${PROJECT_DIR}" ; pwd -P)
|
||||
PROJECT_DIRNAME=$(basename "${PROJECT_DIR_PATH}")
|
||||
PROJECT_DIR_PARENT=$(cd "${PROJECT_DIR}/.." ; pwd -P)
|
||||
|
||||
if [ -h "${0}" ] ; then
|
||||
readonly SCRIPT_PATH="$(readlink "$0")"
|
||||
else
|
||||
readonly SCRIPT_PATH="${0}"
|
||||
fi
|
||||
|
||||
readonly MY_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; pwd -P)
|
||||
readonly ARCHETYPE_BASEDIR="${MY_DIR}"
|
||||
readonly ARCHETYPE_DIRNAME="target/${ARTIFACTID}"
|
||||
readonly ARCHETYPE_DIR="${ARCHETYPE_BASEDIR}/${ARCHETYPE_DIRNAME}"
|
||||
|
||||
if [ -d "${ARCHETYPE_DIR}" ] ; then
|
||||
if [ "${CLEAN}" = "true" ] ; then
|
||||
rm -rf ${ARCHETYPE_DIR}
|
||||
else
|
||||
echo "ERROR: Generated archetype directory exists ${ARCHETYPE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "INFO: Generating archetype project at ${ARCHETYPE_DIR}"
|
||||
mkdir -p ${ARCHETYPE_DIR}
|
||||
|
||||
echo "INFO: Generating archetype pom"
|
||||
cat ${MY_DIR}/templates/pom.xml | sed \
|
||||
-e s@__GROUPID__@"${ARCHETYPE_GROUPID}"@g \
|
||||
-e s@__ARTIFACTID__@"${ARTIFACTID}"@g \
|
||||
-e s@__VERSION__@"${VERSION}"@g \
|
||||
-e s@__NAME__@"${ARCHETYPE_NAME}"@g \
|
||||
-e s@__DESCRIPTION__@"${ARCHETYPE_DESCRIPTION}"@g \
|
||||
> ${ARCHETYPE_DIR}/pom.xml
|
||||
|
||||
# Process a java file into a template.
|
||||
# $1 input base directory
|
||||
# $2 input filename
|
||||
# $3 output base directory
|
||||
# $4 output directory name
|
||||
processJavaFile(){
|
||||
local input_basedir=${1}
|
||||
local input_filename=${2}
|
||||
local output_basedir=${3}
|
||||
local output_dirname=${4}
|
||||
local inputfile_basename=`basename ${input_basedir}/${input_filename}`
|
||||
local outputfile=${output_basedir}/${output_dirname}/${inputfile_basename}
|
||||
|
||||
if [[ ${input_filename} =~ ${EXCLUDES} ]] ; then
|
||||
echo "INFO: Excluding ${input_filename}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "INFO: Processing ${input_filename}"
|
||||
echo "INFO: Generating template at ${output_dirname}/${inputfile_basename}"
|
||||
|
||||
echo "#set( \$symbol_pound = '#' )" >> ${outputfile}
|
||||
echo "#set( \$symbol_dollar = '$' )" >> ${outputfile}
|
||||
echo "#set( \$symbol_escape = '\' )" >> ${outputfile}
|
||||
|
||||
cat ${input_basedir}/${input_filename} | sed \
|
||||
-e s@"${PACKAGE}"@'${package}'@g \
|
||||
-e s@"${ARTIFACTID}"@'${artifactId}'@g \
|
||||
-e s@"${VERSION}"@'${version}'@g \
|
||||
>> ${outputfile}
|
||||
}
|
||||
|
||||
# Process a top level file into a template.
|
||||
# $1 input base directory
|
||||
# $2 input filename
|
||||
# $3 output base directory
|
||||
# $4 output directory name
|
||||
processFile(){
|
||||
local input_basedir=${1}
|
||||
local input_filename=${2}
|
||||
local output_basedir=${3}
|
||||
local output_dirname=${4}
|
||||
local outputfile=${output_basedir}/${output_dirname}/${input_filename}
|
||||
|
||||
if [[ ${input_filename} =~ ${EXCLUDES} ]] ; then
|
||||
echo "INFO: Excluding ${input_filename}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "INFO: Processing ${input_filename}"
|
||||
echo "INFO: Generating template at ${output_dirname}/${input_filename}"
|
||||
|
||||
mkdir -p `dirname ${outputfile}`
|
||||
|
||||
echo "#set( \$symbol_pound = '#' )" >> ${outputfile}
|
||||
echo "#set( \$symbol_dollar = '$' )" >> ${outputfile}
|
||||
echo "#set( \$symbol_escape = '\' )" >> ${outputfile}
|
||||
|
||||
cat ${input_basedir}/${input_filename} | sed \
|
||||
-e s@"${GROUPID}"@'${groupId}'@g \
|
||||
-e s@"${ARTIFACTID}"@'${artifactId}'@g \
|
||||
-e s@"${VERSION}"@'${version}'@g \
|
||||
-e s@'#'@'${symbol_pound}'@g \
|
||||
>> ${outputfile}
|
||||
}
|
||||
|
||||
# Process a top level file into a template.
|
||||
# $1 input base directory
|
||||
# $2 input filename
|
||||
# $3 output base directory
|
||||
# $4 output directory name
|
||||
processProjectPom(){
|
||||
local input_basedir=${1}
|
||||
local input_filename=${2}
|
||||
local output_basedir=${3}
|
||||
local output_dirname=${4}
|
||||
local outputfile=${output_basedir}/${output_dirname}/${input_filename}
|
||||
|
||||
echo "INFO: Processing ${input_filename}"
|
||||
echo "INFO: Generating pom.xml at ${output_dirname}/${input_filename}"
|
||||
|
||||
cat ${input_basedir}/${input_filename} | sed \
|
||||
-e s@"${PACKAGE}."@'${package}.'@g \
|
||||
-e s@"<groupId>${GROUPID}</groupId>"@'<groupId>${groupId}</groupId>'@g \
|
||||
-e s@"<artifactId>${ARTIFACTID}</artifactId>"@'<artifactId>${artifactId}</artifactId>'@g \
|
||||
-e s@"^ <version>${VERSION}</version>"@' <version>${version}</version>'@g \
|
||||
-e s@"<name>${NAME}</name>"@'<name>${project.artifactId}</name>'@g \
|
||||
-e s@'<relativePath>.*</relativePath>'@'<relativePath/>'@g \
|
||||
> ${outputfile}
|
||||
}
|
||||
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/archetype-resources
|
||||
|
||||
# process main sources
|
||||
if [ -d "${PROJECT_DIR_PATH}/src/main/java" ] ; then
|
||||
echo "INFO: Processing Java files under src/main/java"
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/archetype-resources/src/main/java
|
||||
for javaFile in `find ${PROJECT_DIR_PATH}/src/main/java -type f -name "*.java" | sed s@"^${PROJECT_DIR_PATH}/"@@g` ; do
|
||||
processJavaFile \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${javaFile} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources/src/main/java
|
||||
done
|
||||
fi
|
||||
|
||||
# process test sources
|
||||
if [ -d "${PROJECT_DIR_PATH}/src/test/java" ] ; then
|
||||
echo "INFO: Processing Java files under src/test/java"
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/archetype-resources/src/test/java
|
||||
for javaFile in `find ${PROJECT_DIR_PATH}/src/test/java -type f -name "*.java" | sed s@"^${PROJECT_DIR_PATH}/"@@g` ; do
|
||||
processJavaFile \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${javaFile} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources/src/test/java
|
||||
done
|
||||
fi
|
||||
|
||||
# process resources
|
||||
if [ -d "${PROJECT_DIR_PATH}/src/main/resources" ] ; then
|
||||
echo "INFO: Processing resources under src/main/resources"
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/archetype-resources/src/main/resources/
|
||||
for resourceFile in `find ${PROJECT_DIR_PATH}/src/main/resources -type f | sed s@"^${PROJECT_DIR_PATH}"@@g` ; do
|
||||
processFile \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${resourceFile} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources
|
||||
done
|
||||
fi
|
||||
|
||||
# process test resources
|
||||
if [ -d "${PROJECT_DIR_PATH}/src/test/resources" ] ; then
|
||||
echo "INFO: Processing resources under src/test/resources"
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/archetype-resources/src/test/resources/
|
||||
for resourceFile in `find ${PROJECT_DIR_PATH}/src/test/resources -type f | sed s@"^${PROJECT_DIR_PATH}"@@g` ; do
|
||||
processFile \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${resourceFile} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources
|
||||
done
|
||||
fi
|
||||
|
||||
# process all other files
|
||||
echo "INFO: Processing all other files under ${PROJECT_DIR}"
|
||||
for file in `find ${PROJECT_DIR_PATH} -type f | sed s@"^${PROJECT_DIR_PATH}/"@@g` ; do
|
||||
if [[ ${file} =~ ^target|^src/main/java|^src/test/java|src/main/resources|src/test/resources ]] ; then
|
||||
continue
|
||||
fi
|
||||
if [ `basename ${file}` != "pom.xml" ] ; then
|
||||
processFile \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${file} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources
|
||||
else
|
||||
processProjectPom \
|
||||
${PROJECT_DIR_PARENT}/${PROJECT_DIRNAME} \
|
||||
${file} \
|
||||
${ARCHETYPE_DIR} \
|
||||
src/main/resources/archetype-resources
|
||||
fi
|
||||
done
|
||||
|
||||
echo "INFO: Generating archetype-metadata.xml"
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/main/resources/META-INF/maven
|
||||
cat ${MY_DIR}/templates/archetype-metadata.xml | sed \
|
||||
-e s@__ARTIFACTID__@"${ARTIFACTID}"@g \
|
||||
> ${ARCHETYPE_DIR}/src/main/resources/META-INF/maven/archetype-metadata.xml
|
||||
|
||||
# smoke test
|
||||
mkdir -p ${ARCHETYPE_DIR}/src/test/resources/projects/basic
|
||||
echo "package=it.pkg" >> ${ARCHETYPE_DIR}/src/test/resources/projects/basic/archetype.properties
|
||||
echo "version=0.1-SNAPSHOT" >> ${ARCHETYPE_DIR}/src/test/resources/projects/basic/archetype.properties
|
||||
echo "groupId=archetype.it" >> ${ARCHETYPE_DIR}/src/test/resources/projects/basic/archetype.properties
|
||||
echo "artifactId=basic" >> ${ARCHETYPE_DIR}/src/test/resources/projects/basic/archetype.properties
|
||||
touch ${ARCHETYPE_DIR}/src/test/resources/projects/basic/goal.txt
|
||||
|
||||
echo "DONE!"
|
||||
echo ""
|
||||
|
||||
if [ ! -z "${MAVEN_ARGS}" ] ; then
|
||||
mvn -B -f ${ARCHETYPE_DIR}/pom.xml ${MAVEN_ARGS}
|
||||
fi
|
||||
@@ -1,106 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
trap 'echo "ERROR: Error occurred at ${BASH_SOURCE}:${LINENO} command: ${BASH_COMMAND}"' ERR
|
||||
set -eo pipefail
|
||||
|
||||
usage(){
|
||||
echo ""
|
||||
echo "Usage: `basename ${0}` [OPTIONS] --version=XXX"
|
||||
echo ""
|
||||
echo "Create archetypes from the quickstart examples."
|
||||
echo "Parameter:"
|
||||
echo "--version=XXX current Helidon version"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --maven-args=XXX arguments for the maven command to execute post generation (default is install)"
|
||||
echo " --help print the usage and exit"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# parse command line arguments
|
||||
for ((i=1;i<=${#*};i++))
|
||||
{
|
||||
arg="${!i}"
|
||||
case "${arg}" in
|
||||
"--version="*)
|
||||
readonly HELIDON_VERSION="${arg#*=}"
|
||||
;;
|
||||
"--maven-args="*)
|
||||
readonly MAVEN_ARGS="${arg#*=}"
|
||||
;;
|
||||
"--help")
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "ERROR: Unknown option: ${arg}"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo ""
|
||||
MISSING_PARAMS=false
|
||||
if [ -z "${HELIDON_VERSION}" ] ; then
|
||||
echo "ERROR: Missing required parameter --version"
|
||||
MISSING_PARAMS=true
|
||||
fi
|
||||
if ${MISSING_PARAMS} ; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${MAVEN_ARGS}" ] ; then
|
||||
readonly MAVEN_ARGS="install"
|
||||
fi
|
||||
|
||||
if [ -h "${0}" ] ; then
|
||||
readonly SCRIPT_PATH="$(readlink "$0")"
|
||||
else
|
||||
readonly SCRIPT_PATH="${0}"
|
||||
fi
|
||||
readonly MY_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; pwd -P)
|
||||
readonly EXAMPLE_DIR=$(cd "${MY_DIR}/.." ; pwd -P)
|
||||
|
||||
${MY_DIR}/create-archetype.sh \
|
||||
--clean \
|
||||
--projectdir="${EXAMPLE_DIR}/helidon-quickstart-se" \
|
||||
--groupid="io.helidon.examples" \
|
||||
--artifactid="helidon-quickstart-se" \
|
||||
--version="${HELIDON_VERSION}" \
|
||||
--package="io.helidon.examples.quickstart.se" \
|
||||
--name="Helidon Quickstart SE Example" \
|
||||
--archetype-name="Helidon Quickstart SE Archetype" \
|
||||
--archetype-description="Quickstart archetype for Helidon SE" \
|
||||
--archetype-groupid=io.helidon.archetypes \
|
||||
--maven-args="${MAVEN_ARGS}"
|
||||
|
||||
${MY_DIR}/create-archetype.sh \
|
||||
--clean \
|
||||
--projectdir="${EXAMPLE_DIR}/helidon-quickstart-mp" \
|
||||
--groupid="io.helidon.examples" \
|
||||
--artifactid="helidon-quickstart-mp" \
|
||||
--version="${HELIDON_VERSION}" \
|
||||
--package="io.helidon.examples.quickstart.mp" \
|
||||
--name="Helidon Quickstart MP Example" \
|
||||
--archetype-name="Helidon Quickstart MP Archetype" \
|
||||
--archetype-description="Quickstart archetype for Helidon MP" \
|
||||
--archetype-groupid=io.helidon.archetypes \
|
||||
--maven-args="${MAVEN_ARGS}"
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
trap 'echo "ERROR: Error occurred at ${BASH_SOURCE}:${LINENO} command: ${BASH_COMMAND}"' ERR
|
||||
set -eo pipefail
|
||||
|
||||
# Path to this script
|
||||
if [ -h "${0}" ] ; then
|
||||
readonly SCRIPT_PATH="$(readlink "$0")"
|
||||
else
|
||||
readonly SCRIPT_PATH="${0}"
|
||||
fi
|
||||
|
||||
# Current directory
|
||||
readonly MY_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; pwd -P)
|
||||
|
||||
readonly MVN_VERSION=$(mvn \
|
||||
-q \
|
||||
-f ${MY_DIR}/../pom.xml \
|
||||
-Dexec.executable="echo" \
|
||||
-Dexec.args="\${project.version}" \
|
||||
--non-recursive \
|
||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
|
||||
|
||||
if [ -n "${STAGING_REPO_ID}" ] ; then
|
||||
readonly MAVEN_REPO_URL="https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${STAGING_REPO_ID}/"
|
||||
else
|
||||
readonly MAVEN_REPO_URL="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
fi
|
||||
|
||||
readonly MAVEN_DEPLOY_ARGS="org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy -DaltDeploymentRepository=ossrh::default::${MAVEN_REPO_URL}"
|
||||
readonly MAVEN_ARGS="${MAVEN_ARGS} clean verify -DskipTests gpg:sign ${MAVEN_DEPLOY_ARGS}"
|
||||
|
||||
${MY_DIR}/create-archetypes.sh \
|
||||
--version="${MVN_VERSION}" \
|
||||
--maven-args="${MAVEN_ARGS}"
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<archetype-descriptor
|
||||
name="__ARTIFACTID__"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<fileSets>
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/test/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet filtered="true" encoding="UTF-8">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet filtered="true" encoding="UTF-8">
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet filtered="true" encoding="UTF-8">
|
||||
<directory></directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/java/**</exclude>
|
||||
<exclude>src/test/java/**</exclude>
|
||||
<exclude>src/main/resources/**</exclude>
|
||||
<exclude>src/test/resources/**</exclude>
|
||||
<exclude>pom.xml</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</archetype-descriptor>
|
||||
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>__GROUPID__</groupId>
|
||||
<artifactId>__ARTIFACTID__</artifactId>
|
||||
<version>__VERSION__</version>
|
||||
<packaging>maven-archetype</packaging>
|
||||
|
||||
<name>__NAME__</name>
|
||||
|
||||
<description>__DESCRIPTION__</description>
|
||||
|
||||
<url>https://helidon.io</url>
|
||||
|
||||
<organization>
|
||||
<name>Oracle Corporation</name>
|
||||
<url>http://www.oracle.com/</url>
|
||||
</organization>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache 2.0</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Tomas Langer</name>
|
||||
<email>tomas.langer@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Tim Quinn</name>
|
||||
<email>tim.quinn@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Romain Grecourt</name>
|
||||
<email>romain.grecourt@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Laird Jarrett Nelson</name>
|
||||
<email>laird.nelson@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Santiago Pericas-Geertsen</name>
|
||||
<email>santiago.pericasgeertsen@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Bryan Atsatt</name>
|
||||
<email>bryan.atsatt@oracle.com</email>
|
||||
<organization>Oracle Corporation</organization>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:oracle/helidon.git</developerConnection>
|
||||
<connection>scm:git:git@github.com:oracle/helidon.git</connection>
|
||||
<tag>HEAD</tag>
|
||||
<url>https://github.com/oracle/helidon</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.archetype</groupId>
|
||||
<artifactId>archetype-packaging</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-archetype-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
trap 'echo "ERROR: Error occurred at ${BASH_SOURCE}:${LINENO} command: ${BASH_COMMAND}"' ERR
|
||||
set -eo pipefail
|
||||
|
||||
# Path to this script
|
||||
if [ -h "${0}" ] ; then
|
||||
readonly SCRIPT_PATH="$(readlink "$0")"
|
||||
else
|
||||
readonly SCRIPT_PATH="${0}"
|
||||
fi
|
||||
|
||||
# Directory this script resides in
|
||||
readonly MY_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; pwd -P)
|
||||
|
||||
# Current directory
|
||||
readonly CURRENT_DIR=${PWD}
|
||||
|
||||
readonly MVN_VERSION=$(mvn \
|
||||
-q \
|
||||
-f ${MY_DIR}/../pom.xml \
|
||||
-Dexec.executable="echo" \
|
||||
-Dexec.args="\${project.version}" \
|
||||
--non-recursive \
|
||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
|
||||
|
||||
${MY_DIR}/create-archetypes.sh \
|
||||
--version=${MVN_VERSION} \
|
||||
--maven-args="install"
|
||||
|
||||
# cd to an innocuous directory since the archetypes will create
|
||||
# a project here when we test it. See issue #64
|
||||
TARGET_DIR=${MY_DIR}/target
|
||||
cd ${TARGET_DIR}
|
||||
|
||||
rm -rf ${TARGET_DIR}/test-* || true
|
||||
|
||||
# invoke the helidon-quickstart-se archetype
|
||||
mvn archetype:generate -DinteractiveMode=false \
|
||||
-DarchetypeGroupId=io.helidon.archetypes \
|
||||
-DarchetypeArtifactId=helidon-quickstart-se \
|
||||
-DarchetypeVersion=${MVN_VERSION} \
|
||||
-DgroupId=com.examples \
|
||||
-DartifactId=test-helidon-quickstart-se \
|
||||
-Dpackage=com.examples.test.helidon.se
|
||||
|
||||
# build the generated project
|
||||
mvn -f ${PWD}/test-helidon-quickstart-se/pom.xml install
|
||||
|
||||
# invoke the helidon-quickstart-mp archetype
|
||||
mvn archetype:generate -DinteractiveMode=false \
|
||||
-DarchetypeGroupId=io.helidon.archetypes \
|
||||
-DarchetypeArtifactId=helidon-quickstart-mp \
|
||||
-DarchetypeVersion=${MVN_VERSION} \
|
||||
-DgroupId=com.examples \
|
||||
-DartifactId=test-helidon-quickstart-mp \
|
||||
-Dpackage=com.examples.test.helidon.mp
|
||||
|
||||
# build the generated project
|
||||
mvn -f ${PWD}/test-helidon-quickstart-mp/pom.xml install
|
||||
|
||||
# cd back to original directory
|
||||
cd ${CURRENT_DIR}
|
||||
Reference in New Issue
Block a user