Maven/甲骨文:同步异常

Maven / Oracle : SyncException

我想将 Weblogic 库放入本地存储库(安装和配置 Maven 以实现构建自动化和依赖关系管理) 我的工作站上安装的 Weblogic 版本是 12.1.2。

我正在使用

mvn -X com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=${oracle.home} -Doracle-maven-sync.testingOnly=false

但是我得到了这个错误:

[ERROR] Failed to execute goal com.oracle.maven:oracle-maven-sync:12.1.2-0-0:push (default-cli) on project standalone-pom: Synchronization execution failed: Was not able to find the MAVEN directory in
 this Oracle Home -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.oracle.maven:oracle-maven-sync:12.1.2-0-0:push (default-cli) on project standalone-pom: Synchronization execution fai
led
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        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:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        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:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Synchronization execution failed
        at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:177)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
Caused by: com.oracle.maven.sync.SyncException: Was not able to find the MAVEN directory in this Oracle Home
        at com.oracle.maven.sync.MavenDir.getNormalizedOracleHome(MavenDir.java:34)
        at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:155)
        ... 22 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

C:\Users\carbonell>

问题可能出在这里:

-Doracle-maven-sync.oracleHome=${oracle.home}

${oracle.home} 将被解释为您的 shell 的环境变量 - 而不是 Maven 属性。您必须指定路径或使用 ${ORACLE_HOME} 环境变量 - 如果设置正确。