This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch jpa-SNAPSHOT in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git
commit a0848643e26e1d830803c6ab964e9a55ecfb7288 Author: Dan Haywood <d...@haywood-associates.co.uk> AuthorDate: Thu Aug 25 18:15:42 2022 +0100 updates docs, for running in IDE. --- .run/SimpleApp.run.xml | 2 +- README.adoc | 26 +++++++++++++++++++++++--- lib/spring-instrument.jar | Bin 0 -> 7454 bytes webapp/pom.xml | 2 +- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.run/SimpleApp.run.xml b/.run/SimpleApp.run.xml index 9530eb6..bbb78c4 100644 --- a/.run/SimpleApp.run.xml +++ b/.run/SimpleApp.run.xml @@ -3,7 +3,7 @@ <option name="ACTIVE_PROFILES" /> <module name="simpleapp-jpa-webapp" /> <option name="SPRING_BOOT_MAIN_CLASS" value="domainapp.webapp.SimpleApp" /> - <option name="VM_PARAMETERS" value="-javaagent:lib/spring-instrument-5.3.8.jar" /> + <option name="VM_PARAMETERS" value="-javaagent:lib/spring-instrument.jar" /> <method v="2"> <option name="Make" enabled="true" /> </method> diff --git a/README.adoc b/README.adoc index 09e9232..1269d54 100644 --- a/README.adoc +++ b/README.adoc @@ -40,10 +40,20 @@ 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] ---- +mvn mvn -pl webapp spring-boot:run ---- @@ -113,14 +123,24 @@ This version of the application uses EclipseLink JPA as its ORM, configured with 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, you will also need to specify the agent as a VM option: +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:${env.HOME}/.m2/repository/org/springframework/spring-instrument-${spring-framework.version}.jar +-javaagent:lib/spring-instrument.jar ---- -Substitute the two variables appropriately (with `${spring-framework.version}` obtained from the `pom.xml` file). //This version of the application uses DataNucleus as its ORM, which requires that any entities are "enhanced", a post-compile process. diff --git a/lib/spring-instrument.jar b/lib/spring-instrument.jar new file mode 100644 index 0000000..4d53771 Binary files /dev/null and b/lib/spring-instrument.jar differ diff --git a/webapp/pom.xml b/webapp/pom.xml index 59743f8..f250ae8 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -50,7 +50,7 @@ <configuration> <classifier>exec</classifier> <agents> - <agent>${env.HOME}/.m2/repository/org/springframework/spring-instrument-${spring-framework.version}.jar</agent> + <agent>${env.HOME}/.m2/repository/org/springframework/spring-instrument/${spring-framework.version}/spring-instrument-${spring-framework.version}.jar</agent> </agents> </configuration> </plugin>