Prevent ear plugin from accessing external resources

We are using the ear plugin with a custom application.xml. Over the past couple days we have had a number of build failures as the dtd that our xml references links to a url that has been going up and down. We were unaware that gradle would contact this website while configuring itself.

Looking at the ear plugin code, I don’t see an obvious way of disabling this behavior. We’d prefer to not have any xml validation be performed by gradle.

I have created a sample project here :

I changed the dtd reference to point to a bad host name and if you run ./gradlew tasks, gradle errors out with an unknown host exception.

Sorry, here is the error message

✔ ~/dev/ear-xml-validation [master L|✚ ] 
12:53 $ ./gradlew tasks

FAILURE: Build failed with an exception.

* Where:
Build file '/home/vagrant/dev/ear-xml-validation/build.gradle' line: 10

* What went wrong:
A problem occurred evaluating root project 'ear-xml-validation'.
> Failed to apply plugin [id 'org.gradle.ear']

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at

Worthwhile raising am issue on this. FIrstly it still tries to do the validation in --offline mode. Secondly. it would be better it the ear plugin defers validation to execution time, not configuration time.

Thanks. Opened