提交 40641ae1 编写于 作者: oldratlee's avatar oldratlee 🔥

add "About compilation, build and dev" #177

上级 c43ee398
......@@ -32,6 +32,9 @@
- [2.3 Use Java Agent to decorate thread pool implementation class](#23-use-java-agent-to-decorate-thread-pool-implementation-class)
- [🔌 Java API Docs](#-java-api-docs)
- [🍪 Maven Dependency](#-maven-dependency)
- [🔨 About compilation, build and dev](#-about-compilation-build-and-dev)
- [How to compile and build](#how-to-compile-and-build)
- [How to development by `IDE`](#how-to-development-by-ide)
- [🗿 More Documentation](#-more-documentation)
- [📚 Related Resources](#-related-resources)
- [JDK Core Classes](#jdk-core-classes)
......@@ -269,6 +272,39 @@ The current version Java API documentation: <https://alibaba.github.io/transmitt
Check available version at [search.maven.org](https://search.maven.org/search?q=g:com.alibaba%20AND%20a:transmittable-thread-local&core=gav).
# 🔨 About compilation, build and dev
## How to compile and build
Compilation/build environment require **_`JDK 8+`_**; Compilation can be performed in the normal way of `Maven`.
\# The project already contains `Maven` that satisfied the required version, directly run **_`mvnw` in the project root directory_**; there is no need to manually install `Maven` by yourself.
```bash
# Run test case
./mvnw test
# Compile and package
./mvnw package
# Run test case, compile and package, install TTL library to local Maven
./mvnw install
##################################################
# If you use `Maven` installed by yourself, the version requirement: maven 3.3.9+
mvn install
```
## How to development by `IDE`
If you use `IDE` to develop (such as `IntelliJ IDEA`), note that:
open **_the `pom4ide.xml` file in the root directory of the project_** instead of `pom.xml` via `IDE`;
To avoid `IDE` complain using `JDK 8` standard library classes not found.
The reason that `IDE` support is not good / have to change a `POM` file, is:
The code implementation of `TTL` uses the `JDK 8` standard library class, but it is compiled into a `Java 6` version class files.
# 🗿 More Documentation
- [🎓 Developer Guide](docs/developer-guide-en.md)
......
......@@ -35,6 +35,9 @@
- [`Java`的启动参数配置](#java%E7%9A%84%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE)
- [🔌 Java API Docs](#-java-api-docs)
- [🍪 Maven依赖](#-maven%E4%BE%9D%E8%B5%96)
- [🔨 关于编译构建开发环境](#-%E5%85%B3%E4%BA%8E%E7%BC%96%E8%AF%91%E6%9E%84%E5%BB%BA%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83)
- [如何编译构建](#%E5%A6%82%E4%BD%95%E7%BC%96%E8%AF%91%E6%9E%84%E5%BB%BA)
- [如何用`IDE`开发](#%E5%A6%82%E4%BD%95%E7%94%A8ide%E5%BC%80%E5%8F%91)
- [❓ FAQ](#-faq)
- [🗿 更多文档](#-%E6%9B%B4%E5%A4%9A%E6%96%87%E6%A1%A3)
- [📚 相关资料](#-%E7%9B%B8%E5%85%B3%E8%B5%84%E6%96%99)
......@@ -309,6 +312,36 @@ java -javaagent:path/to/ttl-foo-name-changed.jar \
可以在 [search.maven.org](https://search.maven.org/search?q=g:com.alibaba%20AND%20a:transmittable-thread-local&core=gav) 查看可用的版本。
# 🔨 关于编译构建开发环境
## 如何编译构建
编译构建的环境要求: **_`JDK 8+`_**;用`Maven`常规的方式执行编译构建即可:
\# 在工程中已经包含了符合版本要求的`Maven`,直接运行 **_工程根目录下的`mvnw`_**;并不需要先手动自己安装好`Maven`
```bash
# 运行测试Case
./mvnw test
# 编译打包
./mvnw package
# 运行测试Case、编译打包、安装TTL库到Maven本地
./mvnw install
#####################################################
# 如果使用你自己安装的`Maven`,版本要求:maven 3.3.9+
mvn install
```
## 如何用`IDE`开发
如果使用`IDE`来开发(如`IntelliJ IDEA`):
注意用`IDE`打开 **_工程根目录下的`pom4ide.xml`文件_**,而不是`pom.xml`;以避免`IDE`报使用`JDK 8`的标准库类找不到。
`IDE`支持不好,要换一个`POM`文件,原因是:
`TTL`的代码实现使用了`JDK 8`的标准库类,但编译成`Java 6`版本的类文件。
# ❓ FAQ
- Mac OS X下,使用javaagent,可能会报`JavaLaunchHelper`的出错信息。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册