/PetclinicPE

Petclinic example app for meetup Port Elizabeth jan 2017

Primary LanguageJava

SimpleApp

This application was generated by the Apache Isis simpleapp archetype. It is intended as a starting point for developing your own applications.

Quick start

Build using:

mvn clean install

Run using:

mvn -pl webapp jetty:run

Login using:

  • username: sven

  • password: pass

The app runs with HSQLDB running in-memory, with sample data set up using fixture scripts.

Application Structure

The following table explains the contents of each of the directories:

Directory Description

application

Defines application-level classes such as menus and the AppManifest (which defines the modules that make up the application). It also holds application-wide integration tests/BDD specs.

module-simple

Holds the "simple" module, consisting of the SimpleObject entity and supporting repository, along with module-specific unit- and integration tests. Also runs isis:validate goal for the domain objects within the module.

Tip

Larger applications should consist of multiple modules; each such module can be copied from this starter module.

webapp

Assembles the application into a webapp (comprising both the Wicket viewer and Restful Objects viewer) and also as a docker image, and runs the isis:swagger goal.

_checks

Checkstyle and PMD rule sets for static analysis.

Tip

Extend/adapt these according to your own standards.

More advanced use cases

  • To enhance all JDO entities prior to running:

    mvn -f pom-jdo-enhance-all.xml datanucleus:enhance
  • To also generate the Jetty console, allowing the application to run as a standalone JAR:

    mvn install -Dmavenmixin-jettyconsole

    This can then be run using:

    cd webapp/target && java -jar simpleapp-webapp-xxx-jetty-console.war

    Add additional arguments --headless or --port 9999, if required.

    It can also be run using:

    mvn -pl webapp && mvn antrun:run -Dmavenmixin-jettyconsole

    or to specify arguments:

    mvn -pl webapp && mvn antrun:run -Dmavenmixin-jettyconsole \
        -Dmaven-antrun-plugin.jettyconsole.args="--headless --port 9090"
  • To also generate source and javadoc JARs:

    mvn clean package -Dmavenmixin-sourceandjavadoc
    Note

    This is configured only for the module-simple module.

  • To create the website (for the module-simple module) with source/javadoc and static analysis:

    mvn -pl module-simple site -Dmavenmixin-sourceandjavadoc -Dmavenmixin-staticanalysis
    Note

    This is intended to run only for the module-simple module, and will generate a website under`target/site/index.html`.

  • To disable the running of unit tests:

    mvn -DskipUTs
    Tip

    By default, output of unit tests are in target/surefire-unittest-reports (in the module-simple modules).

  • To disable the running of integration tests:

    mvn -DskipITs
    Tip

    By default, output of integration tests are in target/surefire-integtest-reports (in the application and module-simple modules).

  • To disable the running of BDD specs:

    mvn -DskipBSs
    Tip

    By default, output of integration tests are in target/surefire-integbddspecs-reports (in the application module).

  • To disable the running of all tests and BDD specs:

    mvn -DskipTests
  • To disable the running of the isis:validate goal:

    mvn -Dskip.danhaywood-mavenmixin-isisvalidate
  • To disable the generation of cucumber reports:

    mvn -Dskip.danhaywood-mavenmixin-cucumberreporting
    Tip

    By default, cucumber reports are generated at target/cucumber-html-reports/overview-features.html (in the application module).

  • To disable the running of the isis:swagger goal:

    mvn -Dskip.danhaywood-mavenmixin-isisswagger
    Tip

    By default, Swagger spec files are generated at target/generated-resources/isis-swagger (in the webapp module).

  • To package up the application as a docker image:

    mvn package -Dmavenmixin-docker

    This assumes that the ${docker-plugin.imageName} property has been defined in the webapp module. Alternatively it can be specified on the command line using a system property, eg:

    mvn package -Dmavenmixin-docker -Ddocker-plugin.imageName=mycompany/myapp

    The packaged image can be viewed using docker images.

  • To run a docker image previously packaged:

    docker run -d -p 8080:8080 mycompany/myapp

    See mavenmixin-docker for further details on how to run docker images.

  • To upload the application as a docker image to docker hub (or some other docker registry):

    mvn deploy -Dmavenmixin-docker

    This assumes that the ${docker-plugin.imageName} property has been defined, and also that docker registry credentials have been specified in ~/.m2/settings.xml. See mavenmixin-docker for further details.