Renaming Eclipse project names and eclipse-wtp


(david koch) #1

Hello, I need to rename my eclipse project names in order to make them unique in the eclipse workspace. I import from other project too. Unfortunately this doesn’t work together with the eclipse-wtp plugin. This places module dependencies in the “org.eclipse.wst.common.component” file without using the prefix declared in the eclipse plugin even if the eclipse-wtp plugin is applied after the modification to the eclipse project name.

I do this with the following code:

eclipse {

project.name = “somePrefix-${project.name}”

}

apply plugin: ‘eclipse-wtp’

Thanks in advance, david


(Peter Niederwieser) #2

Can you post the actual and expected file content?


(david koch) #3

Supposed the main project name is “anyProject” and the sub-project name I want a dependency on is “webServer”. For unambiguousness in Eclipse the subproject is prefixed “anyProject-webServer” for the eclipse project only. When adding this manually to the “Deployment Assembly” section of the Eclipse project properties eclipse adds the below stated xml fragment into the “org.eclipse.wst.common.component” file. I guess the archiveName attribute is important here. All external or none renamed do not have it.

uses


(david koch) #4

sorry, I posted that plain xml

</dependent-module>

<dependent-module archiveName=“webServer.jar” deploy-path="/WEB-INF/lib" handle=“module:/resource/anyProject-webServer/anyProject-webServer”>

<dependency-type>uses</dependency-type>

</dependent-module>


(Peter Niederwieser) #5

So the ‘handle’ attribute is missing the ‘anyProject-’ prefixes?


(david koch) #6

Yes. I suspect that the eclipse-wtp plugin refers to the ‘project.name’ but not for the ‘eclipse.project.name’ which was configured differently (just with that prefix). This may apply to other eclipse settings as well, e.g. for the archive name.


(Szczepan Faber) #7

As a workaround you may configure the wtp component explicitly: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.eclipse.model.EclipseWtpComponent.html