我正在使用LensKit推荐器在Netbeans中构建一个maven项目,但是当我尝试运行一个groovy文件时,我收到以下错误:
[exec:exec]
Exception in thread "main" groovy.lang.MissingPropertyException: No such property: config for class: eval.eval
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at eval.eval.run(eval.groovy:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1076)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:848)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:831)
at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:407)
at org.codehaus.groovy.runtime.InvokerHelper$runScript.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at eval.eval.main(eval.groovy)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.681s
Finished at: Tue Jan 07 13:30:37 EET 2014
Final Memory: 18M/179M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project CF_Lenskit: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
我的POM.xml包含以下内容
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gr.hua.dit</groupId>
<artifactId>CF_Lenskit</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lenskit.eval.scriptDir>${basedir}/src/eval/</lenskit.eval.scriptDir>
<lenskit.eval.dataDir>${basedir}/target/data/</lenskit.eval.dataDir>
<lenskit.eval.analysisDir>${basedir}/target/analysis/</lenskit.eval.analysisDir>
<lenskit.eval.publishDir>${basedir}/src/paper/</lenskit.eval.publishDir>
<lenskit.version>2.0.5</lenskit.version>
<rscript.executable>Rscript</rscript.executable>
<!-- <grouplens.mldata.acknowledge>no</grouplens.mldata.acknowledge> -->
</properties>
<dependencies>
<dependency>
<groupId>org.grouplens.lenskit</groupId>
<artifactId>lenskit-core</artifactId>
<version>${lenskit.version}</version>
</dependency>
<dependency>
<groupId>org.grouplens.lenskit</groupId>
<artifactId>lenskit-knn</artifactId>
<version>${lenskit.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>groovy-all</artifactId>
<groupId>org.codehaus.groovy</groupId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.grouplens.lenskit</groupId>
<artifactId>lenskit-eval-maven-plugin</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.grouplens.lenskit</groupId>
<artifactId>lenskit-eval</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>lenskit-eval-maven-plugin</artifactId>
<groupId>org.grouplens.lenskit</groupId>
<version>${lenskit.version}</version>
<extensions>true</extensions>
<configuration>
<script>${lenskit.eval.scriptDir}/eval.groovy</script>
<analysisScript>${lenskit.eval.scriptDir}/chart.R</analysisScript>
<targets>
<target>draw</target>
<target>analyze</target>
</targets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>latex-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>do-latex</id>
<phase>lenskit-publish</phase>
<goals>
<goal>latex</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.6.0-01</version>
</dependency>
</dependencies>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
</plugin>
<plugin>
<artifactId>groovy-eclipse-compiler</artifactId>
<groupId>org.codehaus.groovy</groupId>
<version>2.6.0-01</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
你能提出任何解决方案吗? 如果我需要发布任何其他信息,请告诉我。
更新!
好的,我已经更新了第一条错误消息,下面是异常的堆栈跟踪:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project CF_Lenskit: Command execution failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
... 21 more
答案 0 :(得分:1)
看起来NetBeans正在使用Codehaus exec-maven-plugin
来直接运行LensKit eval.groovy
文件作为Groovy脚本。 LensKit eval脚本无法直接作为Groovy脚本运行,必须使用LensKit评估程序运行。
有两种方法可以做到这一点:
lenskit-eval
脚本,或者运行NetBeans中的org.grouplens.lenskit.eval.cli.EvalCLI
类。lenskit-eval-maven-plugin
。你的POM已经设置好了;您将为此选项执行的操作是运行lenskit-analyze
Maven目标(NetBeans应该有办法运行任意Maven目标/阶段)。答案 1 :(得分:0)
在
上的config.xml上添加R的路径https://github.com/grouplens/lenskit/wiki/DevOnWindows#wiki-setting-up-maven