Skip to content

Instantly share code, notes, and snippets.

@hochun836
Last active October 20, 2022 06:09
Show Gist options
  • Select an option

  • Save hochun836/62a6abe30a6bdf6d5f52c09eb53fc7e4 to your computer and use it in GitHub Desktop.

Select an option

Save hochun836/62a6abe30a6bdf6d5f52c09eb53fc7e4 to your computer and use it in GitHub Desktop.
# base
javac (java compiler)
java
# javac
javac -version
javac -help
javac xxx.java // compile to xxx.class
# java
java -version
java -help
java <package>.<class>
java -cp xxx.jar <package>.<class> // cp: classpath
java -jar xxx.jar
# maven
mvn --version // <=> mvn -v
mvn archetype:generate -DgroupId=com -DartifactId=DemoConsole -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
mvn clean
mvn package
mvn clean package
NOTE: build lifecycle
| 1. each lifecycle has multi phases
| 2. each phase has multi goals
clean
default
site
=> ref: https://openhome.cc/Gossip/JUnit/BuildLifeCycle.html
=> ref: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
=> ref: https://www.bilibili.com/video/BV1x5411P7Hh
NOTE: settings.xml
%MAVEN_HOME%\conf\settings.xml
=> ref: https://www.cnblogs.com/jingmoxukong/p/6050172.html
Q: when maven building, show "no compiler is provided in this environment"
set JAVA_HOME
Q: when maven building, show "blocked mirror for repositories"
=> ref: https://stackoverflow.com/questions/67001968/how-to-disable-maven-blocking-external-http-repositories
NOTE: what is mvnw
mvnw (maven wrapper) is maven project scope
mvn is global scope
=> ref: https://blog.csdn.net/adparking/article/details/114692211
NOTE: create a mvnw
mvn -N io.takari:maven:0.7.6:wrapper // in a maven project
# spring boot cli
spring --help
spring --version
spring help <command> // show more information on a specific command
spring help init // initialize a new project using Spring Initializr (start.spring.io)
spring init [options] [location]
spring init --list // list all the capabilities of the service (https://start.spring.io/)
spring init // create a default project
spring init -d=web,jpa --build=maven -j=1.8 DemoSpringBoot.zip // -d <=> --dependencies, -j <=> --java-version
spring init -d=web,jpa --build=maven -j=1.8 DemoSpringBoot // if a location is specified without an extension, extract the project archive
NOTE: manual installation
=> ref: https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.installing.cli.manual-installation
NOTE: Spring Boot Reference Documentation
=> ref: https://docs.spring.io/spring-boot/docs/current/reference/html/index.html
NOTE: Spring Framework Documentation
=> ref: https://docs.spring.io/spring-framework/docs/current/reference/html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment