【问题标题】:How can I deploy Glassfish Maven app on CloudBees?如何在 CloudBees 上部署 Glassfish Maven 应用程序?
【发布时间】:2013-06-05 15:17:23
【问题描述】:

我正在尝试在 Cloudbees 上部署一个 Maven Web 应用程序。我的应用程序在 Netbeans 上成功运行,我单击了 ClickStart,然后单击了 Glassfish App Server。我创建了我的应用程序。之后,我上传了我的战争文件。当我打开应用程序时,我的浏览器而不是我的应用程序上有 Glassfish 默认欢迎页面。如何将 Glassfish 应用部署到 Cloudbees?

我的 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>com.mycompany</groupId>
    <artifactId>webserviceCloudBees</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>webserviceCloudBees</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <pluginRepositories>
        <pluginRepository>
            <id>cloudbees-public-release</id>
            <url>http://repository-cloudbees.forge.cloudbees.com/public-release</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.2.7</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.cloudbees</groupId>
                <artifactId>bees-maven-plugin</artifactId>
                <version>1.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

【问题讨论】:

    标签: java maven glassfish cloudbees


    【解决方案1】:

    你是如何“上传战争文件”的?当您使用 clickstart 时,预期的步骤是检索生成的示例应用程序的源代码并适应您自己的应用程序,然后提交。然后 Jenkins 将构建和部署。您还可以使用 cloudbees SDK(或集成的 eclipse 插件)从 war 中进行部署,而无需使用 clickstart。

    【讨论】:

    • 首先我单击 CliskStart,然后选择 Glassfish 3 App。然后我为我的应用程序命名。创建我的应用程序后,我进入我的应用程序中心并选择我的应用程序。之后,我单击“或者,上传 WAR 文件”按钮并上传我的 WAR 文件。但是我的应用程序不起作用。有没有关于它的教程?
    • 首选的部署方式(就像 clickstarts 一样)是推送应用程序源代码,让 jenkins 构建足够的包并部署到 RUN@Cloud。克隆 clickstart 创建的 git repo 并用你自己的代码覆盖默认的演示应用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    相关资源
    最近更新 更多