[GRADLE-2872] Conversion from Maven can't handle a variable in a system path. Created: 15/Aug/13  Updated: 23/Oct/13  Resolved: 23/Oct/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.9-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 1


 Description   

Gradle 1.7-rc-2

$ gradle setupBuild
:wrapper
:setupBuild
Maven to Gradle conversion is an incubating feature.
:setupBuild FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':setupBuild'.
    > Could not convert Maven POM /Users/scott/dev/Project/ProjectCore_sync/pom.xml to a Gradle build.
    > Unable to create Maven project model using POM /Users/scott/dev/Project/ProjectCore_sync/pom.xml.
    > Some problems were encountered while processing the POMs:
    [ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for javafx:jfxrt:jar must specify an absolute path but is ${java.home}/lib/jfxrt.jar @ line 340, column 17

This is used to reference the JavaFX JAR as distributed in Java 7. The jar is present in the JRE but not by default on the classpath so it must be added as a system dependency to be available to Maven projects.

The result of evaluating ${java.home} in Maven of course evaluates to an absolute path. Gradle doesn't understand this, but it is a basic variable that it should probably convert automatically.



 Comments   
Comment by Gradle Forums [ 15/Aug/13 ]

This seems to be a general problem processing the POM during conversion...

  • What went wrong:
    Execution failed for task ':setupBuild'.
    > Could not convert Maven POM /Users/scott/dev/Project/ProjectCore_sync/pom.xml to a Gradle build.
    > Unable to create Maven project model using POM /Users/scott/dev/Project/ProjectCore_sync/pom.xml.
    > Some problems were encountered while processing the POMs:
    [ERROR] 'build.plugins.plugin[org.gradle.mvn3.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${java.tools.jar} @ example.domain:drc-parent:1.2.26, /Users/scott/.m2/repository/example/domain/drc-parent/1.2.26/drc-parent-1.2.26.pom, line 153, column 20
    [ERROR] 'build.plugins.plugin[org.gradle.mvn3.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.version' for com.sun:tools:jar must be a valid version but is '${java.version}'. @ example.domain:drc-parent:1.2.26, /Users/scott/.m2/repository/example/domain/drc-parent/1.2.26/drc-parent-1.2.26.pom, line 151, column 17
    [ERROR] 'build.plugins.plugin[org.gradle.mvn3.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${java.tools.jar} @ example.domain:drc-parent:1.2.26, /Users/scott/.m2/repository/example/domain/drc-parent/1.2.26/drc-parent-1.2.26.pom, line 153, column 20
    [ERROR] 'build.plugins.plugin[org.gradle.mvn3.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.version' for com.sun:tools:jar must be a valid version but is '${java.version}'. @ example.domain:drc-parent:1.2.26, /Users/scott/.m2/repository/example/domain/drc-parent/1.2.26/drc-parent-1.2.26.pom, line 151, column 17
Comment by Gradle Forums [ 15/Aug/13 ]

The sad thing is that when I changed this to a path without a variable to see if I could get any farther, I got this error:

> [WARNING] 'dependencyManagement.dependencies.dependency.systemPath' for javafx:jfxrt:jar should use a variable instead of a hard-coded path /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/jfxrt.jar ...

Generated at Wed Jun 30 12:33:46 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.