1

我正在使用 DataNucleus+Maven。以下是命令及其结果:

mvn compile:构建成功

mvn clean install:构建成功

mvn -e datanucleus:enhance:构建成功

但是,在mvn -e datanucleus:schema-create

SEVERE: Error creating NucleusContext
There is no available StoreManager of type "". Make sure that you have put the relevant DataNucleus store plugin in your CLASSPATH and if defining a connection via JNDI or DataSource you also need to provide persistence property "datanucleus.storeManagerType"
org.datanucleus.exceptions.NucleusUserException: There is no available StoreManager of type "". Make sure that you have put the relevant DataNucleus store plugin in your CLASSPATH and if defining a connection via JNDI or DataSource you also need to provide persistence property "datanucleus.storeManagerType"
at org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:1157)
at org.datanucleus.NucleusContext.initialise(NucleusContext.java:359)
at org.datanucleus.store.schema.SchemaTool.getNucleusContextForMode(SchemaTool.java:659)
at org.datanucleus.store.schema.SchemaTool.main(SchemaTool.java:271)


[ERROR] --------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The DataNucleus tool org.datanucleus.store.schema.SchemaTool exited with a non-null exit code.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The DataNucleus tool org.datanucleus.store.schema.SchemaTool exited with a non-null exit code.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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:601)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: The DataNucleus tool org.datanucleus.store.schema.SchemaTool exited with a non-null exit code.
at org.datanucleus.maven.AbstractDataNucleusMojo.executeCommandLine(AbstractDataNucleusMojo.java:282)
at org.datanucleus.maven.AbstractSchemaToolMojo.executeSchemaTool(AbstractSchemaToolMojo.java:267)
at org.datanucleus.maven.AbstractSchemaToolMojo.executeDataNucleusTool(AbstractSchemaToolMojo.java:130)
at org.datanucleus.maven.AbstractDataNucleusMojo.execute(AbstractDataNucleusMojo.java:126)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more

我正在尝试使用 Maven 项目通过 JPA 实现 DataNucleus。Mysql 是后端。

4

1 回答 1

1

检查范围属性

<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-rdbms</artifactId>

并切换到compile(默认)而不是runtime.

于 2013-05-01T23:44:41.483 回答