This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch v3-jpa in repository https://gitbox.apache.org/repos/asf/causeway-app-simpleapp.git
commit c501e64beeddea4e810b92f018930f55e19d8602 Author: Dan Haywood <[email protected]> AuthorDate: Tue Oct 28 08:05:44 2025 +0000 updates to use static weaving, cleans up README --- README.adoc | 56 ++-------------------------------------------- lib/spring-instrument.jar | Bin 7454 -> 0 bytes module-simple/pom.xml | 16 +++++++++++++ pom.xml | 1 + webapp/pom.xml | 5 ----- 5 files changed, 19 insertions(+), 59 deletions(-) diff --git a/README.adoc b/README.adoc index 2378fd1..966d6d0 100644 --- a/README.adoc +++ b/README.adoc @@ -2,9 +2,6 @@ :toc: :toc-placement!: -image:https://github.com/apache/causeway-app-simpleapp/workflows/Build%20w/%20Maven%20+%20Jdk%208/badge.svg[] -image:https://github.com/apache/causeway-app-simpleapp/workflows/Build%20w/%20Maven%20+%20Jdk%2015/badge.svg[] - This is a simple link:https://causeway.apache.org[Apache Causeway] application, structured so that it can be used as a starting point for developing your own applications. It consists of: @@ -25,8 +22,8 @@ toc::[] * 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]) +** Java 21 LTS (eg link:https://adoptopenjdk.net/[Adopt OpenJDK] distribution) +** Maven 3.9.11 or later (http://maven.apache.org/download.cgi[download]) * download and unzip + [source,bash] @@ -47,15 +44,6 @@ cd $REPO 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] @@ -130,46 +118,6 @@ The `pom.xml` also provides goals to run the app from the command line, or to be It's more common for tests to reside within the same module, but we moved them into their own Maven modules because it makes them easier to be temporarily excluded, eg during initial explorations/prototyping. -[#orm-support] -== ORM Support - -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 ----- - - - -//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` - == Testing diff --git a/lib/spring-instrument.jar b/lib/spring-instrument.jar deleted file mode 100644 index 4d53771..0000000 Binary files a/lib/spring-instrument.jar and /dev/null differ diff --git a/module-simple/pom.xml b/module-simple/pom.xml index 078a7d8..d5c77a4 100644 --- a/module-simple/pom.xml +++ b/module-simple/pom.xml @@ -29,6 +29,22 @@ </excludes> </resource> </resources> + <plugins> + <plugin> + <groupId>com.ethlo.persistence.tools</groupId> + <artifactId>eclipselink-maven-plugin</artifactId> + <version>${eclipselink-maven-plugin.version}</version> + <executions> + <execution> + <id>weave</id> + <phase>process-classes</phase> + <goals> + <goal>weave</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> </build> <dependencies> diff --git a/pom.xml b/pom.xml index ad71ab4..8ca5851 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ <java.version>21</java.version> <datasource-proxy-spring-boot-starter.version>1.8.1</datasource-proxy-spring-boot-starter.version> + <eclipselink-maven-plugin.version>3.0.2</eclipselink-maven-plugin.version> <maven-timeline.version>1.8</maven-timeline.version> <sql-formatter.version>2.0.4</sql-formatter.version> </properties> diff --git a/webapp/pom.xml b/webapp/pom.xml index 63b59e1..5c8186b 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -69,11 +69,6 @@ </executions> <configuration> <classifier>exec</classifier> - <agents> - <agent> - ${settings.localRepository}/org/springframework/spring-instrument/${spring-framework.version}/spring-instrument-${spring-framework.version}.jar - </agent> - </agents> <requiresUnpack> <dependency> <groupId>org.asciidoctor</groupId>
