WAR文件中缺少weblogic.xml文件...无法使用Eclipse中的Maven为WebLogic服务器生成WAR文件(带有weblogic.xml文件的***)。

时间:2016-07-17 01:48:56

标签: xml maven

我试图寻找解决方案但到目前为止还没有答案......我有一个Java动态Web项目并尝试构建一个WAR文件并使用Eclipse Luna中的Maven将其部署到WebLogic应用程序服务器中。我无法使用Eclipse中的Maven工具生成带有weblogic.xml文件的 WAR文件

以下是步骤......

项目 - >右键单击 - >作为Maven构建运行 - >全新安装 - > WAR文件是使用web.xml文件生成的,但缺少weblogic.xml。我是否需要在pom.xml文件项目中提供任何配置,以生成WebLogic 11应用程序服务器的weblogic.xml文件?只需要使用web.xml文件和Weblogic.xml文件生成WAR文件,我需要通过控制台在WebLogic应用程序服务器中手动部署它。

这是我的pom.xml文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>APL_LGS_DownoadService</groupId>
    <artifactId>APL_LGS_DownloadService</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>JBoss repository</id>
            <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>3.0.4.Final</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webXml>WebContent\WEB-INF\web.xml</webXml>
                    <webResources>
                        <resource>
                            <filtering>true</filtering>
                            <directory>src/main/resources</directory>
                            <includes>
                                <include>WEB-INF/weblogic.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

1 个答案:

答案 0 :(得分:0)

我认为你可以删除标签。 还要确认weblogic.xml确实位于WEB-INF文件夹下。 然后试试  1.右键单击项目 - &gt; Maven - &gt;更新项目 - &gt;好  2.右键单击项目 - &gt;以 - &gt;运行Maven干净  3.右键单击项目 - &gt;以 - &gt;运行Maven安装

如果失败了,我会尝试创建一个新的Maven项目来构建/测试。 档案 - &gt;新 - &gt;其他 - &gt; Maven项目 使用org.apache.maven.archetypes:maven-archetype-webapp:1.0

删除WEB-INF文件夹下的weblogic.xml并进行maven clean install。

如果有效,您可以比较“有效POM”标签,看看新项目与破坏项目之间有何不同。