Using classifier in an ear


(heiko.kundlacz) #1

Hello, Thanks for the new 1.3 release. Congratulations!

I have one project and want to create 2 different ear files with the classifier property.

  1. Why I can’t use
task earApplication(type: Ear) {
classifier = 'application'
}

This results in an exception: Could not find property ‘Ear’ on root project

  1. This is working fine:
task earApplication(type: Jar) {
classifier = 'application'
}

But generates a jar file. Why I can’t use the type Ear?

Thanks for your help. Heiko


(detelinyordanov) #2

Probably because the ‘org.gradle.plugins.ear’ package is intentionally or unintentionally omitted from the list of default imports for a build script.


(heiko.kundlacz) #3

Hi and thanks for your answer. This was a good hint. I changed my code to the following:

task earApplication(type: org.gradle.plugins.ear.Ear) {
classifier = 'application'
}

Using the full name including the package name works fine.

Thanks, Heiko