使用Maven作为Weblogic 10.3的构建工具 [英] Using maven as build tool for Weblogic 10.3

查看:91
本文介绍了使用Maven作为Weblogic 10.3的构建工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Weblogic Server 10.3(和Portal等)设置为使用 maven 作为构建工具.我试图找到一个不错的教程或文档,该怎么做.有一些针对9.0之类较旧版本的教程,但是有关版本10的信息很少.

I am trying to setup Weblogic Server 10.3 (and Portal etc.) to use maven as a build tool. I am trying to find a decent tutorial or documentation how to do this. There are some tutorials for older versions like 9.0, but there is little info for version 10.

我正在寻找一种使用Maven构建Weblogic的耳文件的方法.人们实际上是在这样做吗?使用Maven值得麻烦吗?

I am looking a way to build weblogic's ear file with maven. Are people actually doing this? Is using maven worth the trouble?

我想使用Maven以便与 Hudson 之类的连续集成工具更轻松地集成.

I would like to use maven in order to have easier integration with continuous integration tools like Hudson.

edit:似乎有一种直接导出maven文件的方法 http://edocs.bea.com/wlw/docs102/guide/ideuserguide/build/conMavenScript.html .但是这些文件是ant的简单包装.

edit: There seems to be a way to export maven files directly http://edocs.bea.com/wlw/docs102/guide/ideuserguide/build/conMavenScript.html. But those files are simple wrappers for ant.

推荐答案

我正在使用maven来构建EAR,并部署了WebLogic Server 10.3.棘手的部分是:

I am using maven to build an EAR which I deploy an WebLogic Server 10.3. The tricky parts were:

  • 找到weblogic-maven-plugin的所有依赖项
  • 将所有依赖项放入Maven存储库中(我真的建议 Sonatype Nexus )
  • 将noExit设置为true(否则,您将在hudson中遇到问题!)

我在EAR项目中使用以下目录结构:

I use the following directory structure in the EAR project:

pom.xml
src/
   main/
        app/
            META-INF/
                     weblogic-application.xml

以下摘自我的pom.xml:

The following is taken from my pom.xml:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <displayName>My Project</displayName>
                <earSourceDirectory>src/main/app</earSourceDirectory>
                <modules>
                    <webModule>
                        <groupId>com.somecompany</groupId>
                        <artifactId>webapp</artifactId>
                    </webModule>
                </modules>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>weblogic-maven-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
                <execution>
                    <phase>deploy</phase>
                    <goals>
                        <goal>deploy</goal>
                        <goal>start</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <name>my-project</name>
                <adminServerHostName>${wls.adminServerHostName}</adminServerHostName>
                <adminServerPort>${wls.adminServerPort}</adminServerPort>
                <adminServerProtocol>t3</adminServerProtocol>
                <userId>${wls.userId}</userId>
                <password>${wls.password}</password>
                <upload>true</upload>
                <remote>true</remote>
                <verbose>false</verbose>
                <debug>false</debug>
                <targetNames>AdminServer</targetNames>
                <noExit>true</noExit>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.5</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>weblogic</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>webservices</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.utils.full</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.i18n</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.rmi.client</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>javax.enterprise.deploy</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>webserviceclient</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.security.wls</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.security.identity</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.security</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>wlclient</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.transaction</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.utils.classloaders</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>wljmsclient</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.management.core</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>wls-api</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.descriptor</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.logging</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.socket.api</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.security.digest</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.workmanager</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.weblogic.lifecycle</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.utils.wrapper</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>wlsafclient</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.management.jmx</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>weblogic</groupId>
                    <artifactId>com.bea.core.descriptor.wl</artifactId>
                    <version>${weblogic.version}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

这篇关于使用Maven作为Weblogic 10.3的构建工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆