构建

Problems?

  1. manifest 是干什么用的?
  2. 代码运行时,如何找到 dependency 的包
  3. java -jar 时,classpath 指定?

classpath

classpath 指定的是 java 类所在的目录(包括当前项目的类、依赖的类等)。应该是当打 jar 包的时候,默认会加上当前目录(.)到 classpath,这样就包含了 jar 内部的类?

Thin jar

gradle lean

This plugin depends on JavaPlugin and ApplicationPlugin.

  • for installDist, jars under install/$PROJECT_NAME$/lib/
  • for distZip, jars under /lib/ inside package
1
2
3
4
5
6
7
8
9
10
11
plugins {
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'

id 'scala'

id 'com.github.maiflai.scalatest' version '0.26'

id "com.github.gradle-lean" version "0.1.2"
}

implementation vs compile vs api

stackoverflow

Dependency Conflict

force some edition

1
2
3
4
5
configurations.all {
resolutionStrategy {
force 'com.fasterxml.jackson.module:jackson-module-scala_2.11:2.10.3'
}
}