Jspresso 4.1-SNAPSHOT ViewTester - java

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.

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.

Related

What does "[ERROR] file doesn't exist" means when doing maven install?

When I execute maven install in my gitlab build, I get the following error message:
12338 [INFO] Installing com.mycompany:myartifact:1.0.0-SNAPSHOT at end
12338 [INFO] 12338 [INFO] --- maven-bundle-plugin:3.3.0:install
(default-install) # myartifact --- 12411 [ERROR] file doesn't exist:
file:/root/.m2/repository/com/mycompany/myartifact/1.0.0-SNAPSHOT/myartifact-1.0.0-SNAPSHOT.jar
I don't understand what does it mean. The file obviously doesn't exist because it was never installed in that environment, so it's strange that maven would complain about it.
I suppose this error hides some other error, like no write rights? But I see not other error in log. The build seems to be successful.
Try to make a clean install, maybe it's just a local repository issue
mvn clean install
When you do maven install, It usually looks into your .m2 folder and searches for the existence of the dependencies(mentioned in pom.xml). If it doesn't exist, maven will automatically download it. So the build will be successful.

How to build EclipseLink 2.7.0

I downloaded eclipselink from here https://github.com/eclipse/eclipselink.runtime. There are a lot of subprojects in it. Some of them can be built using maven, some with ant and some with gradle.
However, org.eclipse.persistence.core which I want to build is maven project. But when I try to build it (either parent project) I get exception:
Scanning for projects...
Computing target platform for MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository/ (0B at 0B/s)
Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository
Fetching p2.index from http://download.eclipse.org/releases/luna/ (0B at 0B/s)
Adding repository http://download.eclipse.org/releases/luna
Fetching p2.index from http://download.eclipse.org/releases/luna/201406250900/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201409261001/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201501121000/ (0B at 0B/s)
Fetching p2.index from http://download.eclipse.org/releases/luna/201502271000/ (0B at 0B/s)
Resolving dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Resolving class path of MavenProject: org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/jpa/org.eclipse.persistence.jpa.jpql/pom.xml
Computing target platform for MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml
Resolving dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml
{osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
Cannot resolve project dependencies:
Software being installed: org.eclipse.persistence.core 2.7.0.qualifier
Missing requirement: org.eclipse.persistence.core 2.7.0.qualifier requires 'bundle org.eclipse.persistence.antlr 3.5.2' but it could not be found
See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
Cannot resolve dependencies of MavenProject: org.eclipse.persistence:org.eclipse.persistence.core:2.7.0-SNAPSHOT # /home/TEMP/eclipselink.runtime-master/foundation/org.eclipse.persistence.core/pom.xml: See log for details -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
The jar org.eclipse.persistence.antlr 3.5.2 is already in zip I downloaded and there are besides sources of it, which can be built using ant.
And I could add this jar as dependency but I don't think this is the right way - because there are a lot of jars inside this zip file.
Question: how to build it?
Indeed the pom.xml files are misleading, these projects are not Maven projects or - at least - are not meant to be built directly via maven. The whole build is an ant build which makes uses of Maven as a supporting tool because of the need of using Tycho integration.
Looking at the antbuild.xml ant build file, you would see it is invoking Maven via its Java main class (Maven is built in Java and the entry point is an old plain Java main after all): org.codehaus.plexus.classworlds.launcher.Launcher, in its build-core target.
So the workflow is:
Start an ant build, from the root folder, invoking ant -f antbuild.xml
Ant will then invoke Maven builds as nested builds
Nested Maven builds are on multi-module/aggregator projects, which in turn will build several Maven modules (sub-projects), starting form the root/parent Maven pom.xml located under buildsystem/org.eclipse.persistence.parent
Note you would need to have:
Maven 3 to build it, as a prerequisites of the aforementioned parent pom file.
the M2_HOME env variable set, pointing at your maven installation folder
Use Ant 1.9+
However, as part of the minimal set-up, the default build would not run properly (successfully), because of junit missing library, as specified by the echo statement below:
[echo] junit.lib = '${junit.lib}' (if not set tests may not compile; let alone run)
Hence, the minimal invocation would be:
ant -f antbuild.xml -Djunit.lib=<path_to_junit_jar>
For instance, you could directly point to your maven repository as following (which worked for me):
ant -f antbuild.xml -DC:\data\m2\repository\junit\junit\4.12\junit-4.12.jar
alternatively, you can specify the path in the antbuild.properties file, here:
# The directory that holds the oracle-specific jar files.
# You can either put the jars in this directory, or specify your own directory.
junit.lib=../extension.lib.external/junit.jar
The same should also be made for jmockit, otherwise causing some compilation errors, althought not affecting a successful build.
The jmockit.jar property can be set in the antbuild.properties file of the eclipse.moxy.test module, here:
#JMockit
jmockit.jar=jmockit-1.10.jar
Or, again, via command line as per the following example:
ant -f antbuild.xml -Djunit.lib=C:\data\m2\repository\junit\junit\4.12\junit-4.12.jar -Djmockit.jar=C:\data\m2\repository\org\jmockit\jmockit\1.10\jmockit-1.10.jar
The command above gave me a successful build, no compilation errors at all. Only warnings were present concerning usage of deprecated or internal API.
You may use this guide for building EclipseLink.
Some elements may be outdated but you should have no issues.
I have got same type of problem in one project. There was a parent project. There is another project also. But they are dependent on each other. What I have to do to make it runnable is given below.
You must have identify which one need to be build first. Then next, then next. If you have no documentation, then it is tough and time consuming to identify.
Another thing:
The minimum requirement to run EclipseLink 2.7.0 is Java 8. Please ensure that you have Java 8 installed and it's working.

Maven MojoExecutionException

I am facing this issue , when i am deploying my application using Maven, please suggest some solution.
Error log,
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.790s
[INFO] Finished at: Wed Apr 23 10:44:13 IST 2014
[INFO] Final Memory: 54M/131M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project clustering.services: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre7\..\lib\tools.jar -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :clustering.services
Thanks in advance.
set JAVA_HOME to jdk not to JDK_DIR/jre, See this question for how to set the value
If you're using Eclipse, go to Windows->Preferences.
Under Java->Installed JREs, double click on the item in the list and make sure the JRE home points to a JDK (for example, set it to "C:\Program Files\Java\jdk1.7.0_60"), and leave everything else the same.
Most of the time that i get this "Mojo" error. It is just because, i may have forgotten to do "Maven generate-sources" then "Maven Clean" prior to do the "Maven Install" or "Maven Build". The MojoExecutionException should not appear after that. Some Eclipse versions have this problem to refresh the target folder. In this case, Refresh the project just after the "Maven Install".
If not resolved yet, it could be a lot of things (failed to copy a file(s), missing file(s), etc). I would suggest that you run the Maven Install in debug mode by adding -X to get more details on what may have happened then check your log: Right click on project> Run As> Maven Build as the following screenshot:
Verify that the name of the main class to execute in the application is specified in the pom.xml.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.enterprise.mainPacket.MainApp</mainClass>
</properties>
Also check if the .fxml file has been relocated, so that it correctly addresses the controller associated with it. fx:controller="com.enterprise.mainPacket.FXMLController"
<VBox fx:id="vBMasterContainer" prefHeight="698.0" prefWidth="800.0" styleClass="theme" stylesheets="#/styles/style.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.enterprise.mainPacket.FXMLController">
I had the same error. I fixed the path to Java, and was missing the tools jar. I copied it from another place. After that, everything worked.
Check that there are no conflict on the port (another service already running) !
Make sure that you don't have any empty packages within your source code folder. If there aren't any classes, the same error will occur.
After I changed the version in pom.xml to 1.2.1, the error was resolved.

Installing Maven Android SDK Deployer

Im trying to install this maven plugin, but i have several questions which i cant do trial & error because of my slow internet speed :
The documentation said :
For the default usage of the deployer install all platforms and add-on apis, ensure that all folder in the platforms folder have names like android-3, android-4 and so on.
Do i really need to download ALL of the platforms and extras, even i dont want to use it?
And then, it said :
If you find names using the platform version (e.g. 15) in the folder name reinstall that platform from the android tool.
This is my platforms folder :
It seems all of my platform's name is using the version, do i really need to re-install ALL of those installed platforms?
Do you have any other way how to make this maven plugin work more easily?
Or do you have any better idea? (different plugin maybe, or anything). Im very new to Maven.
Thanks very much for your help.
No need to reinstall, but make sure you have all the platform levels.When you run the SDK deployer POM, the build will go looking each and every one of the platform level folders and if you have one missing the build will fail. So make sure you have all even if you don't require them. That's why they insist on the folder naming.
This is how missing platform errors look like:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:32 min
[INFO] Finished at: 2014-05-29T18:11:29-06:00
[INFO] Final Memory: 19M/246M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-10: Properties file not found: $ANDROID_HOME/platforms/android-10/source.properties -> [Help 1]

Maven updating .project files, project can no longer successfully build

I am using Maven in Eclipse Kepler with JRE 1.7.09 for a large project at work. We have a few hundred plugins for our Maven project. Initially, after checking everything out from our Git/SVN repos, I am able to do a Maven Clean/Install without a single issue. But after some time, all of my projects update and I can no longer perform a successful build. I also get errors by almost every project (which is discouraging considering there are about 200 in my workspace).
Comparing my local copy and the HEAD version, the only differences are the .project files. In my workspace version, most of the information has been completely removed. Updating these files to the HEAD restores the content and resolves the errors...but updating 200+ .project files everytime it breaks isn't the most efficient.
If it helps, I am also a victim of the infinite SVN Status Cache Update error.
Any tips would be appreciated. I would really love to fix this shit so I can get back to actual work.
Thanks!
Edit:
The first error was nonsense, so I removed the Maven nature from the offending package. Now I am getting this --
[ERROR] QueryResult cannot be resolved to a type
[ERROR] <dir/file.java>:[152,0]
[ERROR] List<Status> tweets = result.getTweets();
[ERROR] ^^^^^^
[ERROR] Status cannot be resolved to a type
[ERROR] <dir/file.java>:[166,0]
[ERROR] private Table covertResultIntoTable(List<Status> statuses) {
[ERROR] ^^^^^^
[ERROR] Status cannot be resolved to a type
[ERROR] <dir/file.java>:[172,0]
[ERROR] for (Status status : statuses) {
[ERROR] ^^^^^^
[ERROR] Status cannot be resolved to a type
[ERROR] 30 problems (30 errors)
I can export this package without a single error and all of the types come from a .JAR that has been added to the build path.
Run on the console:
mvn clean eclipse:eclipse
or load it on eclipse after installing the m2 plugin
Please note I specified OR, do not do both :)

Categories