From a4e8e34bb58b0b68cddf2690e2ea8ab6b6a4439d Mon Sep 17 00:00:00 2001 From: Horia Chiorean Date: Fri, 4 Mar 2016 15:17:59 +0200 Subject: [PATCH] MODE-2543 Updates the quickstarts to Wildfly 10 and ModeShape 5 Also, it changes the build system for the quickstarts so they're much more automated and the tests are run each time a distribution is created. --- README.md | 8 +- .../assembly/assembly.xml => assembly.xml | 3 +- dist/pom.xml | 48 -- modeshape-cdi/README.md | 49 +- modeshape-cdi/pom.xml | 234 +++++---- .../src/test/resources/log4j.properties | 13 +- modeshape-cli/README.md | 65 +-- modeshape-cli/pom.xml | 238 ++++----- .../src/main/resources/create-repository.cli | 15 - .../src/main/resources/remove-repository.cli | 6 - .../src/test/resources/log4j.properties | 11 - modeshape-clustering/README.md | 77 +-- modeshape-clustering/pom.xml | 204 +++++--- .../clustering/ClusteringController.java | 2 +- .../clustering/ClusteringControllerTest.java | 2 +- .../src/test/resources/log4j.properties | 13 +- .../modeshape/clustered-repo-cache-config.xml | 68 --- .../modeshape/jgroups-config.xml | 37 -- .../standalone-modeshape-node1.xml | 473 ------------------ .../standalone-modeshape-node2.xml | 473 ------------------ modeshape-ejb/README.md | 50 +- modeshape-ejb/pom.xml | 201 +++++--- .../src/test/resources/log4j.properties | 13 +- modeshape-federation/README.md | 59 +-- modeshape-federation/pom.xml | 225 ++++++--- .../src/test/resources/log4j.properties | 13 +- .../standalone-modeshape-federation.xml | 85 ++-- .../federated-repository-cache-config.xml | 14 - modeshape-servlet/README.md | 65 +-- modeshape-servlet/pom.xml | 206 +++++--- .../src/test/resources/log4j.properties | 13 +- pom.xml | 30 +- 32 files changed, 947 insertions(+), 2066 deletions(-) rename dist/src/main/assembly/assembly.xml => assembly.xml (93%) delete mode 100644 dist/pom.xml delete mode 100644 modeshape-cli/src/main/resources/create-repository.cli delete mode 100644 modeshape-cli/src/main/resources/remove-repository.cli delete mode 100644 modeshape-clustering/standalone/configuration/modeshape/clustered-repo-cache-config.xml delete mode 100644 modeshape-clustering/standalone/configuration/modeshape/jgroups-config.xml delete mode 100644 modeshape-clustering/standalone/configuration/standalone-modeshape-node1.xml delete mode 100644 modeshape-clustering/standalone/configuration/standalone-modeshape-node2.xml rename modeshape-federation/{standalone/configuration => }/standalone-modeshape-federation.xml (88%) delete mode 100644 modeshape-federation/standalone/configuration/modeshape/federated-repository-cache-config.xml diff --git a/README.md b/README.md index d73eb38..e1e0ed0 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Each quickstart is a small, specific, focused, working example that can be used System requirements ------------------- -All you need to build the quickstarts is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. Each quickstart -produces a web application (WAR) that is designed to be run on JBoss Wildfly 9. +All you need to build the quickstarts is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. Each quickstart +produces a web application (WAR) that is designed to be run on JBoss Wildfly 9 or 10. Contents -------- @@ -32,9 +32,9 @@ for help on how to install and configure Maven 3._ To create a zip distribution with all the quickstarts, run the following Maven command: - mvn clean install -Pdist + mvn clean verify -Pdist -The output will be placed in the [dist/target](dist/target) folder. +The output will be placed in the [target](target) folder. The ModeShape project --------------------- diff --git a/dist/src/main/assembly/assembly.xml b/assembly.xml similarity index 93% rename from dist/src/main/assembly/assembly.xml rename to assembly.xml index 554b9a5..d6e17c8 100644 --- a/dist/src/main/assembly/assembly.xml +++ b/assembly.xml @@ -9,9 +9,10 @@ - ${project.basedir}/.. + . / + assembly.xml **/*.war dist/** template/** diff --git a/dist/pom.xml b/dist/pom.xml deleted file mode 100644 index ff0ad99..0000000 --- a/dist/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - org.modeshape.quickstarts - modeshape-quickstarts-dist - 4.5.0.Final - ModeShape AS Quickstarts Distribution - POM for building the quickstarts distribution. - http://www.modeshape.org - pom - - - 2.4 - - - - - - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - - - - maven-assembly-plugin - - - distribution - package - - single - - - - src/main/assembly/assembly.xml - - modeshape-quickstarts-${project.version} - false - - - - - - - - diff --git a/modeshape-cdi/README.md b/modeshape-cdi/README.md index 5cbf726..98b53f6 100644 --- a/modeshape-cdi/README.md +++ b/modeshape-cdi/README.md @@ -11,36 +11,21 @@ a JSF application, using only CDI. System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly 9. +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly 9 or 10. -Install ModeShape's AS kit into an existing Wildfly server ------------------------------------------------------ -Before running this demo make sure that you have installed the ModeShape Wildfly kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start JBoss Wildfly with the ModeShape configuration --------------------------------------------------------------------------------- - -1. Open a command line and navigate to the root of the JBoss server directory. -2. The following shows the command line to start the server with the ModeShape profile: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape.xml - -Build and Deploy the Quickstart +Running the Quickstart ------------------------- _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) for help on how to install and configure Maven 3._ -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type this command to build and deploy the archive: - mvn clean package wildfly:deploy + mvn clean package -4. This will deploy `target/modeshape-cdi.war` to the running instance of the server. +3. This will start a local Wildfly instance located at `target\wildfly', unpack and copy the ModeShape WF kit and deploy `target/modeshape-cdi.war` to the running instance of the server. Accessing the application --------------------- @@ -59,27 +44,17 @@ based on which one of the following actions can be performed 1. Show children - displays the children of node located at "Parent Absolute Path" 2. Add Node - add a new child with the given name under the node located at "Parent Absolute Path" -Undeploy the Archive --------------------- - -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive: - - mvn wildfly:undeploy - Run the Arquillian Tests ------------------------- -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. +This quickstart provides some optional Arquillian tests. These are part of separate profile and can be run like so: -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to run the tests: - mvn clean package -Parq-jbossas-remote + mvn clean verify -Pdist -The above command will run the tests using the predefined repository named `sample` (see above). +The above command will start a server with the ModeShape WF kit deployed and run the tests using the predefined repository named `sample` (see above). The ModeShape project --------------------- diff --git a/modeshape-cdi/pom.xml b/modeshape-cdi/pom.xml index 5b1997d..3bcdb75 100644 --- a/modeshape-cdi/pom.xml +++ b/modeshape-cdi/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-cdi - 4.5.0.Final + 5.0-SNAPSHOT war Example of a JSF web application that uses ModeShape via CDI @@ -12,24 +18,11 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 + 5.0-SNAPSHOT + 1.0.2.Final - - - 4.5.0.Final + 10.0.0.Final + jboss-wf-dist @@ -112,105 +105,146 @@ ${project.artifactId} - - - - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} - - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - org.apache.maven.plugins - maven-surefire-plugin - ${version.surefire.plugin} - - - org.apache.maven.plugins - maven-war-plugin - ${version.war.plugin} - - false - - - - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} - - + + + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly.maven.plugin} + + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone-modeshape.xml + + + + org.apache.maven.plugins + maven-war-plugin + + false + + + + maven-surefire-plugin + ${version.surefire.plugin} + + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + - - - default true + - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + package + + run + + + - arq-jbossas-remote + dist + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + pre-integration-test + + start + + + + stop-server + post-integration-test + + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*Test + + + + + + + org.wildfly.arquillian @@ -219,4 +253,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-cdi/src/test/resources/log4j.properties b/modeshape-cdi/src/test/resources/log4j.properties index 8bc3a0c..a8a262e 100644 --- a/modeshape-cdi/src/test/resources/log4j.properties +++ b/modeshape-cdi/src/test/resources/log4j.properties @@ -9,15 +9,4 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO -log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file +log4j.logger.org.junit=DEBUG \ No newline at end of file diff --git a/modeshape-cli/README.md b/modeshape-cli/README.md index f7aed4e..268c52e 100644 --- a/modeshape-cli/README.md +++ b/modeshape-cli/README.md @@ -11,45 +11,21 @@ a JSF application, after the ModeShape subsystem and the repository have be set System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly 9. +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly. -Install ModeShape's AS kit into an existing JBoss Wildfly server ------------------------------------------------------ -Before running this demo make sure that you have installed the ModeShape AS kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start Wildfly with the default configuration --------------------------------------------------------------------------------- - -1. Open a command line and navigate to the root of the JBoss server directory. -2. The following shows the command line to start the server with the ModeShape profile: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone.xml - -Run the CLI script that creates the demo repository --------------------------------------------------------------------------------- - -1. Open a command line and navigate to the root of the JBoss server directory. -2. The following shows the command line which runs the script that creates the repository: - - For Linux: JBOSS_HOME/bin/jboss-cli.sh -c --file=QUICKSTART_ROOT/src/main/resources/create-repository.cli - For Windows: JBOSS_HOME\bin\jboss-cli.bat -c --file=QUICKSTART_ROOT\src\main\resources\create-repository.cli - -Build and Deploy the Quickstart +Running the Quickstart ------------------------- _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) for help on how to install and configure Maven 3._ -1. Make sure you have started the JBoss Server and have ran the CLI script as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type this command to build and deploy the archive: - mvn clean package wildfly:deploy + mvn clean package -4. This will deploy `target/modeshape-cli.war` to the running instance of the server. +4. This will start a local Wildfly instance located at `target\wildfly', unpack and copy the ModeShape WF kit and deploy `target/modeshape-cli.war` to the running instance of the server. Accessing the application --------------------- @@ -57,32 +33,17 @@ Accessing the application The application will be running at the following URL: and will display a simple, read-only form which displays information about the repository which was created via the CLI script. -Undeploy the Archive --------------------- - -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive: - - mvn wildfly:undeploy - -Remove the demo repository ---------------------------- -If you want to cleanup the repository and other ModeShape related data, you can run the following script: - - For Linux: JBOSS_HOME/bin/jboss-cli.sh -c --file QUICKSTART_ROOT/src/main/resources/remove-repository.cli - For Windows: JBOSS_HOME\bin\jboss-cli.bat -c --file QUICKSTART_ROOT\src\main\resources\remove-repository.cli - Run the Arquillian Tests ------------------------- -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. +This quickstart provides some optional Arquillian tests. These are part of separate profile and can be run like so: + +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to run the tests: -1. Make sure you have started the JBoss Server and have ran the CLI script as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: + mvn clean verify -Pdist - mvn clean package -Parq-jbossas-remote +The above command will start a server with the ModeShape WF kit deployed and run the tests using a custom created repository. The ModeShape project --------------------- diff --git a/modeshape-cli/pom.xml b/modeshape-cli/pom.xml index cfae899..d632eac 100644 --- a/modeshape-cli/pom.xml +++ b/modeshape-cli/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-cli - 4.5.0.Final + 5.0-SNAPSHOT war Example of a JSF web application that uses CLI scripts to create and remove a repository @@ -12,24 +18,12 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 1.0.2.Final + 10.0.0.Final + jboss-wf-dist - 4.5.0.Final + 5.0-SNAPSHOT @@ -106,83 +100,77 @@ ${project.artifactId} - - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly.maven.plugin} - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone.xml - - org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - org.apache.maven.plugins - maven-surefire-plugin - ${version.surefire.plugin} - org.apache.maven.plugins maven-war-plugin - ${version.war.plugin} false - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} + maven-surefire-plugin + ${version.surefire.plugin} + + true + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + - - - default true @@ -190,81 +178,93 @@ - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + package + + run + + + + + /extension=org.modeshape:add() + /subsystem=modeshape:add + /subsystem=modeshape/repository=test-cli:add() + + + + + - - run-scripts-automatically + dist - maven-surefire-plugin - ${version.surefire.plugin} - - true - - - + org.wildfly.plugins wildfly-maven-plugin - - undeploy - clean + run-server + package + + start + + + + execute-commands + pre-integration-test - undeploy execute-commands - shutdown - true - true - false - - - + + /extension=org.modeshape:add() + /subsystem=modeshape:add + /subsystem=modeshape/repository=test-cli:add() + - - - create-test-repository + stop-server + post-integration-test - execute-commands + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify - compile - - - - - + + **/*Test + - - - - arq-jbossas-remote org.wildfly.arquillian @@ -273,4 +273,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-cli/src/main/resources/create-repository.cli b/modeshape-cli/src/main/resources/create-repository.cli deleted file mode 100644 index 7a5b9de..0000000 --- a/modeshape-cli/src/main/resources/create-repository.cli +++ /dev/null @@ -1,15 +0,0 @@ -# Check if the ModeShape extension is present and if not, add it -if (outcome != success) of /extension=org.modeshape:read-resource - /extension=org.modeshape:add() -end-if - -# Check if the ModeShape subsystem needs creating -if (outcome != success) of /subsystem=modeshape:read-resource - /subsystem=modeshape:add -end-if - -# Add the test repository -if (outcome != success) of /subsystem=modeshape/repository=test-cli:read-resource - /subsystem=modeshape/repository=test-cli:add(cache-config="modeshape/sample-cache-config.xml",cache-name="sample") - :reload -end-if diff --git a/modeshape-cli/src/main/resources/remove-repository.cli b/modeshape-cli/src/main/resources/remove-repository.cli deleted file mode 100644 index 7f32b1d..0000000 --- a/modeshape-cli/src/main/resources/remove-repository.cli +++ /dev/null @@ -1,6 +0,0 @@ -# Remove the test repository if it exists -if (outcome == success) of /subsystem=modeshape/repository=test-cli:read-resource - /subsystem=modeshape/repository=test-cli:remove - :reload -end-if - diff --git a/modeshape-cli/src/test/resources/log4j.properties b/modeshape-cli/src/test/resources/log4j.properties index 8bc3a0c..dcc9a5f 100644 --- a/modeshape-cli/src/test/resources/log4j.properties +++ b/modeshape-cli/src/test/resources/log4j.properties @@ -10,14 +10,3 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file diff --git a/modeshape-clustering/README.md b/modeshape-clustering/README.md index ebb11af..8a5ef95 100644 --- a/modeshape-clustering/README.md +++ b/modeshape-clustering/README.md @@ -4,66 +4,39 @@ Example Clustering 2 ModeShape Repositories What is it? ----------- -This is a self-contained and deployable Maven 3 project that shows how to cluster 2 ModeShape repositories. -This example contains a set of configuration files for a simple two node deployment: +This is a self-contained and deployable Maven 3 project that shows how to cluster 2 ModeShape repositories using JBoss Wildfly - - the set consists of the `standalone-modeshape-node1.xml` and `standalone-modeshape-node2.xml` files. They show how a - ModeShape repository can be clustered in replicated mode, with indexes being stored locally on the file system of each cluster - node, in separate folders. +**The example uses an H2 database for purely demonstrative purposes. Never use H2 in a production system when clustering** System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly. +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly 9 or 10. -Install ModeShape's Wildfly kit into an existing JBoss Wildfly server ---------------------------------------------------------------- - -Before running this demo make sure that you have installed the ModeShape Wildfly kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start 2 JBoss Wildfly instances with the set of provided configurations (see above) --------------------------------------------------------------------------------------- - -1. Copy the `standalone` folder from the root of the quickstart into the `JBOSS_HOME`folder -2. Open a command line and navigate to the root of the JBoss server directory. -3. Start the first server: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape-node1.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape-node1.xml -4. Start the second server: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape-node2.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape-node2.xml - - -Build and Deploy the Quickstart into each of the running servers ----------------------------------------------------------------- +Running the quickstart +------------------------ _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) for help on how to install and configure Maven 3._ -1. Make sure you have started the 2 JBoss Server instances as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive into the `node1` server: - - mvn clean package wildfly:deploy +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to unpack in the `target` folder a full JBoss Wildfly installation with the ModeShape WF Kit installed: -4. Type this command to build and deploy the archive into the `node2` server: + mvn clean package +3. Navigate to the `target/wildfly/bin` folder and run each of following commands: - mvn clean package wildfly:deploy -Dwildfly.port=9991 + standalone.bat -c standalone-modeshape-ha.xml -5. This will deploy `target/modeshape-clustering.war` to each of the running instances of the server. + standalone.bat -c standalone-modeshape-ha.xml -Djboss.socket.binding.port-offset=1 + +4. You should now have two different server instances running locally Accessing the application ---------------------- - -The application will be running at the following URLs: +------------------------- - On the `node1` server: - On the `node2` server: +The application will be running at http://localhost:8080/modeshape-clustering and http://localhost:8081/modeshape-clustering respectively. Open the above URLs in two different browsers (or 2 different browser tabs/windows). @@ -79,29 +52,17 @@ based on which one of the following actions can be performed 2. Add Node - add a new child with the given name under the node located at "Parent Absolute Path" 3. Search - searches for nodes which have in their name the given string pattern -Undeploy the Archive --------------------- - -1. Make sure you have started the 2 JBoss Server instances as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive from the `node1` server: - - mvn wildfly:undeploy - -4. When you are finished testing, type this command to undeploy the archive from the `node2` server: - - mvn wildfly:undeploy -Dwildfly.port=9991 Run the Arquillian Tests ------------------------- This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. -1. Make sure you have started the JBoss Server corresponding to `node1` as described above. +1. Make sure you have started the first Wildfly server as described above 2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: +3. Type the following command to run the tests: - mvn clean package -Parq-wildfly-remote + mvn clean verify -Pdist The ModeShape project --------------------- diff --git a/modeshape-clustering/pom.xml b/modeshape-clustering/pom.xml index 7a7f6cd..dd258fd 100644 --- a/modeshape-clustering/pom.xml +++ b/modeshape-clustering/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-clustering - 4.5.0.Final + 5.0-SNAPSHOT war Example of a JSF web application that uses several clustered ModeShape servers @@ -12,24 +18,12 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 1.0.2.Final + 10.0.0.Final + jboss-wf-dist - 4.5.0.Final + 5.0-SNAPSHOT @@ -115,53 +109,13 @@ - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} - - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - org.apache.maven.plugins maven-surefire-plugin ${version.surefire.plugin} + + true + + org.apache.maven.plugins maven-war-plugin @@ -179,15 +133,50 @@ + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + - - - default true @@ -195,22 +184,81 @@ - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.apache.maven.plugins + maven-resources-plugin + + + + copy-webapp + package + + copy-resources + + + ${project.build.directory}/wildfly-${version.org.wildfly}/standalone/deployments + true + + + ${project.build.directory} + *.war + + + + + - - arq-wildfly-remote + dist + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + pre-integration-test + + start + + + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone-modeshape-ha.xml + + + + stop-server + post-integration-test + + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*Test + + + + + + + org.wildfly.arquillian @@ -219,4 +267,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-clustering/src/main/java/org/modeshape/quickstart/clustering/ClusteringController.java b/modeshape-clustering/src/main/java/org/modeshape/quickstart/clustering/ClusteringController.java index 568bb28..1924618 100644 --- a/modeshape-clustering/src/main/java/org/modeshape/quickstart/clustering/ClusteringController.java +++ b/modeshape-clustering/src/main/java/org/modeshape/quickstart/clustering/ClusteringController.java @@ -45,7 +45,7 @@ public class ClusteringController { private static final Logger LOGGER = Logger.getLogger(ClusteringController.class); - @Resource(mappedName = "java:/jcr/clustered-repo") + @Resource(mappedName = "java:/jcr/sample") private transient Repository clusteredRepository; private String parentPath = "/"; diff --git a/modeshape-clustering/src/test/java/org/modeshape/quickstart/clustering/ClusteringControllerTest.java b/modeshape-clustering/src/test/java/org/modeshape/quickstart/clustering/ClusteringControllerTest.java index ab79c67..5f63e69 100644 --- a/modeshape-clustering/src/test/java/org/modeshape/quickstart/clustering/ClusteringControllerTest.java +++ b/modeshape-clustering/src/test/java/org/modeshape/quickstart/clustering/ClusteringControllerTest.java @@ -57,7 +57,7 @@ public void before() { @Test public void shouldReturnValidRepositoryName() throws Exception { - assertEquals("clustered-repo", clusteringController.getRepositoryName()); + assertEquals("sample", clusteringController.getRepositoryName()); } @Test diff --git a/modeshape-clustering/src/test/resources/log4j.properties b/modeshape-clustering/src/test/resources/log4j.properties index 8bc3a0c..a8a262e 100644 --- a/modeshape-clustering/src/test/resources/log4j.properties +++ b/modeshape-clustering/src/test/resources/log4j.properties @@ -9,15 +9,4 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO -log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file +log4j.logger.org.junit=DEBUG \ No newline at end of file diff --git a/modeshape-clustering/standalone/configuration/modeshape/clustered-repo-cache-config.xml b/modeshape-clustering/standalone/configuration/modeshape/clustered-repo-cache-config.xml deleted file mode 100644 index 8242b7b..0000000 --- a/modeshape-clustering/standalone/configuration/modeshape/clustered-repo-cache-config.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modeshape-clustering/standalone/configuration/modeshape/jgroups-config.xml b/modeshape-clustering/standalone/configuration/modeshape/jgroups-config.xml deleted file mode 100644 index f069430..0000000 --- a/modeshape-clustering/standalone/configuration/modeshape/jgroups-config.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modeshape-clustering/standalone/configuration/standalone-modeshape-node1.xml b/modeshape-clustering/standalone/configuration/standalone-modeshape-node1.xml deleted file mode 100644 index 24ac37d..0000000 --- a/modeshape-clustering/standalone/configuration/standalone-modeshape-node1.xml +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modeshape-clustering/standalone/configuration/standalone-modeshape-node2.xml b/modeshape-clustering/standalone/configuration/standalone-modeshape-node2.xml deleted file mode 100644 index 9c6335c..0000000 --- a/modeshape-clustering/standalone/configuration/standalone-modeshape-node2.xml +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modeshape-ejb/README.md b/modeshape-ejb/README.md index cbd7878..0a9fe94 100644 --- a/modeshape-ejb/README.md +++ b/modeshape-ejb/README.md @@ -11,41 +11,26 @@ types of EJBs via a JSF application. System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly 9. +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly 9 or 10. -Install ModeShape's AS kit into an existing JBoss Wildfly server ------------------------------------------------------ -Before running this demo make sure that you have installed the ModeShape AS kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start JBoss with the ModeShape configuration --------------------------------------------------------------------------------- - -1. Open a command line and navigate to the root of the JBoss server directory. -2. The following shows the command line to start the server with the ModeShape profile: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape.xml - -Build and Deploy the Quickstart +Running the Quickstart ------------------------- _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) for help on how to install and configure Maven 3._ -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type this command to build and deploy the archive: - mvn clean package wildfly:deploy + mvn clean package -4. This will deploy `target/modeshape-ejb.war` to the running instance of the server. +3. This will start a local Wildfly instance located at `target\wildfly', unpack and copy the ModeShape WF kit and deploy `target/modeshape-ejb.war` to the running instance of the server. Accessing the application --------------------- -The application will be running at the following URL: . +The application will be running at the following URL: http://localhost:8080/modeshape-ejb Installing the ModeShape kit will add two pre-configured demo repositories: `sample` and `artifacts` (see the `JBOSS_HOME/conf/standalone-modeshape.xml` file for more details). Both repositories are bound by default in JNDI under names: `java:/jcr/sample` and `java:/jcr/artifacts`. @@ -58,27 +43,18 @@ Based on the user selection, one of the following two actions is delegated to th 1. Describe - displays some meta-information about the repository or shows an error in case the repository cannot be located in JNDI. 2. Count - displays the total number of non-system nodes in a repository or shows an error in case the repository cannot be located in JNDI. -Undeploy the Archive --------------------- - -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive: - - mvn wildfly:undeploy Run the Arquillian Tests ------------------------- -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. +This quickstart provides some optional Arquillian tests. These are part of separate profile and can be run like so: -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to run the tests: - mvn clean package -Parq-jbossas-remote + mvn clean verify -Pdist -The above command will run the tests using the predefined repository named `sample` (see above). +The above command will start a server with the ModeShape WF kit deployed and run the tests using the predefined repository named `sample` (see above). The ModeShape project --------------------- diff --git a/modeshape-ejb/pom.xml b/modeshape-ejb/pom.xml index bc1a91e..6e4e39b 100644 --- a/modeshape-ejb/pom.xml +++ b/modeshape-ejb/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-ejb - 4.5.0.Final + 5.0-SNAPSHOT war Example of web application that uses ModeShape via EJBs @@ -12,24 +18,12 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 1.0.2.Final + 10.0.0.Final + jboss-wf-dist - 4.5.0.Final + 5.0-SNAPSHOT @@ -128,101 +122,140 @@ - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly.maven.plugin} - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone-modeshape.xml - - org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - org.apache.maven.plugins - maven-surefire-plugin - ${version.surefire.plugin} - org.apache.maven.plugins maven-war-plugin - ${version.war.plugin} false - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} + maven-surefire-plugin + ${version.surefire.plugin} + + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + - - - default true + - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + package + + run + + + - - arq-jbossas-remote + dist + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + pre-integration-test + + start + + + + stop-server + post-integration-test + + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*Test + + + + + + + org.wildfly.arquillian @@ -231,4 +264,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-ejb/src/test/resources/log4j.properties b/modeshape-ejb/src/test/resources/log4j.properties index 8bc3a0c..a8a262e 100644 --- a/modeshape-ejb/src/test/resources/log4j.properties +++ b/modeshape-ejb/src/test/resources/log4j.properties @@ -9,15 +9,4 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO -log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file +log4j.logger.org.junit=DEBUG \ No newline at end of file diff --git a/modeshape-federation/README.md b/modeshape-federation/README.md index b816e05..bbfb576 100644 --- a/modeshape-federation/README.md +++ b/modeshape-federation/README.md @@ -11,71 +11,46 @@ Federated repository. System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly 9. - -Install ModeShape's Wildfly kit into an existing JBoss Wildfly server ---------------------------------------------------------------- - -Before running this demo make sure that you have installed the ModeShape Wildfly kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start a JBoss Wildfly instance with the provided configuration file (see above) ---------------------------------------------------------------------------- - -1. Copy the `standalone` folder from the root of the quickstart into the `JBOSS_HOME`folder -2. Open a command line and navigate to the root of the JBoss server directory. -3. Start the `master` server: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape-federation.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape-federation.xml - -Build and Deploy the Quickstart -------------------------------- +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly 9 or 10. +Running the Quickstart +------------------------- _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) for help on how to install and configure Maven 3._ -1. Make sure you have started the JBoss Server instance as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive into the `master` server: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type this command to build and deploy the archive: - mvn clean package wildfly:deploy + mvn clean package -4. This will deploy `target/modeshape-federation.war` to the running server. +3. This will start a local Wildfly instance located at `target\wildfly', unpack and copy the ModeShape WF kit together with the `standalone-modeshape-federation.xml` configuration and +deploy `target/modeshape-federation.war` to the running instance of the server. Accessing the application ------------------------ -The application will be running at the following URL: +The application will be running at the following URL: http://localhost:8080/modeshape-federation Open the above URLs into your browser The user is presented with a form where he can choose an external source for which to list its content: 1. JBoss Server Data Dir - represents the JBOSS_HOME/standalone/data folder -2. Example DB - represents a simple, in memory H2 database which has been configured as part of `standalone-modeshape-federation.xml` - -Undeploy the Archive --------------------- - -1. Make sure you have started the JBoss Server instance as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive from the server: - - mvn wildfly:undeploy +2. Example DB - represents a simple, in memory H2 database which has been configured as part of `standalone-modeshape-federation.xml` Run the Arquillian Tests ------------------------- -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. +This quickstart provides some optional Arquillian tests. These are part of separate profile and can be run like so: + +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to run the tests: -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: + mvn clean verify -Pdist - mvn clean package -Parq-jbossas-remote +The above command will start a server with the ModeShape WF kit deployed and run the tests using the `standalone-modeshape-federation.xml` configuration. The ModeShape project --------------------- diff --git a/modeshape-federation/pom.xml b/modeshape-federation/pom.xml index 74f6f2c..cd5dc2e 100644 --- a/modeshape-federation/pom.xml +++ b/modeshape-federation/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-federation - 4.5.0.Final + 5.0-SNAPSHOT war Example of a JSF web application that uses ModeShape in Federated mode @@ -12,24 +18,12 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 1.0.2.Final + 10.0.0.Final + jboss-wf-dist - 4.5.0.Final + 5.0-SNAPSHOT @@ -115,102 +109,167 @@ - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly.maven.plugin} - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone-modeshape-federation.xml - - org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} - - - org.apache.maven.plugins - maven-surefire-plugin - ${version.surefire.plugin} - org.apache.maven.plugins maven-war-plugin - ${version.war.plugin} false - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} + maven-surefire-plugin + ${version.surefire.plugin} + + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + + copy-webapp + package + + copy-resources + + + ${project.build.directory}/wildfly-${version.org.wildfly}/standalone/configuration + true + + + ${project.basedir} + standalone-modeshape-federation.xml + + + + + + + - - - default true + - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + package + + run + + + - - arq-jbossas-remote + dist + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + pre-integration-test + + start + + + + stop-server + post-integration-test + + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*Test + + + + + + + org.wildfly.arquillian @@ -219,4 +278,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-federation/src/test/resources/log4j.properties b/modeshape-federation/src/test/resources/log4j.properties index 8bc3a0c..a8a262e 100644 --- a/modeshape-federation/src/test/resources/log4j.properties +++ b/modeshape-federation/src/test/resources/log4j.properties @@ -9,15 +9,4 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO -log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file +log4j.logger.org.junit=DEBUG \ No newline at end of file diff --git a/modeshape-federation/standalone/configuration/standalone-modeshape-federation.xml b/modeshape-federation/standalone-modeshape-federation.xml similarity index 88% rename from modeshape-federation/standalone/configuration/standalone-modeshape-federation.xml rename to modeshape-federation/standalone-modeshape-federation.xml index 84b59f0..eb493c0 100644 --- a/modeshape-federation/standalone/configuration/standalone-modeshape-federation.xml +++ b/modeshape-federation/standalone-modeshape-federation.xml @@ -1,6 +1,6 @@ - + @@ -22,7 +22,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -98,21 +98,12 @@ - - - - - - - - - @@ -127,17 +118,19 @@ - - + + + + - + - + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE @@ -169,7 +162,7 @@ - + false @@ -179,29 +172,32 @@ - + - + - + + + + - - - + + + - + @@ -227,7 +223,7 @@ - + @@ -245,7 +241,7 @@ - + @@ -258,19 +254,19 @@ - + + - - + - + @@ -281,7 +277,7 @@ + directoryPath="${jboss.server.data.dir}" readonly="true"> default:/JBossDataDir => / - + @@ -331,10 +327,10 @@ - + - + @@ -368,9 +364,8 @@ - - - + + @@ -384,7 +379,7 @@ - + @@ -402,7 +397,7 @@ - + @@ -416,7 +411,7 @@ - + @@ -425,14 +420,6 @@ - - - - - @@ -446,4 +433,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/modeshape-federation/standalone/configuration/modeshape/federated-repository-cache-config.xml b/modeshape-federation/standalone/configuration/modeshape/federated-repository-cache-config.xml deleted file mode 100644 index 4739841..0000000 --- a/modeshape-federation/standalone/configuration/modeshape/federated-repository-cache-config.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/modeshape-servlet/README.md b/modeshape-servlet/README.md index 3e0d8d2..2457a4f 100644 --- a/modeshape-servlet/README.md +++ b/modeshape-servlet/README.md @@ -11,41 +11,26 @@ JNDI API. System requirements ------------------- -All you need to build this project is Java 7.0 (Java SDK 1.7) or better, Maven 3.0 or better. -The application this project produces is designed to be run on JBoss Wildfly 9. +All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.0 or better. +The application this project produces is designed to be run on JBoss Wildfly 9 or 10. -Install ModeShape's Wildfly kit into an existing JBoss Wildfly server ------------------------------------------------------ -Before running this demo make sure that you have installed the ModeShape Wildfly kit into an existing JBoss Wildfly server. -The simplest way to do this is to follow the instructions provided [here](https://docs.jboss.org/author/display/MODE/Installing+ModeShape+into+AS7) - -Start JBoss Wildfly with the ModeShape configuration --------------------------------------------------------------------------------- - -1. Open a command line and navigate to the root of the JBoss server directory. -2. The following shows the command line to start the server with the ModeShape profile: - - For Linux: JBOSS_HOME/bin/standalone.sh -c standalone-modeshape.xml - For Windows: JBOSS_HOME\bin\standalone.bat -c standalone-modeshape.xml - -Build and Deploy the Quickstart +Running the Quickstart ------------------------- -_NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` -file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) -for help on how to install and configure Maven 3._ - -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type this command to build and deploy the archive: - - mvn clean package wildfly:deploy - -4. This will deploy `target/modeshape-servlet.war` to the running instance of the server. + _NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must use the `settings.xml` + file from the root of this project. See [this ModeShape community article](http://community.jboss.org/wiki/ModeShapeandMaven) + for help on how to install and configure Maven 3._ + + 1. Open a command line and navigate to the root directory of this quickstart. + 2. Type this command to build and deploy the archive: + + mvn clean package + + 3. This will start a local Wildfly instance located at `target\wildfly', unpack and copy the ModeShape WF kit and deploy `target/modeshape-servlet.war` to the running instance of the server. Accessing the application ---------------------- +------------------------- -The application will be running at the following URL: . +The application will be running at the following URL: http://localhost:8080/modeshape-servlet Installing the ModeShape kit will add two pre-configured demo repositories: `sample` and `artifacts` (see the `JBOSS_HOME/conf/standalone-modeshape.xml` file for more details). Both repositories are bound by default in JNDI under names: `java:/jcr/sample` and `java:/jcr/artifacts`. @@ -61,27 +46,17 @@ is looked up: Once the above information is submitted, the form will display the children of the node located at the above path. -Undeploy the Archive --------------------- - -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. When you are finished testing, type this command to undeploy the archive: - - mvn wildfly:undeploy - Run the Arquillian Tests ------------------------- -This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. +This quickstart provides some optional Arquillian tests. These are part of separate profile and can be run like so: -1. Make sure you have started the JBoss Server as described above. -2. Open a command line and navigate to the root directory of this quickstart. -3. Type the following command to run the test goal with the following profile activated: +1. Open a command line and navigate to the root directory of this quickstart. +2. Type the following command to run the tests: - mvn clean test -Parq-jbossas-remote + mvn clean verify -Pdist -The above command will run the tests using the predefined repository named `sample` (see above). +The above command will start a server with the ModeShape WF kit deployed and run the tests using the predefined repository named `sample` (see above). The ModeShape project --------------------- diff --git a/modeshape-servlet/pom.xml b/modeshape-servlet/pom.xml index 5928a29..f9ea480 100644 --- a/modeshape-servlet/pom.xml +++ b/modeshape-servlet/pom.xml @@ -2,9 +2,15 @@ 4.0.0 + + org.jboss + jboss-parent + 20 + + org.modeshape.quickstarts modeshape-servlet - 4.5.0.Final + 5.0-SNAPSHOT war Example of web application that uses ModeShape @@ -12,24 +18,12 @@ - UTF-8 - 1.7 - 1.7 - - - 2.4 - 2.5 - 3.0 - 2.6 - 2.4 - 2.4 - 2.6 - 2.12.3 - 2.3 - 1.0.1.Final + 1.0.2.Final + 10.0.0.Final + jboss-wf-dist - 4.5.0.Final + 5.0-SNAPSHOT 1.14.1-beta @@ -115,100 +109,146 @@ ${project.artifactId} - - org.apache.maven.plugins - maven-assembly-plugin - ${version.assembly.plugin} - - - org.apache.maven.plugins - maven-clean-plugin - ${version.clean.plugin} - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.compiler.plugin} + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly.maven.plugin} - false - false - - ${maven.compiler.source} - ${maven.compiler.target} - + ${project.build.directory}/wildfly-${version.org.wildfly} + standalone-modeshape.xml org.apache.maven.plugins - maven-dependency-plugin - ${version.dependency.plugin} - - - org.apache.maven.plugins - maven-install-plugin - ${version.install.plugin} - - - org.apache.maven.plugins - maven-jar-plugin - ${version.jar.plugin} - - - org.apache.maven.plugins - maven-resources-plugin - ${version.resources.plugin} + maven-war-plugin + + false + - org.apache.maven.plugins maven-surefire-plugin ${version.surefire.plugin} - - - org.apache.maven.plugins - maven-war-plugin - ${version.war.plugin} - - - - - org.wildfly.plugins - wildfly-maven-plugin - ${version.wildfly.maven.plugin} + + true + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + + org.wildfly + wildfly-dist + ${version.org.wildfly} + zip + false + ${project.build.directory} + + + + + org.modeshape + modeshape-distribution + ${version.modeshape} + ${modeshape.wf.distribution.classifier} + zip + false + ${project.build.directory}/wildfly-${version.org.wildfly} + + + + + + + - - default true + - maven-surefire-plugin - ${version.surefire.plugin} - - true - + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + package + + run + + + - - - arq-jbossas-remote + + dist + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + run-server + pre-integration-test + + start + + + + stop-server + post-integration-test + + shutdown + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*Test + + + + + + + org.wildfly.arquillian @@ -217,4 +257,10 @@ + + + JBoss-Releases + https://repository.jboss.org/nexus/content/repositories/releases/ + + diff --git a/modeshape-servlet/src/test/resources/log4j.properties b/modeshape-servlet/src/test/resources/log4j.properties index 8bc3a0c..a8a262e 100644 --- a/modeshape-servlet/src/test/resources/log4j.properties +++ b/modeshape-servlet/src/test/resources/log4j.properties @@ -9,15 +9,4 @@ log4j.rootLogger=WARN, stdout # Set up the default logging to be INFO level, then override specific units log4j.logger.org.modeshape=INFO -log4j.logger.org.junit=DEBUG -log4j.logger.org.hibernate=WARN -log4j.logger.org.hibernate.pretty.Printer=WARN -log4j.logger.org.hibernate.engine.Collections=WARN -log4j.logger.org.hibernate.cfg=WARN -log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN -log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN -log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN -log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN -log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN -log4j.logger.org.hibernate.hql.ast=WARN -log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN \ No newline at end of file +log4j.logger.org.junit=DEBUG \ No newline at end of file diff --git a/pom.xml b/pom.xml index 425fb1d..17c1f47 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.modeshape.quickstarts modeshape-quickstarts - 4.5.0.Final + 5.0-SNAPSHOT ModeShape Wildfly Quickstarts Top-Level POM for building all of the quickstarts. http://www.modeshape.org @@ -23,12 +23,32 @@ modeshape-federation - + dist - - dist - + + + + maven-assembly-plugin + + + distribution + package + + single + + + + assembly.xml + + modeshape-quickstarts-${project.version} + false + + + + + +