m2e-wtp覆盖不加载到eclipse发布的EAR或WAR文件中。

时间:2023-01-25 11:01:45

I'm having trouble getting Eclipse to properly publish overlayed WARs locally to a weblogic server. Running a maven clean package correctly assembles the EAR with the proper webapp content imported. I've found several similar questions but none appear to be recent or the same issue.

我在让Eclipse正确地将重叠的局部战争发布到weblogic服务器上有困难。运行一个maven清洁包正确地组装EAR并导入适当的webapp内容。我发现了几个类似的问题,但似乎没有一个是最近的或同样的问题。

Looking in my org.eclipse.wst.common.component file, the dependent-module for the overlay resource is correctly generated, as well.

在我的org.eclipse.wst.common.component文件中,可以正确地生成覆盖资源的依赖模块。

I'm using m2e-wtp 1.0.1.20130911-1545

我用m2e-wtp 1.0.1.20130911-1545

Is there additional configuration that I need to do to get the server publishing to read that overlay?

我需要做额外的配置来让服务器发布来读取覆盖层吗?

Editing with more info: Here is the excerpt from the WARs pom.xml

更多信息编辑:这是摘自《战争》。xml。

<dependencies>
    <dependency>
        <groupId>com.abc</groupId>
        <artifactId>core-webcontent</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>war</type>
        <scope>runtime</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <overlays>
                    <overlay>
                        <groupId>com.abc</groupId>
                        <artifactId>core-webcontent</artifactId>
                    </overlay>
                </overlays>
            </configuration>
        </plugin>
    </plugins>
</build>

Here is the excerpt from the component file

以下是组件文件的摘录。

<dependent-module deploy-path="/" handle="module:/overlay/prj/core-webcontent?includes=**/**&amp;excludes=META-INF/MANIFEST.MF">
    <dependency-type>consumes</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&amp;excludes=META-INF/MANIFEST.MF">
    <dependency-type>consumes</dependency-type>
</dependent-module>

I tried doing an export on the EAR locally so that I could view the EAR and see if the files are being added to a different location, but it seems that does not work at all from this type of setup.

我尝试在本地的EAR上做一个导出,这样我就可以查看EAR并查看是否将文件添加到不同的位置,但是从这种类型的设置来看,它似乎根本不起作用。

1 个解决方案

#1


5  

I tried on JBoss AS 7.x/Wildfly 8.w without any problem. I downloaded Weblogic to try (I never used it) and I can confirm the behavior you see.

我试用了JBoss 7。x / Wildfly 8。w没有任何问题。我下载Weblogic来尝试(我从未使用过它),我可以确认你看到的行为。

The problem is caused by Weblogic serving files directly from the workspace location. This is the same problem that prevents overlay from working for Tomcat's "Serve without publishing" mode. Basically the overlay components provided by m2e-wtp are ignored when serving the webapps directly from source.

问题是由Weblogic服务文件直接从工作空间位置引起的。这是一个同样的问题,可以防止覆盖在Tomcat的“没有发布”模式下工作。基本上,m2e-wtp提供的覆盖组件在直接从源代码服务时被忽略。

JBoss Servers and Tomcat's default mode support overlays because the webapp is published to another location and served from there. That publishing step allows to add, then serve, the overlaid files.

JBoss服务器和Tomcat的默认模式支持覆盖,因为webapp被发布到另一个位置并在那里服务。该发布步骤允许添加,然后服务,覆盖文件。

The following changes allow Weblogic to do the same : * in the servers view, remove the EAR from your weblogic server * right-click on the weblogic server and open the Properties dialog * Go to Weblogic > Publishing * Select "Publish as an exploded archive" and press OK * Re-deploy your EAR on the weblogic server

以下更改允许Weblogic做相同的:*在servers视图中,除去你的耳朵Weblogic服务器*右键单击Weblogic服务器,打开属性对话框*去Weblogic >出版*选择“发布爆炸档案”和按下OK * Weblogic服务器上重新部署你的耳朵

It should now be served from [workspace/path]/.metadata/.plugins/org.eclipse.core.resources/.projects/[earproject]/beadep/[domain]/[earproject]/

它现在应该从[workspace/path]/.metadata/.plugins/org.eclipse.core.resources/.projects/[earproject]/beadep/[domain]/[earproject]/中提供。

One thing I noted though, is changes from the overlaid project are not published immediately. You need to do some dummy change in the main webapp to see the overlay files be deployed.

不过,我注意到的一点是,覆盖项目的变化并没有立即公布。您需要在主web应用程序中做一些虚拟更改,以查看部署的覆盖文件。

at this point, if you want to see better support for overlays in weblogic tooling, you need to reach out to Oracle.

此时,如果您希望在weblogic工具中看到更好的支持,您需要与Oracle联系。

#1


5  

I tried on JBoss AS 7.x/Wildfly 8.w without any problem. I downloaded Weblogic to try (I never used it) and I can confirm the behavior you see.

我试用了JBoss 7。x / Wildfly 8。w没有任何问题。我下载Weblogic来尝试(我从未使用过它),我可以确认你看到的行为。

The problem is caused by Weblogic serving files directly from the workspace location. This is the same problem that prevents overlay from working for Tomcat's "Serve without publishing" mode. Basically the overlay components provided by m2e-wtp are ignored when serving the webapps directly from source.

问题是由Weblogic服务文件直接从工作空间位置引起的。这是一个同样的问题,可以防止覆盖在Tomcat的“没有发布”模式下工作。基本上,m2e-wtp提供的覆盖组件在直接从源代码服务时被忽略。

JBoss Servers and Tomcat's default mode support overlays because the webapp is published to another location and served from there. That publishing step allows to add, then serve, the overlaid files.

JBoss服务器和Tomcat的默认模式支持覆盖,因为webapp被发布到另一个位置并在那里服务。该发布步骤允许添加,然后服务,覆盖文件。

The following changes allow Weblogic to do the same : * in the servers view, remove the EAR from your weblogic server * right-click on the weblogic server and open the Properties dialog * Go to Weblogic > Publishing * Select "Publish as an exploded archive" and press OK * Re-deploy your EAR on the weblogic server

以下更改允许Weblogic做相同的:*在servers视图中,除去你的耳朵Weblogic服务器*右键单击Weblogic服务器,打开属性对话框*去Weblogic >出版*选择“发布爆炸档案”和按下OK * Weblogic服务器上重新部署你的耳朵

It should now be served from [workspace/path]/.metadata/.plugins/org.eclipse.core.resources/.projects/[earproject]/beadep/[domain]/[earproject]/

它现在应该从[workspace/path]/.metadata/.plugins/org.eclipse.core.resources/.projects/[earproject]/beadep/[domain]/[earproject]/中提供。

One thing I noted though, is changes from the overlaid project are not published immediately. You need to do some dummy change in the main webapp to see the overlay files be deployed.

不过,我注意到的一点是,覆盖项目的变化并没有立即公布。您需要在主web应用程序中做一些虚拟更改,以查看部署的覆盖文件。

at this point, if you want to see better support for overlays in weblogic tooling, you need to reach out to Oracle.

此时,如果您希望在weblogic工具中看到更好的支持,您需要与Oracle联系。