Open fbricon opened 8 years ago
what invalid groovy does this generate? if its similar to https://github.com/takari/polyglot-maven/issues/57 i'm wondering if the change for that also fixes this, or if there is another change needed?
Sorry I forgot to paste it:
parent {
groupId 'org.springframework.boot'
artifactId 'spring-boot-starter-parent'
version '1.3.0.RELEASE'
relativePath
}
No such property: relativePath for class: org.sonatype.maven.polyglot.groovy.builder.ModelBuilder$1
This is using polyglot-groovy 0.1.14
If that is the case, then a fix for this could already be in place:
https://github.com/takari/polyglot-maven/commit/13509ccd8d6a00954f5454e7d90933d0dd9f18a7
Could you try with a build of the latest changes? I'm not sure what the release strategy is, nor if there is automation to deploy updated SNAPSHOT builds of this stuff ATM.
@fbricon I am not aware of any optimization here (at least not in STS), but it looks like this is already generated in that way by the spring starter (no STS involved at all in that case). I could ask Dave, he might know why the starter project produces it that way.
@fbricon @martinlippert IIRC empty parent is used when ../pom.xml exists and is not the actual parent of the pom.
This one is kinda similar to bug #57 : translating a pom generated by the spring starter service (http://start.spring.io/starter.zip?name=demo&groupId=com.example&artifactId=demo&version=0.0.1-SNAPSHOT&description=Demo+project+for+Spring+Boot&packageName=com.example&type=maven-project&packaging=jar&javaVersion=1.8&language=java&bootVersion=1.3.0.RELEASE) to groovy results in an invalid pom.groovy.
The culprit is the empty relativePath node in the parent section. Simplest pom to reproduce the issue:
Having an empty relativePath seems dubious to me in the 1st place. Maybe some kind of optimization? (@martinlippert any idea?)
Still, ideally, the translator should be able to produce valid groovy.
This problem was originally reported by @dsayer in https://github.com/jbosstools/m2e-polyglot-poc/issues/3