How to get maven project running local server from IntelliJ

已回答

Early stages of understanding Java development. I have created a new Maven project in IntelliJ (not used an archetype).

So far I have added a folder called src/main/webapp and dropped an index.jsp file in there that has some sample code that prints "hello world" to the screen.

I then examined some example pom.xml files and attempted to create my own that would allow me to at least run my app locally:

<?xml version="1.0" encoding="UTF-8"?>
<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>romac</groupId>
    <artifactId>connect-parent</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <jdk.version>1.8</jdk.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>romac-connect</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.11.v20180605</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <stopKey>STOP</stopKey>
                    <stopPort>8005</stopPort>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

I'm then unsure how to run my project with Jetty or with Google Cloud Tools. I'm developing for Google App Engine Standard so which is preferable for using as local server? how do I get it to run from IntelliJ UI?

0

请先登录再写评论。