On Thu, Aug 4, 2011 at 12:15 PM, Marian Seitner
<[email protected]>wrote:
> Hi,
>
> I use the eclipseClasspath task to generate the class path for a dynamic
> web project. When I use gradle e.g. to create the war file, everything is
> fine.
>
> Unfortunately the eclipseClasspath task does not create fully equivalent
> .classpath entries.
>
> The following dependency definition causes gradle to put the jar in the
> classpath _and_ to copy it into the resulting web archive's lib folder,
> which is perfectly fine.
>
> // makes it in the classpath and in the resulting war
> compile 'org.springframework:spring-web:3.0.5.RELEASE'
>
> Using the eclipseClasspath task the following entry is generated (among
> others):
>
> <classpathentry sourcepath="/path/to/spring-web-3.0.5.RELEASE-sources.jar"
> kind="lib" path="/path/to/spring-web-3.0.5.RELEASE.jar" exported="true"/>
>
> While this puts the jar into the class path, it gets neither exported in
> Eclipse (using the export to war file wizard) nor published to a server.
>
> Fixing this problem by changing the project deployment assembly leads to
> slightly different entries:
>
> <classpathentry sourcepath="/path/to/spring-web-3.0.5.RELEASE-sources.jar"
> kind="lib" path="/path/to/spring-web-3.0.5.RELEASE.jar" exported="true">
> <attributes>
> <attribute name="org.eclipse.jst.component.dependency"
> value="/WEB-INF/lib"/>
> </attributes>
> </classpathentry>
>
> In my opinion dependencies in the compile configuration should be created
> in the latter form because they are most likely intended to be shipped.
>
Possibly. Can you file a jira ticket for it?
>
> Another question: what's the easiest way for the time being to add the
> missing <attributes> tag to the respective entries?
>
>
Assuming that you're on milestone-3, try this:
eclipseClasspath.withXml {
def node = it.asNode()
//manipulate the xml contents like:
node.appendNode('xml', 'is what I love')
}
>
> Cheers,
> Marian
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
Szczepan Faber
Principal engineer@gradleware
Lead@mockito