Jspresso 4.1-SNAPSHOT ViewTester

177 views Asked by At

I am doing the reference guide tutorial. When saving changes in view.groovy i can see the building workspace message of eclipse but these changes are not shown in ViewTester until i do a mvn compile in core directory.

Is this the right behavior? Is it possible to see the changes in ViewTester without that explicit mvn compile in core directory?

My setup: Win7, jdk1.7.0_55, Eclipse Luna Service Release 2 (4.4.2), Jspresso Developer Studio from www.jspresso.org/external/updates/e44/

UPDATE: When using refId id:'contact' instead of reference 'contact', ref:'ContactInfo' mvn compile shows the following error:

[INFO] Scanning for changes : C:\jspdev\wstutorial\quickhr\core\src\main\dsl
[INFO] Detected a change on source C:\jspdev\wstutorial\quickhr\core\src\main\dsl\view.groovy. Sun May 31 17:59:40 CEST 2015 > Sun May 31 17:57:14 CEST 2015
NBR ERROR : 1
UR-Unresolved reference        : "Company.pane" ask for <Company.contact.address> of type field

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.038s
[INFO] Finished at: Sun May 31 17:59:51 CEST 2015
[INFO] Final Memory: 15M/37M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jspresso.maven:sjs-maven-plugin:4.1-SNAPSHOT:compile-sjs (generate-dsl-application) on project quickhr-core: SJS defined frontend / views is invalid.
[ERROR] NBR ERROR : 1
[ERROR] UR-Unresolved reference        : "Company.pane" ask for <Company.contact.address> of type field
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

UPDATE2: As Vincent has told the refId 'contact', id:'contact' fixed the compilation error when using refid. Cleaning project workspace does not help with the ViewTester problem. I have discovered that dsl-view.xml is updated in directory C:\jspdev\wstutorial\quickhr\core\target\generated-resources\dsl\de\aboware\quickhr\view when view.groovy is saved but not in directory C:\jspdev\wstutorial\quickhr\core\target\classes\de\aboware\quickhr\view and it seems that ViewTester is reading it from there. Running mvn compile updates the file in this directory (or copying by hand) then ViewTester finds the changes. Any idea why this not happens automatically?

UPDATE3: Maybe it is a eclipse/maven sourced problem. When i do a build clean after saving changes in view.groovy (with autobuild enabled) ViewTester gets the changes without explicit mvn compile on th console. It seems that not all required parts of the project are recompiled automatically after saving changes to view.groovy. Any hints for me?

UPDATE4: For every changes in groovy files i have to do a build clean to see that changes in ViewTester and in SwingStartup. I think it is more a problem of my eclipse version/setup than a problem of jspresso. I have bind a shortcut to build clean what helps somewhat to handle this.

UPDATE5: I have started from scratch 2 times (Kepler/Luna) both times with Jspresso 4.2-SNAPSHOT and checked that the resource directories are there - no success. When saving changes to groovy files the compile-sjs goal ist triggered and the spring xml files are updated in the target/generated-resources/dsl directory. But in the default output directory target/classes nothing happens. When i change a generated spring xml file by hand (from inside eclipse), the target/classes directory gets updated. I think eclipse does not recognise the generation of the spring xml files as a workspace change which has to be answered by an auto build. Maybe there has been something changed in M2E with newer eclipse versions. Should i give it another try with Juno? But i don't know if it makes much sence to use such an old release while Mars is RC2 already.

1

There are 1 answers

0
Vincent Vandenschrick On BEST ANSWER

There was an error in the doc regarding the refId use. This has been fixed by now. The correct statement is :

refId 'contact', id:'contact'

Regarding the main problem, simply relaunching the ViewTester after saving the view.groovy file should be enough to reflect the change. No need to go through CLI. Reading you question, I can see that the Eclipse build is triggered so I presume that automatic build is on which is necessary for the change to appear. Can you do a complete clean of the workspace (Project > Clean... > Clean all projects) and try again ? There are times when changes in the groovy dsl sources are not correctly detected by the incremental build.

UPDATE: Please make sure that target/generated-resources/dsl is correctly installed as a resource directory in the project. This should be achieved automatically by the JDS plugin registering build hooks in ME2.

enter image description here