其他分享
首页 > 其他分享> > Maven

Maven

作者:互联网

Maven

Maven 的理解

生命周期是抽象的理解

maven 插件

C:\Users\someo\Desktop\workTestJava\maevn-build-test>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.example:maevn-build-test >--------------------
[INFO] Building teetetete 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ maevn-build-test ---
[INFO] Deleting C:\Users\someo\Desktop\workTestJava\maevn-build-test\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.499 s
[INFO] Finished at: 2021-07-15T10:29:43+08:00
[INFO] ------------------------------------------------------------------------

maven 所有的生命周期

pom 中的resource到底怎么用的???

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.txt</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.txt</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.txt</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.txt</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>

maven 的生命周期 和 maven 插件的目标 的关系

            <plugin>
				...
				...
                <executions>
                    <execution>
                        <id>随意名字</id>
                        <phase>package</phase>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

为什么有的插件啥都没写,只是引入了就知道绑定在了哪个生命周期上

mvn help:describe -Dplugin=org.apache.maven.plugins:maven-source-plugin:3.2.0 -Ddetail

>>>>


source:jar-no-fork
  Description: This goal bundles all the sources into a jar archive. This
    goal functions the same as the jar goal but does not fork the build and is
    suitable for attaching to the build lifecycle.
  Implementation: org.apache.maven.plugins.source.SourceJarNoForkMojo
  Language: java
  Bound to phase: package
 
  Available parameters:
 
    archive
      The archive configuration to use. See Maven Archiver Reference.
      Note: Since 3.0.0 the resulting archives contain a maven descriptor. If
      you need to suppress the generation of the maven descriptor you can
      simply achieve this by using the archiver configuration..
 
    attach (Default: true)
      User property: maven.source.attach
    ...
    ...
    ...
    ...

标签:INFO,maven,插件,生命周期,Maven,clean,txt
来源: https://www.cnblogs.com/daguniang/p/16594926.html