黑猴子的家:Maven 插件 Pom.xml 定义

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <log4j.leve>debug</log4j.leve>
    <log4j.ale>debug</log4j.ale>
    <scala.version>2.11.8</scala.version>
    <scala.tools.version>2.15.2</scala.tools.version>
    <junit.version>3.8.1</junit.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
      <!--<scope>provided</scope>-->
    </dependency>
    <dependency>
      <groupId>org.scala-tools</groupId>
      <artifactId>maven-scala-plugin</artifactId>
      <version>${scala.tools.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <!-- java代码编译插件 -->
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
              <source>1.8</source>
              <target>1.8</target>
              <encoding>UTF-8</encoding>
          </configuration>
          <executions>
              <execution>
                  <phase>compile</phase>
                  <goals>
                      <goal>compile</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      <!-- scala代码编译插件 -->
      <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>3.2.2</version>
          <executions>
              <execution>
                  <id>scala-compile-first</id>
                  <phase>process-resources</phase>
                  <goals>
                      <goal>compile</goal>
                      <goal>add-source</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      <!-- maven打包插件,以maven-assembly-plugin方式打包-->
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.0.0</version>
          <configuration>
              <archive>
                  <manifest>
                      <mainClass>com.alex.json.test.FastJsonUtilTest</mainClass>
                  </manifest>
              </archive>
              <descriptorRefs>
                  <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
              <!-- this is used for not append id to the jar name -->
              <appendAssemblyId>true</appendAssemblyId>
          </configuration>
          <executions>
              <execution>
                  <id>make-assembly</id>
                  <phase>package</phase>
                  <goals>
                      <goal>single</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
    </plugins>
  </build>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容