Springboot构建之pom配置

<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.panda.springboat</groupId>
	<artifactId>panda.springboat</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>war</packaging>
 
	<dependencies>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>5.0.8.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/com.jolbox/bonecp-spring -->
		<dependency>
			<groupId>com.jolbox</groupId>
			<artifactId>bonecp-spring</artifactId>
			<version>0.8.0.RELEASE</version>
		</dependency>
 
	</dependencies>
	<pluginRepositories>
		<pluginRepository>
			<id>alfresco-public</id>
			<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
		</pluginRepository>
		<pluginRepository>
			<id>alfresco-public-snapshots</id>
			<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>daily</updatePolicy>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>beardedgeeks-releases</id>
			<url>http://beardedgeeks.googlecode.com/svn/repository/releases</url>
		</pluginRepository>
	</pluginRepositories>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.2.2</version>
				<configuration>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat8-maven-plugin</artifactId>
				<version>3.0-r1756463</version>
				<configuration>
					<!-- <path>/</path> -->
					<server>tomcat8</server>
					<port>8080</port>
					<encoding>UTF-8</encoding>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<repositories>
		<repository>
			<id>Sonatype</id>
			<name>Sonatype Repository</name>
			<url>http://mvnrepository.com/</url>
			<layout>default</layout>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
</project>

转载来源 https://blog.csdn.net/angelinsky93 谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Spring Boot应用程序的pom.xml文件中,您需要进行以下配置: 首先,确保您的项目是一个Maven项目,并且已正确设置了Maven依赖项。 然后,在pom.xml文件的<dependencies>标签中,添加以下依赖项: ```xml <dependencies> <!-- Spring Boot 核心依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <!-- Spring Boot Web依赖,用于构建Web应用程序 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- 其他Spring Boot Starter依赖,根据您的需求进行添加 --> </dependencies> ``` 接下来,在pom.xml文件的<build>标签中,添加以下配置: ```xml <build> <!-- 打包方式为jar --> <packaging>jar</packaging> <!-- 配置Java版本 --> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <!-- 根据您的Java版本进行设置 --> <target>1.8</target> <!-- 根据您的Java版本进行设置 --> </configuration> </plugin> <!-- Spring Boot插件,用于打包可执行的jar文件 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> ``` 最后,确保您的pom.xml文件中已经包含了正确的Spring Boot版本号。 这样,您的Spring Boot应用程序的pom.xml文件就配置完成了。您可以根据自己的需求,添加其他所需的依赖项。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值