【问题标题】:How to install weblogic maven plugin for weblogic v12.1.2 (12c)?如何为 weblogic v12.1.2 (12c) 安装 weblogic maven 插件?
【发布时间】:2014-06-20 18:15:26
【问题描述】:

为了安装 weblogic 应用服务器,我使用以下链接解压了从 oracle 获得的 2 个文件:

http://download.oracle.com/otn/nt/middleware/12c/wls/1212/wls1212_dev.zip http://download.oracle.com/otn/nt/middleware/12c/wls/1212/wls1212_dev_supplemental.zip

..在this page找到。

我只是解压了这两个文件,它们会自动解压到同一个文件夹中。设置MW_HOMEJAVA_HOME环境变量分别指向解压文件夹和Java 7 JDK位置,我运行configure.cmd文件并成功结束。

问题是如果我按照上面的说明进行操作,我无法达到this page 显示的相同结果。我在这里总结了这些说明: (ORACLE_HOMEMW_HOME 相同,都指向安装文件夹。)

%ORACLE_HOME%/wlserver/server/bin/setWLSEnv
cd %ORACLE_HOME%/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2
mvn install:install-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=D:/oracle_home
mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.1.2-0-0

其中oracle-maven-sync.oracleHomeThe path to the Oracle home that you wish to populate the Maven repository from.。它基本上是包含wlserver 目录的Weblogic 目录。

问题是最后一行(询问已安装插件进行描述的行)显示以下错误消息(忽略被屏蔽的 IP,我在这个问题中手动屏蔽了它们):

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:describe (default-cli) @ standalone-pom ---
[WARNING] The POM for com.oracle.weblogic:weblogic-maven-plugin:jar:12.1.2-0-0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.775 s
[INFO] Finished at: 2014-05-04T13:00:03+02:00
[INFO] Final Memory: 7M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:2.2:describe (default-cli) on project standalone-pom: Plugin does not exist: Plugin could not be found, please check its coordinates fo
 typos and ensure the required plugin repositories are defined in the POM
[ERROR] com.oracle.weblogic:weblogic-maven-plugin:maven-plugin:12.1.2-0-0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (http://x.x.x.x:xxxx/artifactory/plugins-release, releases=true, snapshots=false),
[ERROR] snapshots (http://x.x.x.x:xxxx/artifactory/plugins-snapshot, releases=true, snapshots=true),
[ERROR] central-se (http://x.x.x.x:xxxx/artifactory/plugins-release, releases=true, snapshots=false),
[ERROR] snapshots-se (http://x.x.x.x:xxxx/artifactory/plugins-snapshot, releases=true, snapshots=true)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/MojoFailureException

是什么让我认为这不是网络问题,是因为我之前已经成功安装过这个插件,但我不记得究竟是怎么回事,我可能错过了一些步骤?

请问我该如何解决?我的目标是能够通过以下方式将 maven 中的 weblogic 库作为 依赖项 引用:

<dependency>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>weblogic-server-pom</artifactId>
    <version>12.1.2-0-0</version>
    <type>pom</type>
    <scope>provided</scope>
</dependency>

【问题讨论】:

    标签: weblogic12c weblogic-maven-plugin


    【解决方案1】:

    根据WebLogic 12.1.2 documentation page,请按照以下说明操作:

    1. 安装 Oracle Maven 同步插件并运行推送目标:

      • 将目录更改为 ORACLE_HOME\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.2

      • mvn install:install-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar.

      • mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=c:\oracle\middleware\oracle_home。

    2. 您可以使用 Maven help:describe 目标验证您是否已成功安装插件。查看 Apache 帮助 插件描述目标文档以获取更多信息。

      • mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.1.2-0-0

    【讨论】:

    • 谢谢,但您可以看到我在回答中提到我已经尝试过了。问题是我尝试的命令没有使用 weblogic 的依赖项填充我的 maven 存储库。我已经发布了一个答案,其中包含执行此操作的命令。再次感谢。
    【解决方案2】:

    答案在this page 上,其中提到了如何在本地存储库中安装 weblogic 的 maven 依赖项。要在远程存储库上安装它们,请按照说明in this section

    为了快速参考,我不得不运行这个命令(在运行之前请阅读命令后面的 cmets):

    mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=%ORACLE_HOME% -Doracle-maven-sync.testingOnly=false
    

    其中-Doracle-maven-sync.oracleHome 代表weblogic 的安装文件夹。它是一个文件夹,应该包含以下目录,而不仅仅是:

    • oracle_common
    • user_projects
    • wlserver

    在我的问题中,我已经运行了插件mvn com.oracle.maven:oracle-maven-sync:push,但我没有指定这里提到的参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-25
      • 2012-03-31
      • 1970-01-01
      • 2022-01-09
      • 1970-01-01
      • 2017-06-28
      • 1970-01-01
      • 2013-12-12
      相关资源
      最近更新 更多