How can I configure eclipse.wtp.component in java project at this level? Gradle complain that wtp property is not exists but eventually it gets configured as I see in eclipse project properties.
I don’t see anything wrong with your build apart from missing the ‘eclipse-wtp’ plugin. At some point we split the eclipse WTP stuff into a separate plugin.
Perhaps you’re using some older version of Gradle that might have a slightly different api with regards to wtp components? For example, in milestone-3 the resources were configured as follows:
//milestone-3 (as far as I remember :)
eclipseWtpComponent.resource(sourcePath: '/META-INF', deployPath: '/META-INF')