gvSIG bugs #1109

Ant task svn.checkout.all fails compiling gvSIG 2.0 (gvsig-group-standard)

Added by Cesar Martinez Izquierdo over 11 years ago. Updated over 10 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Joaquín del Cerro Murciano
Category:Developer tools
Target version:2.1.0-2217-devel
Severity: Add-on version:
gvSIG version:2.0.0 Add-on build:
gvSIG build: Add-on resolve version:
Operative System:Windows Add-on resolve build:
Keywords: Proyecto:
Has patch:Yes Hito:
Add-on name:Unknown

Description

When launching the svn.checkout.all ant task (gvsig-group-standard) from Eclipse Indigo, I always get an error (see attached log), related with the use of JRE instead of JDK. However, I have the JDK installed and selected in the following places:
- JAVA_HOME environment variable
- Eclipse preferences (Java -> Installed JREs and Java -> Installed JREs -> Execution environment)

I have also tried modifying eclipse.ini to force the use of JDK (as suggested on some forums) but it still fails.

Finally, I have been able to solve it by modifying the pom.xml of several projects, by adding a <fork>true</fork> parameter on the configuration of maven-compiler-plugin. Therefore, I submit the changes to those pom files for integration on gvSIG svn repo.

error-maven.txt Magnifier - Eclipse log (73.3 KB) Cesar Martinez Izquierdo, 09/10/2012 01:02 PM

error-maven.txt Magnifier - Eclipse log (91 KB) Cesar Martinez Izquierdo, 09/10/2012 01:55 PM

maven-error.diff Magnifier - Patch (41.5 KB) Cesar Martinez Izquierdo, 09/12/2012 12:24 PM

History

#2 Updated by Cesar Ordiñana over 11 years ago

Hi Cesar, thanks for the report!

Looking at the error which appears in the attached log file, it seems to me the error is not related to the JRE/JDK issue:

[artifact:mvn] org.apache.maven.BuildFailureException: Compilation failure
[artifact:mvn] D:/workspaces/gvsig_2/libEvaluator_SQLJEP/src/org/gvsig/tools/evaluator/sqljep/SQLJEPLibrary.java:
  [39,5] annotations are not supported in -source 1.4
[artifact:mvn] (try -source 1.5 to enable annotations)
[artifact:mvn]     @Override
[artifact:mvn]     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)

That project is configured in maven as being 1.5 source compatible, so I can't understand the mention of the -source parameter. Could you check just in case if a JDK 1.4 is being used?

Take into account maven is run using the java available by default in the path, not the one used by eclipse. You need to configure also your PATH environment variable to point to the JDK you want to use.

Could you check which is the version available in your PATH by opening a command line window and running: java -version ?

#4 Updated by Cesar Martinez Izquierdo over 11 years ago

Sorry Cesar, I attached the wrong log (the error shown in the log is related with the fact I'm modifying the pom files and I have copy-pasted from other projects).

I attach now the right version of the log, this one shows the error described in the bug.

See java -version output:
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

The PATH variable points to C:\Archivos de programa\Java\jdk1.6.0_16\bin. As you see, this is different than the one reported by java -version, probably because the registry is used on Windows to decide the default java runtime.

As I explained, the problem can be solved by adding <fork>true</fork> to the maven-compiler-plugin configuration (at least when launching the build from Eclipse, where you can define the preferred runtime environment).

When I finish correcting the pom.xml files, I will attach a patch in case you want to integrate this changes.

#5 Updated by Cesar Martinez Izquierdo over 11 years ago

OK, patch attached.

Note that besides the addition of <fork>true</fork> on all the pom.xml files, I have also modified the dependencies on org.gvsig.exportto.swing.prov.shape (org.gvsig.fmap.mapcontext added as dependence), as a compilation problem was found on that project. Maybe you want to check this, as it may show some error introduced by my changes and this dependency is not necessary or has to be resolved in a different way.

The Eclipse log of the error:

[artifact:mvn] [INFO] [compiler:compile {execution: default-compile}]
[artifact:mvn] [INFO] Compiling 4 source files to D:\workspaces\gvsig_2\org.gvsig.exportto\org.gvsig.exportto.swing\org.gvsig.exportto.swing.prov\org.gvsig.exportto.swing.prov.shape\target\classes
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [ERROR] BUILD FAILURE
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Compilation failure
[artifact:mvn] D:\workspaces\gvsig_2\org.gvsig.exportto\org.gvsig.exportto.swing\org.gvsig.exportto.swing.prov\org.gvsig.exportto.swing.prov.shape\src\main\java\org\gvsig\exportto\swing\prov\shape\ExporttoShapeService.java:[51,49] package org.gvsig.fmap.mapcontext.layers.vectorial does not exist
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Trace
[artifact:mvn] org.apache.maven.BuildFailureException: Compilation failure
[artifact:mvn] D:\workspaces\gvsig_2\org.gvsig.exportto\org.gvsig.exportto.swing\org.gvsig.exportto.swing.prov\org.gvsig.exportto.swing.prov.shape\src\main\java\org\gvsig\exportto\swing\prov\shape\ExporttoShapeService.java:[51,49] package org.gvsig.fmap.mapcontext.layers.vectorial does not exist
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
[artifact:mvn] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
[artifact:mvn] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
[artifact:mvn] at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
[artifact:mvn] at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
[artifact:mvn] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[artifact:mvn] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[artifact:mvn] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[artifact:mvn] at java.lang.reflect.Method.invoke(Unknown Source)
[artifact:mvn] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[artifact:mvn] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[artifact:mvn] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[artifact:mvn] at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[artifact:mvn] Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
[artifact:mvn] D:\workspaces\gvsig_2\org.gvsig.exportto\org.gvsig.exportto.swing\org.gvsig.exportto.swing.prov\org.gvsig.exportto.swing.prov.shape\src\main\java\org\gvsig\exportto\swing\prov\shape\ExporttoShapeService.java:[51,49] package org.gvsig.fmap.mapcontext.layers.vectorial does not exist
[artifact:mvn] at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
[artifact:mvn] at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
[artifact:mvn] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
[artifact:mvn] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
[artifact:mvn] ... 17 more

#6 Updated by Álvaro Anguix over 10 years ago

  • Assignee set to Joaquín del Cerro Murciano

#7 Updated by Joaquín del Cerro Murciano over 10 years ago

  • Status changed from New to Fixed
  • Target version set to 2.1.0-2217-devel

Todo el mecanismo de construccion de gvSIG a cambiado entre la version 2.0.0 y la 2.1.0.
Doy por cerrado el ticket ya que ahora mismo no procede al no existir ahora los scripts de ant a los que hace referencia el ticket.

#8 Updated by Álvaro Anguix over 10 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF