今天写demo的时候发现自己建的项目不是maven项目,建时忘记了,demo已经写了很多了,于是找了几种普通项目更改成maven项目的方法。
右键工程文件,新建文件pom.xml,并填写好内容。
<?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>net.javademo</groupId>
<artifactId>javademo</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
</properties>
<!--指定子模块-->
<modules>
</modules>
<dependencies>
</dependencies>
<dependencyManagement>
<dependencies>
</dependencies>
</dependencyManagement>
<build>
<plugins>
</plugins>
</build>
<!-- <repositories>-->
<!-- <repository>-->
<!-- <id>alimaven</id>-->
<!-- <name>aliyun maven</name>-->
<!-- <url>http://maven.aliyun.com/nexus/content/groups/public/</url>-->
<!-- </repository>-->
<!-- </repositories>-->
</project>
在pom.xml 文件上右键 Add as Maven Project。文章来源:https://www.toymoban.com/news/detail-613392.html
3.idea自己导入maven。文章来源地址https://www.toymoban.com/news/detail-613392.html
到了这里,关于idea将普通项目更改为maven项目的两种方式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!