安装 Ant
brew install ant
复制代码
第三方库
下载如下第三方库,并将其放入一个文件中,
https://search.maven.org/artifact/org.apache.ant/ant-junitlauncher/1.10.6/jar
https://search.maven.org/artifact/org.junit.jupiter/junit-jupiter-api/5.6.2/jar
https://search.maven.org/artifact/org.junit.jupiter/junit-jupiter-engine/5.6.2/jar
https://search.maven.org/artifact/org.junit.platform/junit-platform-commons/1.6.2/jar
https://search.maven.org/artifact/org.junit.platform/junit-platform-engine/1.6.2/jar
https://search.maven.org/artifact/org.junit.platform/junit-platform-launcher/1.6.2/jar
https://search.maven.org/artifact/org.apiguardian/apiguardian-api/1.1.0/jar
https://search.maven.org/artifact/org.opentest4j/opentest4j/1.2.0/jar
https://search.maven.org/artifact/org.javassist/javassist/3.27.0-GA/bundle
https://search.maven.org/artifact/com.google.protobuf/protobuf-java/3.11.4/bundle
https://search.maven.org/artifact/com.mchange/c3p0/0.9.5.5/jar
https://search.maven.org/artifact/org.slf4j/slf4j-api/1.7.30/jar
https://search.maven.org/artifact/org.hamcrest/hamcrest/2.2/jar
复制代码
Clone jdbc
git clone --branch release/8.0 https://github.com/mysql/mysql-connector-j.git
复制代码
配置 build.properties
这里注意,官网的说法如下,但其实不需要加 path_to
,写成下面的就好
In the directory, create a file named build.properties to indicate to Ant the locations of the root directories for your JDK 1.8.x installation, as well as the location of the extra libraries. The file should contain the following property settings, with the “path_to_*” parts replaced by the appropriate file paths:
com.mysql.cj.build.jdk=jdk_1.8
com.mysql.cj.extra.libs=folder_for_extra_libraries
复制代码
Build
Buildfile: /Users/yuyang/IdeaProjects/mysql-connector-j/build.xml
-extra-libs-check:
[taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
-jdk-check:
-compiler-check:
clean:
[delete] Deleting directory /Users/yuyang/IdeaProjects/mysql-connector-j/build
-load-info-properties:
-init-copy-common:
[mkdir] Created dir: /Users/yuyang/IdeaProjects/mysql-connector-j/build
[copy] Copying 532 files to /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT
-init-filter-license:
-init-no-crypto:
-init-license-headers:
-init-copy:
-init-notices-commercial:
-init-notices-gpl:
[get] Getting: file:./LICENSE
[get] To: /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/LICENSE
[get] ..
[copy] Copying 1 file to /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT
-init-info-files:
[echo] ## INFO_BIN ##
[echo] build-date: 2021-04-26 16:29:27 +0800
[echo] os-info: Mac OS X x86_64 11.2.3
[echo] compiler: javac 1.8.0_251
[echo] build-tool: Apache Ant(TM) version 1.10.10 compiled on April 12 2021
[echo] ## INFO_SRC ##
[echo] version: 8.0.22-SNAPSHOT
[echo] branch: release/8.0
[echo] date: 2020-08-07 22:42:18 +0100
[echo] commit: d64b664fa93e81296a377de031b8123a67e6def2
[echo] short: d64b664f
init:
-clean-output:
compile-driver:
[echo] Compiling MySQL Connector/J JDBC implementation with '/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home' to 'build/mysql-connector-java-8.0.22-SNAPSHOT'
[javac] Compiling 510 source files to /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT
[javac] Creating empty /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/com/mysql/cj/xdevapi/package-info.class
[javac] Creating empty /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/com/mysql/cj/x/protobuf/package-info.class
[java] Applying CommonChecks.
[java] Applying TranslateExceptions.
[java] Applying AddMethods.
-compile-integration-c3p0:
[echo] Compiling MySQL Connector/J-c3p0 integration with '/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home' to 'build/mysql-connector-java-8.0.22-SNAPSHOT'
[javac] Compiling 1 source file to /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT
compile-integration:
compile:
dist:
[mkdir] Created dir: /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/META-INF/services
[copy] Copying 4 files to /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/META-INF
[jar] Building jar: /Users/yuyang/IdeaProjects/mysql-connector-j/build/mysql-connector-java-8.0.22-SNAPSHOT/mysql-connector-java-8.0.22-SNAPSHOT.jar
BUILD SUCCESSFUL
Total time: 17 seconds
复制代码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END