IDEA在pom.xml中配置jetty信息
程序员文章站
2024-01-15 23:09:16
...
IDEA在pom.xml中配置jetty信息
1.首先在pom.xml页面中配置jetty信息
<?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>cn.edu.mju</groupId>
<artifactId>Project1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Project1 Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>Project1</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.12.v20130726</version>
<configuration>
<webApp>
<contextPath>/</contextPath>
</webApp>
<stopKey>webx</stopKey>
<stopPort>9999</stopPort>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8081</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">
<filename>target/access.log</filename>
<retainDays>90</retainDays>
<append>false</append>
<extended>false</extended>
<logTimeZone>GMT+8:00</logTimeZone>
</requestLog>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
配置完代码如上。
2.第一步配置如下图所示:
3.运行成功提示。
4.浏览器输入localhost:8081/显示
上一篇: 快速-Python开发环境搭建
下一篇: Maven问题记录
推荐阅读
-
IDEA在pom.xml中配置jetty信息
-
maven的安装配置以及在IDEA中的配置图文教程
-
在Spring Cloud中配置Feign的拦截器 增加自定义的请求信息进去 以及演示加入Authorization到请求Headers
-
在IDEA中maven配置MyBatis的流程详解
-
MyBatis Generator在pom.xml中配置的configuration无效(错误解决)
-
在IDEA(2020.2)中配置Git及使用Git的图文详解
-
在IDEA中配置SFTP远程Linux服务器系统的实现
-
Hybris在idea中debug配置方法详解
-
在IDEA2020.2中配置使用Git的详细教程
-
idea项目在maven projects中显示灰色的解决办法及application配置文件不显示绿色图标