ihub-java
...About 2 min
ihub-java
plugin description
ihub-java
plugin for integrating Java related plugin environment, configuration some default dependencies, and compatibility configuration
Information | Description |
---|---|
Plugin ID | pub.ihub.plugin.ihub-java |
Plugin Name | Java Plugin |
Plugin Type | Project [^Project] |
Extension Name | iHubJava |
Plugin Dependencies | ihub-bom,java,java-library,lombok,project-report,build-dashboard, net. ytebuddy.byte-buddy-gradle-plugin,org.springdoc.openapi-gradle-plugin |
Note
启用JMoleculesPlugin
插件时,org.gradle.parallel
设置false
,可以消除prepareKotlinBuildScriptModel
任务警告
Extended Properties
Extension | Description | Default | Ext[^Ext] | Prj[^Prj] | Sys[^Sys] | Env[^Env] |
---|---|---|---|---|---|---|
Default Dependencies | Default dependency (',' separated)Seefor details, set upfalse to close the default configuration | log | ✔ | ✔ | ❌ | ❌ |
CompileEncoding | JavaScript Code | UTF-8 | ✔ | ✔ | ❌ | ❌ |
sourceCompatibility | Java Source 兼容性配置 | ❌ | ✔ | ✔ | ❌ | ❌ |
targetCompatibility | Java Target 兼容性配置 | ❌ | ✔ | ✔ | ❌ | ❌ |
gradleCompile cremental | gradle increment compilation | true | ✔ | ✔ | ❌ | ❌ |
compilerArgs | Compiles extended attributes, multiple parameters separated by spaces, e.g.:- parameters -Xlint:unchecked | ❌ | ✔ | ✔ | ❌ | ❌ |
jvmArgs | JVM extension attributes, multiple arguments separated by spaces, e.g.:- XX:+UseG1GC -Xms128m -Xmx512m | ❌ | ✔ | ✔ | ❌ | ❌ |
jmoleculesArchitecture | JMolecules Architecture (optional type:cqrs, layered, onion)See | monion | ✔ | ✔ | ❌ | ❌ |
Warning
Since plugins will process some configuration atbeforEvalate
, root items will not handle this stage,Ext
[^Ext]configuration may lapse, priority is recommendedPrj
[^Prj]configuration
Plugin Installation
Kotlin
plugins {
id("pub.ihub.plugin.ihub-java")
}
Groovy
plugins {
id 'pub.ihub.plugin.ihub-java'
}
Configuration Example
Kotlin
iHubJava has
defaultDependencies.set("jaxb,log,doc,map,jmolecules")
compatibility.set("11")
}
Groovy
iHubJava has
defaultDependencies = 'jaxb,log,doc,map,jmolecules'
compatibility = '11'
}
Default Dependencies
jaxb
:Depends on configuration when adding jaxb runs.
DependencyType | Dependencies |
---|---|
Exclude | com.sun.xml.bind:jaxb-core |
runtimeOnly | javax.xml.bind:jaxb-api |
runtimeOnly | org.glassfish.jaxb:jaxb-runtime |
log
:add default log dependency configuration.
DependencyType | Dependencies |
---|---|
Exclude | commons-logging: commons-logging |
Exclude | log4j:log4j |
Exclude | org.apache.logging.log4j:log4j-core |
Exclude | org.slf4j:slf4j-log4j12 |
Exclude | org.slf4j: slf4j-jcl |
runtimeOnly | org.slf4j:jul-to-slf4j |
runtimeOnly | org.slf4j:log4j-over-slf4j |
runtimeOnly | org.slf4j:jcl-over-slf4j |
Implementation | org.slf4j: slf4j-api |
mapstruct
:add new MapStruct dependency configuration.
DependencyType | Dependencies |
---|---|
Implementation | org.mapstruct:mapstruct |
annotationProcessor | org.mapstruct:mapstruct-processor |
doc
:add docannotation dependence.
DependencyType | Dependencies |
---|---|
Compilation Only | io.swagger.core.v3:swagger-announcements |
annotationProcessor | pub.ihub.lib:ihub-process-doc |
jmolecules
:add jMolecules dependency.
DependencyType | Dependencies |
---|---|
Implementation | org.jmolecules:jmolecules-dd |
Implementation | org.jmolecules:jmolecules-events |
Implementation | org.jmolecules:jmolecules-cqrs-archive (optional ) |
implementation | org.jmolecules:jmolecules-layered-archive (option ) |
implementation | org.jmolecules:jmolecules-onion-archive (optional ) |
jmolecules-integrations
:add jMolecules-integration dependence.
DependencyType | Dependencies |
---|---|
implementation | org.jmolecules.integrations: jmolecules-spring |
implementation | org.jmolecules.integrations: jmolecules-jpa |
Implementation | org.jmolecules.integrations: jmolecules-jackson |
testImplementation | org.jmolecules.integrations: jmolecules-archive |
Default configuration
Since the Lombok plugin 6.1.0 does not auto-generatelobok.config
fileSee,when there is no lobok.configthe following configuration will be generated automatically:
config.stopBubbling = true
lobok.addLombokGeneratedAnnotation = true
Configure Jar Properties
Properties | Value |
---|---|
Implementation - Title | {project.name} |
Automatic-Module-Name | {project.name} |
Implementation-Version | {project.version} |
Implementation-Vendor-Id | {project.group} |
Created-By | Java + Current Java Main Version |
Generate configuration below:
Manifest-Version: 1.0
Implementation-Title: ihub-plugins
Automatic-Module-Name: ihub.plugins
Implementation-Version: 1.0.0
Implementation-Vendor-Id: pub.ihub.plugin
Created-By: Java 11
compatibility配置兼容性。
可以通过Optional feature configuration
registerFeature
:supports configuration options,See
Field | Dependencies |
---|---|
Feature | Function |
Capabilities | Capabilities |
Configuration Example
Kotlin
iHubJava {
registerFeature("servlet", "cloud-support", "servlet-support")
registerFeature("reactor", "cloud-support", "reactor-support")
}
dependencies {
"servletApi"("org.springframework.boot:spring-boot-starter-web")
"reactorApi"("org.springframework.boot:spring-boot-starter-webflux")
}
Groovy
iHubJava has
registerFeature 'servlet', 'cloud-support', 'servlet-support'
registerFeature 'reactor', 'cloud-support', 'reactor-support'
}
dependagencies have {
servletApi 'org.springframe.boot: spring-boot-starter-web'
reactorApi 'org.springframe.boot: spring-boot-boot-starter-webinflux'
}