java, maven memo

what is Maven Project management tool

install to windows

  1. download maven from https://maven.apache.org/download.cgi
  2. Extract Move to any directory
  3. Somehow add /apatch-maven-x.x.x/bin to PATH
  4. Check with mvn -v

Description example of 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/xsd/maven-4.0.0.xsd"
 >

  <modelVersion>4.0.0</modelVersion>
  <groupId>java_training</groupId>
  <artifactId>java_lang</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <properties>
    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
    <console.encoding>utf-8</console.encoding>
    <!-- console.encoding>Windows-31J</console.encoding -->
    <maven.compiler.source>12</maven.compiler.source>
    <maven.compiler.target>12</maven.compiler.target>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <compilerArgs>
            <arg>-parameters</arg>
            <arg>--enable-preview</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <additionalJOption>-J-Dfile.encoding=${console.encoding}</additionalJOption>
          <additionalOptions>--enable-preview</additionalOptions>
          <source>${maven.compiler.source}</source>
          <linksource>true</linksource>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

build

mvn compile //compile
mvn compile exec:java // exec.Can be executed if the mainClass property is set
mvn javadoc:javadoc //Generate javadoc
mvn clean //Delete auto-generated files
mvn -Dmaven.test.skip=true package //skip test
mvn -DskipTests package //skip test


Recommended Posts

java, maven memo
Java memo
java anything memo
Java Silver memo
Java SE 7 memo
java anything memo 2
Maven3 error memo
Java specification memo
Java pattern memo
Java development environment memo
java basic knowledge memo
Java learning memo (method)
Java Kuche Day memo
[Java ~ Method ~] Study memo (5)
java se 8 programmer Ⅰ memo
Java paid private memo
[Java ~ Array ~] Study memo 4
Java learning memo (basic)
java lambda expression memo
(Memo) Java for statement
Java lambda expression [memo]
Java learning memo (interface)
[Java] Implicit inheritance memo
Java learning memo (inheritance)
java competitive programming memo
[Memo] Java Linked List
maven
Java (WebSphere Application Server) memo [1]
[Java] Variable name naming memo
Java memo (standard class) substring
Java learning memo (data type)
Java memo (standard class) length
Try gRPC with Java, Maven
Java Silver Study Method Memo
[Java ~ Boolean value ~] Study memo (2)
Create a java method [Memo] [java11]
Java Silver exam preparation memo
Java learning memo (logical operator)
Java
Java learning memo (abstract class)
[Java] Date Related Term Memo
Java study memo 2 with Progate
Java
What are Java metrics? _Memo_20200818
Java HashMap, entrySet [Personal memo]
[Eclipse Java] Development environment setting memo
Java learning memo (creating an array)
JCA (Java Cryptography Architecture) Usage Memo
[Java] Memo for naming class names
[Study session memo] Java Day Tokyo 2017
Java learning memo (while statement, do-while statement)
From Java to VB.NET-Writing Contrast Memo-
Java beginner's stumbling block [memo writing]
Develop gRPC on Windows + Java 7 + Maven 2
[Java] Processing time measurement method memo
I tried using Java memo LocalDate
Integer memo
docker memo
Java learning (0)
Studying Java ―― 3
[Java] array