- 创建空目录
- F:\jtDevelop\maventest\myapp
- 创建pom.xml文件
-
<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"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>myapp</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> </project>
-
- 创建目录
- F:\jtDevelop\maventest\myapp\src\main\java
- 编写java文件
- F:\jtDevelop\maventest\myapp\src\main\java\Test.java
-
public class Test{ public static void main(String[] args){ System.out.println("Hello Maven"); } }
- 使用Maven编译
-
F:\jtDevelop\maventest\myapp>cd F:\jtDevelop\maventest\myapp F:\jtDevelop\maventest\myapp>mvn compile [INFO] BUILD SUCCESS
-
原文地址:https://www.cnblogs.com/jiangtao1218/p/9966139.html
时间: 2024-11-13 20:01:02