0

I'm trying to install Perf4J Integration Plugin for Grails.

I've added compile ":perf4j:0.1.1" on my BuildConfig.groovy but when I try to refresh my dependencies I get:

Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/me/Programs/test/target/work/plugins/perf4j-0.1.1/./Perf4jGrailsPlugin.groovy: 5: unable to resolve class org.perf4j.log4j.Log4JStopWatch
 @ line 5, column 1.
   import org.perf4j.log4j.Log4JStopWatch
   ^
/home/me/Programs/test/target/work/plugins/perf4j-0.1.1/./Perf4jGrailsPlugin.groovy: 2: unable to resolve class org.codehaus.groovy.grails.plugins.support.GrailsPluginUtils
 @ line 2, column 1.
   import org.codehaus.groovy.grails.plugins.support.GrailsPluginUtils
   ^
 2 errors
 (Use --stacktrace to see the full trace)
 ...

The second error is happens because GrailsPluginUtils has changed package from org.codehaus.groovy.grails.plugins.support to org.codehaus.groovy.grails.plugins. I've found a fixed version on the a Github fork.

But even when I try to compile the plugin sources downloaded from the Github repository linked above, I still get the org.perf4j.log4j.Log4JStopWatch.

Does anyone has any idea how to solve it?

ylima
  • 410
  • 5
  • 17
  • 1
    Try this: compile "org.perf4j:perf4j:0.9.16" – Anton Hlinisty Mar 14 '17 at 19:19
  • @AntonHlinisty Just added it as a dependency on the plugin version I downloaded from Github and it worked. Looks like the perf4j dependency was missing. Thank you a lot. – ylima Mar 14 '17 at 21:57
  • I was able to install, but now I get an exception when I try to load a page. I'll play with it a bit and provide more information on my question soon. – ylima Mar 14 '17 at 22:17

1 Answers1

0

I guess your grails application still caches the old version of perf4j. You mentioned about the repository in github where we had cloned, fixed the missing packages and bumped the version to 0.2.1.

In my experience, we did some works:

  • clone, then either install it into the local maven repository or deploy to your owned company maven centre. For us, we deploy per4j to EBI maven repository.
  • If you would go with our deployment of per4j, you need to add compile ":perf4j:0.2.1" inside plugins section and add mavenRepo "http://www.ebi.ac.uk/~maven/m2repo" under repositories section of BuildConfig.groovy located in grails-app directory.

How this would help you sort the issue out.

Community
  • 1
  • 1
Tung
  • 1,579
  • 4
  • 15
  • 32