构建EAR并在Weblogic 12c上部署

时间:2018-09-14 01:50:50

标签: java maven weblogic ear

我正在尝试构建一个应用程序并将其打包为EAR文件,以将其部署在Weblog服务器上。 我在这里创建了一个简单的示例:https://github.com/PaulFinnE/myapptest

有:

  • 用于简单servlet的pom模块(一些遗留物)
  • 用于html文件的pom模块(以后称为Angual应用)
  • 用于springboot应用程序的pom模块(但这是以后的主题)
  • 用于将这些WAR构建为EAR文件的pom模块

这里是EAR构建插件配置:
完整内容:https://github.com/PaulFinnE/myapptest/blob/master/myapp-ear/pom.xml

<plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <displayName>MyAppY-Application-DisplayName</displayName>
                <description>MyAppY-Application-Description</description>
                <packagingIncludes>META-INF/**,*.war</packagingIncludes>
                <modules>
                    <webModule>
                        <groupId>local.example.myappy</groupId>
                        <artifactId>myapp-html-war</artifactId>
                        <contextRoot>myapp-html</contextRoot>
                    </webModule>
                    <webModule>
                        <groupId>local.example.myappy</groupId>
                        <artifactId>myapp-servlet-war</artifactId>
                        <contextRoot>myapp-servlet</contextRoot>
                    </webModule>
                </modules>
            </configuration>
        </plugin>

此处是html WAR构建插件配置:
完整内容:https://github.com/PaulFinnE/myapptest/blob/master/myapp-html-war/pom.xml

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <webResources>
                    <resource>
                        <directory>html/</directory>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

这里是servlet WAR构建插件配置:
完整内容:https://github.com/PaulFinnE/myapptest/blob/master/myapp-servlet-war/pom.xml

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

如果我将它们部署到tomcat,则两个WAR都可以按预期工作。

http://localhost:8080/myapp-servlet/hello
http://localhost:8080/myapp-html/index.html

但是当我获取EAR文件并部署到weblogic时,我只会得到Not Found响应。

要让EAR工作,我想念什么?

注意:我在日志中找不到任何内容。服务器和部署状态都很好。自己的其他构建方式不是EAR在该weblogic上工作-但现在我自己没有。

0 个答案:

没有答案