Getting connection exception when trying to use javacc plugin

Here is my build.gradle ///////// apply plugin: ‘java’ apply plugin: ‘ca.coglinc.javacc’

buildscript {

repositories {

mavenCentral()

}

dependencies {

classpath group: ‘ca.coglinc’, name: ‘javacc-gradle-plugin’, version: ‘2.0.1’

}

}

jar {

baseName = ‘bi-metadata-uel’

version = ‘7.0.0’

}

task wrapper(type: Wrapper) {

gradelVersion = ‘2.0.1’ } //////////

Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve ca.coglinc:javacc-gradle-plugin:2.0.1. Required by:

:git:unspecified …

Caused by: org.gradle.api.internal.externalresource.transport.http.HttpRequestException: Could not GET ‘http://repo1.maven.org/maven2/ca/coglinc/javacc-gradle-plugin/2.0.1/javacc-gradle-plugin-2.0.1.pom’.

Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://repo1.maven.org refused

at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)

at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)

at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)

at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)

at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)

at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:137)

at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:118)

at org.gradle.api.internal.externalresource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:111)

at org.gradle.api.internal.externalresource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:87)

at org.gradle.api.internal.externalresource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:78)

… 95 more Caused by: java.net.ConnectException: Connection timed out

at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)

at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)

… 104 more

This is a low level network error while trying to connect to maven central. My guess is that you have some sort of network barrier preventing a direct connection. If you need to use a proxy for making external connections, see section 20.2 of the user guide for instructions on configuring a proxy.

Hi Gary,

Thank you very much. That worked.

But now got into a different issue:

//////////////////////////////////////

compilation failed on symbol # //////////////////// :clean UP-TO-DATE :compileJavacc Java Compiler Compiler Version 6.1_2 (Parser Generator) (type “javacc” with no arguments for help) Reading from file /home/abillah/gradleTest/git/src/main/javacc/oracle/bi/model/uel/parser/UELParser.jjt . . . Warning: Line 26, Column 5: Bad option name “VISITOR_EXCEPTION”. Option setting will be ignored. Warning: Line 27, Column 5: Bad option name “VISITOR”. Option setting will be ignored. Warning: Line 28, Column 5: Bad option name “MULTI”. Option setting will be ignored. Warning: Line 29, Column 5: Bad option name “NODE_PREFIX”. Option setting will be ignored. Warning: Line 30, Column 5: Bad option name “NODE_DEFAULT_VOID”. Option setting will be ignored. Warning: Line 31, Column 5: Bad option name “NODE_CLASS”. Option setting will be ignored. Warning: Line 34, Column 5: Bad option name “BUILD_NODE_FILES”. Option setting will be ignored. Warning: Line 36, Column 5: Bad option name “TRACK_TOKENS”. Option setting will be ignored. org.javacc.parser.ParseException: Encountered " “#” "# “” at line 534, column 42. Was expecting one of:

“throws” …

“:” …

Detected 1 errors and 8 warnings. :compileJavacc FAILED

/////////////////////////////////////////////////// end of message

My source code in .jjt file and I need to preprocess it with jjtree before sending it to javacc. private AstUELExpression uel_value_expression() #UELExpression : {} {

value_expression() { return jjtThis; } }

I wonder whether there is link how to use the correct plugin for a successful compilation.

Regards,

-ab