Maven:plugin节点配置

maven-jar-plugin
  • 此方法可以打包程序,程序的依赖放置在生成的jar文件外的lib文件夹中
<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-jar-pluginartifactId>
    <configuration>
        <classesDirectory>target/classes/classesDirectory>
        <archive>
            <manifest>
                
                <mainClass>com.yqsh.kit.context.ApplicationmainClass>
                
                <useUniqueVersions>falseuseUniqueVersions>
                <addClasspath>trueaddClasspath>
                <classpathPrefix>lib/classpathPrefix>
            manifest>
            <manifestEntries>
                <Class-Path>.Class-Path>
            manifestEntries>
        archive>
    configuration>
plugin>
maven-compiler-plugin
  • maven编译当前项目的配置
<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-compiler-pluginartifactId>
    <version>3.3version>
    <configuration>
        <source>1.8source>
        <target>1.8target>
    configuration>
plugin>
maven-assembly-plugin
  • 此方法可以将依赖的jar包,以class的形式整合进打包的程序中
<plugin>
    <artifactId>maven-assembly-pluginartifactId>
    <configuration>
        <descriptorRefs>
            <descriptorRef>jar-with-dependenciesdescriptorRef>
        descriptorRefs>
        <archive>
            <manifest>
                <mainClass>com.yqsh.kit.context.ApplicationmainClass>
            manifest>
        archive>
    configuration>
    <executions>
        <execution>
            <id>make-assemblyid>
            <phase>packagephase>
            <goals>
                <goal>singlegoal>
            goals>
        execution>
    executions>
plugin>

你可能感兴趣的:(Maven)