Gradle init scripts provides an easy and effective way to manage or add dependencies to a customized PHPJavaBridge server.
The init-scripts folder contains ready-made init-scripts for some popular libraries like JasperReports, CoreNLP, POI, PDFBox... that can also be used as example for creating your own deps scripts.
If dependencies can also be managed in the main build.grade file, the
init-scripts
way allows to control the build (or multiple builds) from the command line without altering you main configuration (important if you fork the project).
Add the -I
(--init-script) parameter followed by the init script filename to the ./gradlew
command.
As an example, you can call the war
task to generate a build with both jasperreports
and mysql-connector
like:
$ ./gradlew war -I init-scripts/init.jasperreports.gradle -I init-scripts/init.mysql.gradle
The newly builded war file present in the build/libs
folder will now contains your dependencies
in its WEB-INF/lib
internal directory.
Here's a list of some example libraries ready to use when you ./gradlew
Type | File | Description |
---|---|---|
Common | ./init.guava.gradle | Guava Google core libraries for Java |
./init.itext.gradle | IText low level library to generate PDF | |
./init.pdfbox.gradle | PDFBox Java tool for working with PDF documents. | |
DOC/XLS | ./init.poi.gradle | Apache POI Java API for Microsoft Documents. |
REPORT | ./init.jasperreports.gradle | JasperReports to generate PDF/XLS/HTML... reports |
HTMLParser | ./init.jsoup.gradle | Jsoup Java HTML Parser, with best of DOM, CSS, and jquery |
HTML2PDF | ./init.flyingsaucer.gradle | FlyingSaucer XML/XHTML and CSS 2.1 renderer in pure Java |
JDBC | ./init.mysql.gradle | MySQL JDBC connector |
JDBC | ./init.mariadb.gradle | MariaDB JDBC connector |
JDBC | ./init.postgresql.gradle | PostgreSQL JDBC connector |
JSON | ./init.gson.gradle | GSON Json serializer |
JSON | ./init.json-io.gradle | Json-io Json serializer |
NLP | ./init.opennlp.gradle | OpenNLP natural language processing |
NLP | ./init.corenlp.gradle | Standford CoreNLP - POSTagger, NER, ... |
NLP | ./init.corenlp-models.gradle | Standford CoreNLP Trained core models - 400Mb |
Languages specific models to train languages with Standford CoreNLP
Type | File | Description |
---|---|---|
NLPModel | ./init.corenlp-models-english.gradle | Standford CoreNLP Trained models for English - 900Mb + 500M (KBP) |
NLPModel | ./init.corenlp-models-german.gradle | Standford CoreNLP Trained models for German - 130Mb |
NLPModel | ./init.corenlp-models-french.gradle | Standford CoreNLP Trained models for French - 130Mb |
NLPModel | ./init.corenlp-models-spanish.gradle | Standford CoreNLP Trained models for Spanish - 200Mb |
NLPModel | ./init.corenlp-models-chinese.gradle | Standford CoreNLP Trained models for Chinese - 800Mb |