带有ssl问题的Weblogic maven插件

时间:2011-06-03 08:35:51

标签: plugins ssl maven weblogic

我现在正在尝试使用oracle weblogic maven插件将应用程序部署到具有管理端口的管理服务器。 我正在使用t3s协议进行连接,但我想知道是否可以在maven插件/参数中设置我的自定义密钥库和证书 在pom.xml或命令行中。 我无法在互联网上找到解决方案。 非常感谢帮助。

2 个答案:

答案 0 :(得分:1)

理论上你可以在maven opts中设置weblogic ssl头文件 - 就像这样 -Dweblogic.security.TrustKeyStore = CustomTrust -Dweblogic.security.CustomTrustKeyStoreFileName =

但是插件似乎没有像weblogic.Deployer那样选择它们。这有点奇怪,因为maven插件无论如何只运行部署者。

我也尝试将java密钥库设置为自定义密钥库(也没有运气)

答案 1 :(得分:0)

好吧问题就像“老”:) - 但似乎没有确定的答案,因为这个问题在google中出现在top10这里是我做的maven - > weblogic部署工作

使用: maven 3.2.3部署到WLS 12.1.3和WLS 12.1.3 DEV(不要忘记在启动之前执行configure脚本 - 以及 - 任何事情)

设置(完成一次)

按照Oracle Docs for the Maven Plugin设置插件。简而言之:

主要是你将从WLS DEV zip安装一个maven插件来安装另一个maven插件:

cd %WL_HOME%\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3

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

安装用于部署的插件:

mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=%WL_HOME%

验证插件是否正常:

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

如果您需要将其添加到Maven存储库代理,您可以临时更改本地存储库的路径,执行这些命令,这就是所需的(在我的情况下大约230MB)。我会在maven代理上添加另一个第三方存储库,并将所有内容放在那里,以防您以后需要清理。

然后使用InstallCert工具将SSL证书导入新的密钥库。我们将此密钥库放在创建EAR文件并执行部署的maven模块中。

<强>部署

准备好EAR文件后,您需要将其添加到构建部分: (只有在使用t3时才需要使用SSL /密钥库,如果没有涉及自签名证书,您显然会跳过属性设置)

以某种方式需要“TrustKeyStore = CustomStore”参数!不得更改名称。

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <configuration>
                <properties>
                    <weblogic.security.TrustKeyStore>CustomTrust</weblogic.security.TrustKeyStore>
                    <weblogic.security.CustomTrustKeyStoreFileName>${basedir}/src/main/keystore/cacerts.dev.jks</weblogic.security.CustomTrustKeyStoreFileName>
                    <weblogic.security.TrustKeystoreType>JKS</weblogic.security.TrustKeystoreType>
                    <weblogic.security.CustomTrustKeyStorePassPhrase>changeit</weblogic.security.CustomTrustKeyStorePassPhrase>
                </properties>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>set-system-properties</goal>
                    </goals>
                    <phase>initialize</phase>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>com.oracle.weblogic</groupId>
            <artifactId>weblogic-maven-plugin</artifactId>
            <version>12.1.3-0-0</version>
            <configuration>
                <adminurl>t3s://HOSTNAME_HERE:7101</adminurl>
                <user>WLS-USER-IN-DEPLYOERS-GROUP</user>
                <password>WLS-USER-PASSWORD</password>
                <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
                <targets>TARGET_SERVERNAME_IN_WLS_TO_DEPLOY_TO</targets>
                <verbose>true</verbose>
                <name>YouApplicationName</name>
                <remote>true</remote>
                <upload>true</upload>
            </configuration>
            <executions>
                <execution>
                    <id>wls-deploy-dev</id>
                    <phase>install</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

以上配置将在安装阶段部署EAR - 随时可以更改为weblogic-maven-plugin的阶段。我猜也可能是个人资料。

快乐部署:)

<强>链接: