并提前感谢您的帮助。
我试图让 oracle weblogic mvn 插件在我的机器上正常运行,但我最终在连接到管理服务器时遇到了困难,并且插件错误消息在跟踪问题时不是很有用。
概述:我基本上遵循以下两页:(a)在我的本地存储库上安装插件:http: //docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD383 (b ) 配置maven插件 http://www.oracle.com/technetwork/articles/soa/eisele-weblogic-netbeans-2193786.html
所以我的配置如下:
<profiles>
<profile>
<id>weblogicDeploy</id>
<properties>
<weblogic.server.version>12.1.2.0</weblogic.server.version>
<weblogic.server.adminurl>t3://127.0.0.1:7001</weblogic.server.adminurl>
<weblogic.server.middlewareHome>D:/appservers/weblogic</weblogic.server.middlewareHome>
<weblogic.server.serverName>AdminServer</weblogic.server.serverName>
<weblogic.server.userName>weblogic</weblogic.server.userName>
<weblogic.server.password>welcome1</weblogic.server.password>
</properties>
<dependencies>
<!--dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-server-pom</artifactId>
<version>${weblogic.server.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency-->
</dependencies>
<build>
<plugins>
<!--
To have access to this plugin one must follow this guide:
http://docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD383
The plugin is bundled with the web logic server - we cannot get it from the web unless we install it
into our nexus ...
(1) D:\weblogic\wlserver\server\lib>java -jar wljarbuilder.jar -profile weblogic-maven-plugin
(2) jar xvf c:\tmp\weblogic-maven-plugin.jar META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml
(3) mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml
-->
<plugin>
<!-- This is the configuration for the weblogic-maven-plugin -->
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>${weblogic.server.version}</version>
<configuration>
<middlewareHome>${weblogic.server.middlewareHome}</middlewareHome>
</configuration>
<executions>
<!-- Deploy the application to the WebLogic Server in the pre-integration-test phase -->
<execution>
<id>wls-deploy</id>
<!-- Summary Of phase:
process and deploy the package if necessary into an environment where integration tests can be run
-->
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<!--The admin URL where the app is deployed.
Here use the plugin's default value t3://localhost:7001-->
<adminurl>${weblogic.server.adminurl}</adminurl>
<user>${weblogic.server.userName}</user>
<password>${weblogic.server.password}</password>
<!--The location of the file or directory to be deployed-->
<source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
<!--The target servers where the application is deployed. -->
<!--targets>${weblogic.server.serverName}</targets-->
<verbose>true</verbose>
<name>${project.build.finalName}</name>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
上述配置中似乎没有任何错误: (a) (t3Url x 用户名 x 密码) 我可以很容易地验证这些是有效的
$ netstat -an | grep "LISTEN" | grep "7001"
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7001 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7001 0.0.0.0:0 LISTENING
....
我还可以使用 WLST 连接到服务器: Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect('weblogic','welcome1','t3://127.0.0.1:7001')
Connecting to t3://127.0.0.1:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "whateverdomain".
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
(c) 上一点显示 (a) url,(b) 用户名,(c) 密码,(d) 目标管理服务器......基本上所有内容。
但是在 mvn 中,运行 mvn 插件,我最终总是会遇到以下异常。
Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.1.2.0:deploy (wls-deploy) on project whatevermy-war: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://127.0.0.1:7001': weblogic.security.utils.KeyStoreConfiguration. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server. -> [Help 1]
上面的异常消息是一个非常笨拙的消息:(a)插件知道它给出的 url,它知道它没有被告知使用 http 它是 t3 协议(b)如果使用 url 端口并设置无效端口,我确实得到了一个套接字异常,并且来自插件的异常消息是完全相同的......
应该有一个配置方面我错了,管理服务器名称,隐藏的安全策略......一些东西,但我现在没有看到它可能是什么。
顺便说一句,我已经评论了对服务器 pom 的依赖,因为你无法从远程存储库中获取这些依赖,而且我不知道 web 逻辑服务器中的哪个 jar 隐藏了 pom。否则,我也会安装在我的本地存储库中。我怀疑这是否相关,因为该插件似乎对尝试连接到 weblogic 感到满意。
非常感谢。