什么网站可以帮别人做数据分析赚钱,动画专业哪个大学最好,前端开发软件哪个最好,广州海珠区地图文章目录mvn compilemvn test-compile编译插件的配置mvn compile
mvn compile 命令会将 src/main/resources 下的资源文件复制到编译输出目录下#xff1b;接着会将 src/main/java 目录下源代码编译输出到编译输出目录下。编译输出目录默认是 target/classes 目录。
打开命令…
文章目录mvn compilemvn test-compile编译插件的配置mvn compile
mvn compile 命令会将 src/main/resources 下的资源文件复制到编译输出目录下接着会将 src/main/java 目录下源代码编译输出到编译输出目录下。编译输出目录默认是 target/classes 目录。
打开命令终端切换到 pom.xml 所在目录下执行下面的命令
[~/documents/IdeaProjects/demo02]$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------- com.example:demo02 -------------------------
[INFO] Building demo02 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) demo02 ---
[INFO] Using UTF-8 encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) demo02 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/liaowenxiong/Documents/IdeaProjects/demo02/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.094 s
[INFO] Finished at: 2022-01-27T08:25:0308:00
[INFO] ------------------------------------------------------------------------从上述的执行结果可以得知执行 mvn compile 之后会先后调用 maven-resources-plugin 插件和 maven-compiler-plugin 插件两个插件分别先后完成对应的任务。
mvn compile 也属于生命周期命令默认不需要你在 pom.xml 文件中配置。
mvn test-compile
mvn compile 命令会将 src/test/resources 下的资源文件复制到编译输出目录下接着会将 src/test/java 目录下源代码编译输出到编译输出目录下。这里的编译输出目录默认是 target/test-classes 目录。
打开命令终端切换到 pom.xml 所在目录下执行下面的命令
[~/documents/IdeaProjects/demo02]$ mvn test-compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------- com.example:demo02 -------------------------
[INFO] Building demo02 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) demo02 ---
[INFO] Using UTF-8 encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) demo02 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) demo02 ---
[INFO] Using UTF-8 encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) demo02 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.755 s
[INFO] Finished at: 2022-01-27T08:53:4708:00
[INFO] ------------------------------------------------------------------------从上面的执行结果可以得知执行 mvn test-compile 会去调用 maven-resources-plugin 插件和 maven-compiler-plugin而且还分别调用了两次说明执行 mvn test-compile 命令不仅会编译 src/test/ 目录下的源码文件还会编译 src/main 目录下的源码文件。
编译插件的配置
maven-compiler-plugin 指定编译源文件的 JDK 版本和项目的编码方式。
buildpluginManagementplugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source9.0.4/source target9.0.4/target encodingUTF-8/encoding /configuration /plugin /plugins /pluginManagement
/build