jetty启动,设置虚拟路径

 

原链接:maven pom 配置jetty启动,设置虚拟路径

 

 

参考配置如下:

 

<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/maven-v4_0_0.xsd">

        ......

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>
        <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
    </properties>
    <dependencies>
        ......
    </dependencies>
    <build>
        <finalName>test_pro</finalName>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.10.v20150310</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <httpConnector>
                        <port>8080</port>
                    </httpConnector>
                    <webApp>
                        <contextPath>/test_pro</contextPath>
                    </webApp>
                    <contextHandlers>
                        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                            <!--设置虚拟路径  -->
                            <contextPath>/test_pro/upload</contextPath>
                            <resourceBase>G:/upload_dir/upload</resourceBase>
                        </contextHandler>
                    </contextHandlers>
                </configuration>
            </plugin>

            <!-- 集成JDK编译插件compiler, 设定编译时用的JDK版本 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

        </plugins>
    </build>


</project>

 

 

见鬼网 微信公众平台 : “ 见鬼网”(ID:faceghost) 欢迎关注~

 

转载于:https://www.cnblogs.com/face-ghost-coder/p/8891287.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值