Failing to add an attribute to a classpath-entry


(Kim Sönksen) #1

I’ve searched the web and finally failed in what seems to be a trivial task.

What I want to achive:

I need the following:

<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/EclipseLink 2.5.2">
            <attributes>
                    <attribute name="owner.project.facets" value="jpt.jaxb"/>
            </attributes>
 </classpathentry>

I did this:

    eclipse {
  classpath {
	  file {
		  whenMerged { classpath ->
			  withXml { classpathXml -> 
			    def classpathXmlNode = classpathXml.asNode()
			    classpathXmlNode.appendNode('classpathentry', [kind: 'con', path: 'org.eclipse.jdt.USER_LIBRARY/EclipseLink 2.5.2'])
			      .appendNode('attributes').appendNode('attribute', [name: 'owner.project.facets', value: 'jpt.jaxb'])
			    }
		  }
	  }
    }
}

But the desired classpath entry does not appear, what I am doing wrong here.


(Kim Sönksen) #2

Ok I found out that this seems to be a bug in buildship since using the gradle-wrapper the desired result appeared.