3 # Name of this project, detected by it's base path
7 DIST="dist/${NAME}.jar"
9 # WildFly module base path
10 WILDFLY_MODULE_BASE_PATH="${HOME}/wildfly_domain/modules/org/mxchange"
12 # And for this "module" (as WildFly calls it)
13 WILDFLY_MODULE_PATH="${WILDFLY_MODULE_BASE_PATH}/${NAME}/main"
16 WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
18 # Glassfish base path (domain)
19 GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
21 # Remote Glassfish path
22 GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
24 # Remote SSH server (password-less access)
25 GLASSFISH_SSH_SERVER="www.mxchange.org"
27 # Windows personal domain
28 PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
31 LIST=`find ../*/lib/${NAME}.jar`
32 LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
33 LIST="${LIST} ${WILDFLY_MODULE_PATH}"
35 if [ -d "${GLASSFISH_BASE_PATH}" ]
37 echo "$0: Glassfish personal domain found, adding to LIST ..."
38 LIST="${LIST} ${GLASSFISH_BASE_PATH}"
41 if [ -d "${PERSONAL_DOMAIN_PATH}" ]
43 echo "$0: Personal domain found, adding to LIST ..."
44 LIST="${LIST} ${PERSONAL_DOMAIN_PATH}"
49 echo "$0: '${DIST}' not found."
51 elif [ ! -d "${WILDFLY_MODULE_BASE_PATH}" ]
53 echo "$0: WildFly base path '${WILDFLY_MODULE_BASE_PATH}' not created."
55 elif [ ! -d "${WILDFLY_MODULE_PATH}" ]
57 mkdir -vp "${WILDFLY_MODULE_PATH}"
60 for project in ${LIST};
62 if [ -d "${project}" ]
64 cp -v "${DIST}" "${project}"
65 elif [ -f "${project}" ]
67 cp -v "${DIST}" "${project}"
69 echo "$0: Project '${project}' not found."
74 if [ -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" ]
76 echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
77 scp "${DIST}" "${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"
81 if [ -f "${WILDFLY_MODULE_XML_FILE}" ]
83 echo "$0: Generating module.xml ..."
84 XML_CONTENT=`cat "${WILDFLY_MODULE_XML_FILE}"`
85 XML_CONTENT="${XML_CONTENT//NAME/$NAME}"
86 echo "${XML_CONTENT}" > "${WILDFLY_MODULE_PATH}/module.xml"