--- /dev/null
+#!/bin/bash
+
+# Name of this project, detected by it's base path
+NAME="${PWD##*/}"
+
+# Generated JAR file
+DIST="dist/${NAME}.jar"
+
+# WildFly module base path
+WILDFLY_MODULE_BASE_PATH="${HOME}/wildfly_domain/modules/org/mxchange"
+
+# And for this "module" (as WildFly calls it)
+WILDFLY_MODULE_PATH="${WILDFLY_MODULE_BASE_PATH}/${NAME}/main"
+
+# module.xml
+WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
+
+# Glassfish base path (domain)
+GLASSFISH_BASE_PATH="${HOME}/gf_domain/domain/lib"
+
+# Remote Glassfish path
+GLASSFISH_SSH_PATH="/var/payara/domains/domain1/lib"
+
+# Remote SSH server (password-less access)
+GLASSFISH_SSH_SERVER="www.mxchange.org"
+
+# Windows personal domain
+PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
+
+# Generate list
+LIST=`find ../*/lib/${NAME}.jar`
+LIST="${LIST} ${WILDFLY_MODULE_PATH}"
+
+if [ -d "${GLASSFISH_BASE_PATH}" ]
+then
+ echo "$0: Glassfish personal domain found, adding to LIST ..."
+ LIST="${LIST} ${GLASSFISH_BASE_PATH}"
+fi
+
+if [ -d "${PERSONAL_DOMAIN_PATH}" ]
+then
+ echo "$0: Personal domain found, adding to LIST ..."
+ LIST="${LIST} ${PERSONAL_DOMAIN_PATH}"
+fi
+
+if [ ! -f "${DIST}" ]
+then
+ echo "$0: '${DIST}' not found."
+ exit 1
+elif [ ! -d "${WILDFLY_MODULE_BASE_PATH}" ]
+then
+ echo "$0: WildFly base path '${WILDFLY_MODULE_BASE_PATH}' not created."
+elif [ ! -d "${WILDFLY_MODULE_PATH}" ]
+then
+ mkdir -vp "${WILDFLY_MODULE_PATH}"
+fi
+
+for project in ${LIST};
+do
+ if [ -d "${project}" ]
+ then
+ cp -v "${DIST}" "${project}"
+ elif [ -f "${project}" ]
+ then
+ cp -v "${DIST}" "${project}"
+ else
+ echo "$0: Project '${project}' not found."
+ fi
+
+done
+
+if [ -n "${GLASSFISH_SSH_PATH}" -a -n "${GLASSFISH_SSH_SERVER}" ]
+then
+ echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
+ scp "${DIST}" "${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}"
+fi
+
+# Copy module.xml ...
+if [ -f "${WILDFLY_MODULE_XML_FILE}" ]
+then
+ echo "$0: Generating module.xml ..."
+ XML_CONTENT=`cat "${WILDFLY_MODULE_XML_FILE}"`
+ XML_CONTENT="${XML_CONTENT//NAME/$NAME}"
+ echo "${XML_CONTENT}" > "${WILDFLY_MODULE_PATH}/module.xml"
+fi
+
+echo "$0: All done."
+exit 0
-annotation.processing.enabled=true\r
-annotation.processing.enabled.in.editor=true\r
-annotation.processing.processors.list=\r
-annotation.processing.run.all.processors=true\r
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output\r
-application.title=jaddressbook-core\r
-application.vendor=rhaeder\r
-auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml\r
-build.classes.dir=${build.dir}/classes\r
-build.classes.excludes=**/*.java,**/*.form\r
-# This directory is removed when the project is cleaned:\r
-build.dir=build\r
-build.generated.dir=${build.dir}/generated\r
-build.generated.sources.dir=${build.dir}/generated-sources\r
-# Only compile against the classpath explicitly listed here:\r
-build.sysclasspath=ignore\r
-build.test.classes.dir=${build.dir}/test/classes\r
-build.test.results.dir=${build.dir}/test/results\r
-# Uncomment to specify the preferred debugger connection transport:\r
-#debug.transport=dt_socket\r
-debug.classpath=\\r
- ${run.classpath}\r
-debug.test.classpath=\\r
- ${run.test.classpath}\r
-# Files in build.classes.dir which should be excluded from distribution jar\r
-dist.archive.excludes=\r
-# This directory is removed when the project is cleaned:\r
-dist.dir=dist\r
-dist.jar=${dist.dir}/jaddressbook-core.jar\r
-dist.javadoc.dir=${dist.dir}/javadoc\r
-endorsed.classpath=\r
-excludes=\r
-file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar\r
-file.reference.jcontacts-core.jar=lib/jcontacts-core.jar\r
-file.reference.juser-core.jar=lib/juser-core.jar\r
-includes=**\r
-jar.archive.disabled=${jnlp.enabled}\r
-jar.compress=false\r
-jar.index=${jnlp.enabled}\r
-javac.classpath=\\r
- ${file.reference.juser-core.jar}:\\r
- ${file.reference.jcontacts-core.jar}:\\r
- ${file.reference.jcontacts-business-core.jar}:\\r
- ${libs.jpa20-persistence.classpath}\r
-# Space-separated list of extra javac options\r
-javac.compilerargs=-Xlint:unchecked -Xlint:deprecation\r
-javac.deprecation=true\r
-javac.external.vm=true\r
-javac.processorpath=\\r
- ${javac.classpath}\r
-javac.source=1.7\r
-javac.target=1.7\r
-javac.test.classpath=\\r
- ${javac.classpath}:\\r
- ${build.classes.dir}\r
-javac.test.processorpath=\\r
- ${javac.test.classpath}\r
-javadoc.additionalparam=\r
-javadoc.author=true\r
-javadoc.encoding=${source.encoding}\r
-javadoc.noindex=false\r
-javadoc.nonavbar=false\r
-javadoc.notree=false\r
-javadoc.private=true\r
-javadoc.splitindex=true\r
-javadoc.use=true\r
-javadoc.version=true\r
-javadoc.windowtitle=JAddressbookCore\r
-jnlp.codebase.type=no.codebase\r
-jnlp.descriptor=application\r
-jnlp.enabled=false\r
-jnlp.mixed.code=default\r
-jnlp.offline-allowed=false\r
-jnlp.signed=false\r
-jnlp.signing=\r
-jnlp.signing.alias=\r
-jnlp.signing.keystore=\r
-# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.\r
-manifest.custom.application.library.allowable.codebase=\r
-# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.\r
-manifest.custom.caller.allowable.codebase=\r
-# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed\r
-manifest.custom.codebase=\r
-# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)\r
-manifest.custom.permissions=\r
-meta.inf.dir=${src.dir}/META-INF\r
-mkdist.disabled=true\r
-platform.active=default_platform\r
-project.license=gpl30\r
-run.classpath=\\r
- ${javac.classpath}:\\r
- ${build.classes.dir}\r
-# Space-separated list of JVM arguments used when running the project.\r
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.\r
-# To set system properties for unit tests define test-sys-prop.name=value:\r
-run.jvmargs=\r
-run.test.classpath=\\r
- ${javac.test.classpath}:\\r
- ${build.test.classes.dir}\r
-source.encoding=UTF-8\r
-source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/\r
-source.reference.jcontacts-core.jar=../jcontacts-core/src/\r
-source.reference.juser-core.jar=../juser-core/src/\r
-src.dir=src\r
-test.src.dir=test\r
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=true
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=jaddressbook-core
+application.vendor=rhaeder
+auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/jaddressbook-core.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar
+file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
+file.reference.juser-core.jar=lib/juser-core.jar
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=false
+jar.index=${jnlp.enabled}
+javac.classpath=\
+ ${file.reference.juser-core.jar}:\
+ ${file.reference.jcontacts-core.jar}:\
+ ${file.reference.jcontacts-business-core.jar}:\
+ ${libs.jpa20-persistence.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
+javac.deprecation=true
+javac.external.vm=true
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.7
+javac.target=1.7
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=true
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=true
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=true
+javadoc.windowtitle=JAddressbookCore
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=default
+jnlp.offline-allowed=false
+jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
+# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.
+manifest.custom.application.library.allowable.codebase=
+# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.
+manifest.custom.caller.allowable.codebase=
+# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
+manifest.custom.codebase=
+# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
+manifest.custom.permissions=
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=true
+platform.active=default_platform
+project.license=gpl30
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/
+source.reference.jcontacts-core.jar=../jcontacts-core/src/
+source.reference.juser-core.jar=../juser-core/src/
+src.dir=src
+test.src.dir=test