Skip to content

Commit

Permalink
#49 Upgrade Java-Version etc. and extration of maven-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiens12357 authored and BWohlbrecht committed Feb 27, 2023
1 parent a5b8f08 commit 684e6ef
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 1,076 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '14'
java-version: '17'
cache: 'gradle'
- name: clean and build camunda-bpmn-documentation-generator plugin
- name: clean and build camunda-bpmn-documentation-generator
uses: gradle/gradle-build-action@v2
with:
arguments: clean spotlessCheck build buildPluginDescriptor publishToMavenLocal
arguments: clean build publishToMavenLocal
build-root-directory: ./camunda-bpmn-documentation-generator
- name: git checkout maven plugin project
uses: actions/checkout@v2
with:
repository: NovatecConsulting/cbdg-maven-plugin
path: cbdg-maven-plugin
- name: build cbdg-maven-plugin
run: cd ./cbdg-maven-plugin; mvn clean install
- name: git checkout test project
uses: actions/checkout@v2
with:
Expand Down
33 changes: 3 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,12 @@ Hosted via [github pages](https://novatecconsulting.github.io/camunda-bpmn-docum
Please read the [IDE Formatting Configuration](src/docs/config/ide_config.md) to configure your IDE properly for editing
kotlin files.

## The build of plugin description and upload to Maven-Repo
## The build and upload to Maven-Repo

We are creating the maven plugin descriptor with [Maven Plugin Builder Gradle Plugin](https://help.liferay.com/hc/en-us/articles/360018170131-Maven-Plugin-Builder-Gradle-Plugin "Maven Plugin Builder Gradle Plugin")
The follow gradle task generates the maven descriptor into directory *src/main/resources*. The gradle task *build* depends on this task
Creating the Jar-Module with

./gradlew buildPluginDescriptor
./gradlew clean build

Publish to local maven repository for usage in a maven project

./gradlew publishToMavenLocal

## The configuration of the plugin in the POM of target-project

<plugins>
...
<plugin>
<groupId>info.novatec</groupId>
<artifactId>camunda-bpmn-documentation-generator</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- optionaly, executes with install -->
<executions>
<execution>
<id>generate</id>
<phase>install</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>

## Run the goal of the plugin on the target-project

./mw cbdg:generate
55 changes: 22 additions & 33 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,27 @@
plugins {
java
`maven-publish`
id("com.diffplug.spotless") version "5.14.0"
id("com.liferay.maven.plugin.builder") version "1.2.8"
id("org.jetbrains.kotlin.jvm") version "1.5.31"
// id("org.jlleitschuh.gradle.ktlint") version "10.1.0"
id("org.jetbrains.dokka") version "1.7.0"
id("com.diffplug.spotless") version "6.12.0"
id("org.jetbrains.kotlin.jvm") version "1.8.10"
id("org.jlleitschuh.gradle.ktlint") version "11.2.0"
id("org.jetbrains.dokka") version "1.7.20"
}

repositories {
mavenLocal()
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
mavenCentral()
}

group = "info.novatec"
version = "1.0-SNAPSHOT"
version = "2.0-SNAPSHOT"
description = "camunda-bpmn-documentation-generator"
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.sourceCompatibility = JavaVersion.VERSION_17

dependencies {
implementation("org.apache.maven:maven-plugin-api:3.8.4")
implementation("org.apache.maven:maven-core:3.8.4")
implementation("org.camunda.bpm.model:camunda-bpmn-model:7.16.0")
compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.1")
// https://mvnrepository.com/artifact/org.freemarker/freemarker
implementation(group = "org.freemarker", name = "freemarker", version = "2.3.31")
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.0")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testImplementation("org.apache.maven:maven-compat:3.8.4")
testImplementation("org.apache.maven.plugin-testing:maven-plugin-testing-harness:3.3.0")
implementation("org.camunda.bpm.model:camunda-bpmn-model:7.18.0")
compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations:3.7.1")
implementation("org.freemarker:freemarker:2.3.32")
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20")
}

publishing {
Expand All @@ -44,28 +33,28 @@ publishing {
}
}

tasks.named("buildPluginDescriptor") {
setProperty("sourceDir", "src/main/kotlin")
setProperty("classesDir", "build/classes/kotlin/main")
setProperty("goalPrefix", "cbdg")
setProperty("pomArtifactId", project.description)
setProperty("pomVersion", project.version)
tasks.named("build") {
dependsOn("spotlessApply")
}

tasks.named("build") {
dependsOn("buildPluginDescriptor")
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

/*configure<com.diffplug.gradle.spotless.SpotlessExtension> {
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
ktlint("0.38.0")
target("**/*.kt")
ktlint()
}
kotlinGradle {
target("*.gradle.kts")
ktlint()
}
}*/
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
* This file was generated by the Gradle 'init' task.
*/

rootProject.name = "camunda-bpmn-documentation-generator"
File renamed without changes.
79 changes: 0 additions & 79 deletions src/main/kotlin/info/novatec/cbdg/plugin/GenerateMojo.kt

This file was deleted.

This file was deleted.

65 changes: 0 additions & 65 deletions src/main/resources/META-INF/maven/plugin.xml

This file was deleted.

Loading

0 comments on commit 684e6ef

Please sign in to comment.