blob: 465451d58e42a10e56715c221e62ac74406bc880 [file] [log] [blame]
= HelloWorld
:toc:
:toc-placement!:
image:https://github.com/apache/causeway-app-helloworld/workflows/Build%20w/%20Maven%20+%20Jdk%208/badge.svg[]
image:https://github.com/apache/causeway-app-helloworld/workflows/Build%20w/%20Maven%20+%20Jdk%2015/badge.svg[]
This is a minimal link:https://causeway.apache.org[Apache Causeway] application, intended as a starting point to learn what the framework is all about.
[TIP]
====
For real-world development, we recommend you instead start with the link:https://github.com/apache/causeway-app-simpleapp[SimpleApp] starter app.
It provides more structure and includes examples of fixtures, unit tests, integration tests, and BDD (Cucumber) specs.
====
toc::[]
== Quick start
* install prereqs:
** Java 11 LTS (eg link:https://adoptopenjdk.net/[Adopt OpenJDK] distribution)
** Maven 3.6 or later (http://maven.apache.org/download.cgi[download])
* download and unzip
+
[source,bash]
----
APP=helloworld
BRANCH=master
REPO=causeway-app-$APP
curl "https://codeload.github.com/apache/$REPO/zip/$BRANCH" | jar xv
mv $REPO-$BRANCH $REPO
cd $REPO
----
* Build using Maven:
+
[source,bash]
----
mvn clean install
----
* Download the `spring-instrument.jar` for load-time weaving (discussed in more detail xref:#orm-support[below]):
+
[source,bash]
----
mvn dependency:get -DgroupId=org.springframework -DartifactId=spring-instrument -Dversion=XXX
----
+
Change "XXX" to the value that `${spring-framework.version}` resolves to in the webapp `pom.xml`
* Run using Maven:
+
[source,bash]
----
mvn spring-boot:run
----
* Browse to http://localhost:8080.
* Login using:
** username: `sven`
** password: `pass`
+
The app runs with H2 running in-memory.
[#orm-support]
== ORM Support
// EclipseLink : START
This version of the application uses EclipseLink JPA as its ORM, configured with load-time weaving.
This requires that the application be run with a Java agent.
The spring-boot plugin is configured to run with this agent already.
If you want to run from an IDE:
* first, you might wish to copy the file locally:
+
[source,bash]
----
cp ~/.m2/repository/org/springframework/spring-instrument/XXX/spring-instrument-XXX.jar lib/spring-instrument.jar
----
+
Change "XXX" to the value that `${spring-framework.version}` resolves to in the webapp `pom.xml`
* Then specify the agent as a VM option:
+
[source,bash]
----
-javaagent:lib/spring-instrument.jar
----
// EclipseLink : END
// DataNucleus : START
//This version of the application uses DataNucleus as its ORM, which requires that any entities are "enhanced", a post-compile process.
//
//Normally this is done as part of a "mvn clean install", but the entities can also be enhanced explicity using:
//
//[source,bash]
//----
//mvn -pl module-simple datanucleus:enhance -o
//----
//
//This is useful to know if the application or integration test fails to bootstrap, complaining of "unenhanced entities".
//
//TIP: You can also use `enhance-all.sh`
// DataNucleus : END