Gradle - "network downloads disabled" for java artifact generation from schema


(Caesar) #1

Hi.

I have a project structure as follows.

sandbox
subproject1
subproject2
subproject3

In the subproject2, I need to generate some java artifacts from schema. One of the schemas contains the link “http://www.w3.org/2001/xml.xsd” for import.

When I execute the task, I am getting “error: Could not load resource “http://www.w3.org/2001/xml.xsd” (network downloads disabled).”.

So I included the following properties in the gradle.properties located in the ‘sandbox’ which is the root project.

systemProp.http.proxyHost=www-proxy.us.mycompany.com
systemProp.http.proxyPort=80
systemProp.http.nonProxyHosts=*.mycompany.com

But I am still getting the same error, even though I set the environment variable as follows.
set HTTP_PROXY=www-proxy.us.mycompany.com

I am using Windows.

But if I use just java command line as follows instead of gradle, it works fine. This is just a simple command. I need to pass multiple XSD files.

java -cp “C:/Downloads/library/dependency/libs/*” org.apache.xmlbeans.impl.tool.SchemaCompiler -src build/schema-src -d build/schema-classes -srconly -name config C:/Downloads/schema/example1.xsd C:/Downloads/schemaxml/schema/config.xsdconfig

Is there anything wrong that I am doing?

Thanks