将Eclipse wtp项目(Dynamic Web模块)改造为openshift [英] mavenize eclipse wtp project (Dynamic web module) for openshift

查看:68
本文介绍了将Eclipse wtp项目(Dynamic Web模块)改造为openshift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设法在Openshift中发布我的项目-通过scp将战争移至正确的位置,如

Managed to publish my project in Openshift - by scp'ing the war to the correct location as detailed here. Here is the .project file:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>DataCollectionServlet</name>
    <comment></comment>
    <projects></projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
            <arguments></arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments></arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.common.project.facet.core.builder</name>
            <arguments></arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.validation.validationbuilder</name>
            <arguments></arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

在glassfish和Jboss上本地运行-在OpenShift中,我只有jbossas装备

Runs locally on glassfish and Jboss - in OpenShift I only have the jbossas gear

现在,我想正确设置它,以便在执行git push时就可以构建它.我需要进行项目美化吗?我安装了m2e插件,但是转换为maven项目"没有转移依赖项(存在项目依赖项和自定义jar以及logback和co),也没有创建"maven"文件夹结构.

Now I want to properly set it up so it is build when I do a git push. Do I need to mavenize the project ? I installed the m2e plugin but "Convert to maven project" did not transfer the dependencies (there are project dependencies and custom jar ones as well as logback and co) and did not create a "maven" folder structure.

我必须创建一个特定的文件夹结构吗?我需要手动设置构建挂钩吗?

Do I have to create a particular folder structure ? Do I need to set up build hooks manually ?

Eclipse Luna,Java EE包

Eclipse Luna, Java EE pack

推荐答案

OpenShift使用pom.xml文件来编译和发布您的Java项目.您应该尝试在OpenShift上创建一个Java项目,并git在本地将其克隆,然后通读pom.xml文件并查看使其工作所需的组件.这样做是值得的,然后将您的项目转换为OpenShift使用的Maven结构.在pom.xml的末尾保留/保留openshift配置文件非常重要,因为这可以告诉您的齿轮.war文件在生成后将放置在何处.

OpenShift uses the pom.xml file to compile and publish your java project. You should try creating a java project on OpenShift, and git clone it locally, then read through the pom.xml file and see what components that you need for it to work. It would be worth doing that and then converting your project into that maven structure that OpenShift uses. It is important to have/leave the openshift profile at the end of the pom.xml as that is what tells your gear where to put your .war file after it is built.

这篇关于将Eclipse wtp项目(Dynamic Web模块)改造为openshift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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