Grails Issues with CodeNarc plugin - File not found error

31 views
Skip to first unread message

ip00d00h

unread,
Feb 27, 2015, 12:50:29 PM2/27/15
to grails-de...@googlegroups.com
I wanted to use CodeNarc for my code and therefore I included the latest
CodeNarc Plugin (0.22) in my project. I added the plugin within the
'compile' scope in the plugins{} closure of the BuildConfig.groovy file.

Code sample:


def config = new ConfigSlurper().parse(new
File("${userHome}/.grails/artifactory.properties").toURI().toURL())

grails.project.dependency.resolution = {
...
repositories {

String artifactoryUrl = config.artifactory.repo
mavenRepo(artifactoryUrl) {

auth([
username: config.artifactory.username,
password: config.artifactory.password
])
}
}
...
plugins {
compile ":codenarc:0.22"
...
}
}

codenarc.reports = {
CodeNarcReport('html') {
outputFile = 'target/CodeNarc-Report.html'
title = 'CodeNarc'
}
}


After I cleaned and compiled my project and then whey i run grails codenarc.
I see the followin error.

Error running script codenarc: java.io.FileNotFoundException:
PathToTheProject[:].grails\artifactory.properties (The file name, directory
name, or volume label syntax is incorrect)

It seems the userHome environment variable evaluates to [:] and that is
appended to the actual project location as well.

If I hardcode the path to the properties file, it works but I cant hardcode
it due to obvious reasons. I would like to know, how to get around this
error

Thanks



--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-Issues-with-CodeNarc-plugin-File-not-found-error-tp4658743.html
Sent from the Grails Dev Discuss mailing list archive at Nabble.com.

ip00d00h

unread,
Feb 27, 2015, 12:50:30 PM2/27/15
to grails-de...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages