diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index d7416d8..99d2df8 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -10,29 +10,18 @@ on: jobs: check-copyright: - name: Check Copyright runs-on: ubuntu-latest + name: Check Copyright steps: - - uses: actions/checkout@v3 - - - name: Check Copyright - env: - EXTENSIONS: "*.java" - COPYRIGHT_STATEMENT: "/**\n * Copyright IBM Corp. 2025\n */" - run: | - for ext in $EXTENSIONS; do - for file in $(find . -type f -name "$ext" ! -path "cics-java-osgi-jdbc-app/*"); do - if ! grep -q "Copyright" "$file"; then - echo -e "$COPYRIGHT_STATEMENT\n$(cat "$file")" > "$file" - fi - done - done - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 + - uses: actions/checkout@v4 + - id: copyright-action + uses: cicsdev/.github/.github/actions/samples-copyright-checker@139edd8dc23af7f4f7dd9afe4d56a1053fe426a7 with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ github.head_ref }} + directory: './cics-java-osgi-jdbc-app/' + file-extensions: '*.java' + base-copyright: 'Copyright IBM Corp. 2025' + token: ${{ secrets.GITHUB_TOKEN }} + build-mvnw: name: Build Maven Wrapper diff --git a/.gitignore b/.gitignore index 8d5da33..313dbb0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,15 +13,15 @@ buildNumber.properties # Eclipse m2e generated files # Eclipse Core -.project +#.project # JDT-specific (Eclipse Java Development Tools) -.classpath +#.classpath # Eclipse Gradle plugin generated files # Eclipse Core -.project +#.project # JDT-specific (Eclipse Java Development Tools) -.classpath +#.classpath # Java ignores diff --git a/.project b/.project index 847ce13..8739be5 100644 --- a/.project +++ b/.project @@ -1,6 +1,7 @@ - cics-java-osgi-link + cics-java-osgi-jdbc + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..a6b441f --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir=cics-java-osgi-jdbc-app +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0fee6a9 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 74cb544..a3496c1 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -5,4 +5,4 @@ - Phil Wakelin [@PhilWakelin](https://github.com/PhilWakelin) - Aaron Jhaj [@AaronJhaj](https://github.com/AaronJhaj) -*Last reviewed:* December 2024 \ No newline at end of file +*Last reviewed:* April 2025 \ No newline at end of file diff --git a/README.md b/README.md index 9fbd2ee..57f9a32 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,194 @@ -# cics-java-osgi-jdbc -This sample demonstrates an OSGi JDBC application integrated with IBM CICS that can be deployed to a CICS OSGi JVM server. +# Sample: cics-java-osgi-jdbc +[![Build](https://github.com/cicsdev/cics-java-osgi-jdbc/actions/workflows/java.yaml/badge.svg?branch=cicsts/v6.1)](https://github.com/cicsdev/cics-java-osgi-jdbc/actions/workflows/java.yaml) + +This sample demonstrates how to code, build, and deploy a CICS Java OSGi application that makes JDBC calls to Db2. It makes use of the employee sample table supplied with Db2 for z/OS, and allows you to display employee information from the table EMP. -The application makes use of the employee sample table supplied with Db2 for z/OS. The application allows you to display employee information from the table EMP. The sample also provides a set of Gradle and Maven build files for use either in Eclipse or standalone build environments. ## Requirements -* CICS TS V5.5 or later -* A connected CICS DB2CONN resource. For more information, see [Deploying](#deploying) +* CICS TS V6.1 or later +* A connected CICS DB2CONN resource. For more information, see [CONFIGURING](#configuring) * An OSGi JVM server * Java SE 1.8 or later on the workstation * IBM Db2 V11 or later on z/OS -* An Eclipse development environment on the workstation (optional) -* Either Gradle or Apache Maven on the workstation (optional if using Wrappers) + + +## Downloading + +- Clone the repository using your IDEs support, such as the Eclipse Git plugin +- **or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-osgi-jdbc/archive/main.zip) and unzip onto the workstation + +> [!TIP] +> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository. + +--- ## Building -You can build the sample using an IDE of your choice, or you can build it from the command line. For both approaches, using the supplied Gradle or Maven wrappers will give a consistent version of build tooling. -For an IDE, taking Eclipse as an example, the plug-ins for Gradle *buildship* and Maven *m2e* will integrate with the "Run As..." capability, allowing you to specify whether you want to build the project with a Wrapper, or a specific version of your chosen build tool. +The sample includes an Eclipse project configuration, a Gradle build, a Maven POM, and Gradle/Maven Wrappers offering a wide range of build options with the tooling and IDE of your choice. -**Note:** If you import the project to your IDE, you might experience local project compile errors. To resolve these errors you should run a tooling refresh on that project. -For example, in Eclipse: -* for Gradle, right-click on "Project", select "Gradle -> Refresh Gradle Project", -* for Maven, right-click on "Project", select "Maven -> Update Project...". +Choose from the following approach: +* Use the built-in Eclipse and CICS Explorer SDK capability +* Use Eclipse with Buildship (Gradle), or m2e (Maven) to drive Gradle, or Maven. +* Use the command line, or IDE terminal, to drive Gradle or Apache Maven (if installed on your workstation) +* Use the command line, or IDE terminal, or IDE support for Wrappers, to drive the supplied Gradle or Apache Maven Wrappers (with no requirement for Gradle, Maven, Eclipse, or CICS Explorer SDK to be installed) -> Tip: *In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update.* -### Building with Gradle +** Note: ** If you import the project to your IDE, you might experience local project compile errors. To resolve these errors follow the relevant build section below. -A JAR file is created inside the `cics-java-osgi-jdbc-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/build/distributions` directory. -If using the CICS bundle ZIP, the CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-jdbc-bundle/build.gradle](cics-java-osgi-jdbc-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line. +### Option 1 - Building with Eclipse + +The sample comes pre-configured for use with a standard JDK 1.8 and the CICS TS V5.5 Java EE 6/7 Target Platform. When you initially import the project to your IDE, if your IDE is not configured for a JDK 1.8, or does not have CICS Explorer SDK installed with the correct 'target platform' set, you might experience local project compile errors. + +To resolve issues: +* ensure you have the CICS Explorer SDK plug-in installed +* configure the Project's build-path, and Application Project settings to use your preferred JDK and Java compiler settings +* set the CICS TS Target Platform to your intended CICS target (Hint: Window | Preferences | Plug-in Development | Target Platform | Add | Template | Other...) + + +### Option 2 - Building with Gradle + +You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-jdbc-app project. For example, in Eclipse: right-click on "Project", select "Gradle | Refresh Gradle Project". + +The CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-jdbc-bundle/build.gradle](cics-java-osgi-jdbc-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below). + +If you have the Gradle buildship plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-jdbc project to configure and run the `clean` and `build` tasks. Otherwise choose from the command-line approaches. **Gradle Wrapper (Linux/Mac):** ```shell ./gradlew clean build ``` + **Gradle Wrapper (Windows):** ```shell gradle.bat clean build ``` + **Gradle (command-line):** ```shell gradle clean build ``` + **Gradle (command-line & setting jvmserver):** ```shell gradle clean build -Pcics.jvmserver=MYJVM ``` -### Building with Apache Maven +A JAR file is created inside the `cics-java-osgi-jdbc-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/build/distributions` directory. -A JAR file is created inside the `cics-java-osgi-jdbc-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/target` directory. -If building a CICS bundle ZIP the CICS bundle plugin bundle-war goal is driven using the maven verify phase. The CICS JVM server name should be modified in the `` property in the [`pom.xml`](pom.xml) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line. +### Option 3 - Building with Apache Maven + +You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-jdbc-app project. For example, in Eclipse: right-click on "Project", select "Maven -> Update Project...". + +> [!TIP] +> In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle or with the CICS Explorer SDK Java Libraries, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update. + +The CICS JVM server name should be modified in the `` property in the [`pom.xml`](pom.xml) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below). + +If you have the Maven m2e plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-jdbc project to configure and run the `clean` and `verify` tasks. Otherwise choose from the command-line approaches. **Maven Wrapper (Linux/Mac):** ```shell ./mvnw clean verify ``` + **Maven Wrapper (Windows):** ```shell mvnw.cmd clean verify ``` + **Maven (command-line):** ```shell mvn clean verify ``` + **Maven (command-line & setting jvmserver):** ```shell mvn clean verify -Dcics.jvmserver=MYJVM ``` -## Deploying -Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs in the `OSGI_BUNDLES` environment variable and the Db2 library in the `LIBRARY_SUFFIX` environment variable. For more information, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. +A JAR file is created inside the `cics-java-osgi-jdbc-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-jdbc-bundle/target` directory. + +--- -Ensure a CICS DB2CONN is installed and connected. +## Configuring +### Configure CICS for Db2 +To allow your CICS region to connect to DB2, we need to add some configuration to the JCL. -### Deploying using command line tools +``` +// SET DB2=V13 - DB2 Version +... + +... +DB2CONN=YES + +//STEPLIB +... +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOAD +// DD DISP=SHR,DSN=SYS2.DB2.&DB2..SDSNLOD2 +// DD DISP=SHR,DSN=DSN&DB2.P2.RUNLIB.LOAD +``` + +### Configure the JVM Profile +Configure the JVM profile of the OSGi JVM server to include the Db2 driver JARs in the `OSGI_BUNDLES` environment variable and the Db2 library in the `LIBRARY_SUFFIX` environment variable. + +> Note: The name of your JVM profile is assumed to be 'DFHOSGI' + +``` +DB2_PATH=/usr/lpp/db2v13 +OSGI_BUNDLES=&DB2_PATH;/jdbc/classes/db2jcc4.jar,\ + &DB2_PATH;/jdbc/classes/db2jcc_license_cisuz.jar +LIBPATH_SUFFIX=&DB2_PATH;/jdbc/lib +``` +> Note: This example is using db2v13, this version must be consistent to the version set in your JCL. + +As an example, see the provided [JVM profile template](etc/jvmprofiles/DFHOSGI.jvmprofile). If necessary, restart the JVM server. + + +### Option 1 - Configure the DB2CONN with CEDA at a terminal + +Ensure a CICS DB2CONN is installed and connected. + +``` +CEDA DEFINE DB2CONN(JODBCONN) GROUP(CDEVJODB) +``` +``` +CEDA INSTALL DB2CONN(CDEVJODB) GROUP(CDEVJODB) +``` + +### Option 2 - Configure the DB2CONN with CICS Explorer +1. Definitions > Db2 > Db2 Connection Definitions +2. Right-click > New... +3. Fill in the Name and Group with `CDEVJODB` +4. Right-click and install the new definition +5. Ensure it is CONNECTED + +> Note: The DB2ID differs between DB2 versions and the system you are running your CICS region on. Consult your CICS system programmer if you are unsure. + +--- + +## Deploying to CICS +### Option 1 - Deploying using CICS Explorer SDK and the provided CICS bundle project +1. Deploy the CICS bundle project 'com.ibm.cics.server.examples.osgi.jdbc.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the osgi bundlepart and the JODB transaction to run the sample. + + +### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project +1. Copy and paste the built JAR from your *projects/cics-java-osgi-jdbc-app/target* or *projects/cics-java-osgi-jdbc-app/build/libs* directory into a new Eclipse CICS bundle project. +2. Create a new OSGi bundlepart that references the JAR (OSGi bundle) file. +3. Optionally customise the CICS bundle contents, perhaps adding a TRANDEF of your choice +4. Right click using the ** Export Bundle Project to z/OS UNIX File System ** wizard. + + +### Option 3 - Deploying using CICS Explorer (Remote System Explorer) and CICS Bundle ZIP +1. Connect to USS on the host system +2. Create the bundle directory for the project. +3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system into the bundle directory. +4. Extract the ZIP by right-clicking on the ZIP file > User Action > unjar... +5. Refresh the bundle directory + + +### Option 4 - Deploying using command line tools 1. Upload the built CICS bundle ZIP file from your *projects/cics-java-osgi-jdbc-bundle/target* or *projects/cics-java-osgi-jdbc-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP). 2. Connect to USS on the host system (e.g. SSH). 3. Create the bundle directory for the project. @@ -86,40 +199,48 @@ Ensure a CICS DB2CONN is installed and connected. jar xf file.zip ``` -### Deploying using CICS Explorer -1. Copy and paste the built JAR from your *projects/cics-java-osgi-jdbc-app/target* or *projects/cics-java-osgi-jdbc-app/build/libs* directory into a Eclipse CICS bundle project. -2. Create a new OSGi bundlepart that references the JAR file. -3. Deploy the CICS bundle project from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. +--- -### Installing the bundle +## Installing the CICS bundle +### Installing the CICS bundle from a CICS terminal 1. Create a new bundle definition, setting the bundle directory to the deployed bundle directory: ``` - BUNDLE(CDEVJODB) GROUP(CICSDEV) BUNDLEDIR(/path/to/bundle/directory) + BUNDLE(CDEVJODB) GROUP(CDEVJODB) BUNDLEDIR(/path/to/bundle/directory) ``` 2. Install the bundle -## Running + +### Installing the CICS bundle with CICS Explorer +1. Definitions > Bundle Definitions +2. Right-click > New... +3. Fill in the Bundle and Group names as `CDEVJODB` +4. Fill in the Bundle Directory to point to the directory you expanded the ZIP +5. Install the bundle + +--- + +## Running the sample To run the sample, run the transaction `JODB`. The terminal should contain contents similar to the following: ``` -JODB -000001 BILBO BAGGINS 2004.00 -000010 CHRISTINE HAAS 52750.00 -000020 MICHAEL THOMPSON 41250.00 -000030 SAL KWAN 38250.00 -000050 JOHN GEYER 40175.00 -000060 IRVING STERN 32250.00 -000070 EVA PULASKI 36170.00 -000090 EILEEN HENDERSON 29750.00 -000100 THEODORE SPENSER 26150.00 -000110 VINCENZO LUCCHESI 46500.00 -000120 SEAN O'CONNELL 29250.00 -000130 DOLORES QUINTANA 23800.00 -000140 HEATHER NICHOLLS 28420.00 -000150 BRUCE ADAMSON 25280.00 -000160 ELIZABETH PIANKA 22250.00 +JODB +000001 BILBO BAGGINS 2004.00 +000010 CHRISTINE HAAS 90.00 +000020 MICHAEL THOMPSON 41250.00 +000030 SAL KWAN 38250.00 +000050 JOHN GEYER 40175.00 +000060 IRVING STERN 32250.00 +000070 EVA PULASKI 36170.00 +000090 EILEEN HENDERSON 29750.00 +000100 THEODORE SPENSER 26150.00 +000110 VINCENZO LUCCHESI 46500.00 +000111 TES TEST 1000000.00 +000120 SEAN O'CONNELL 29250.00 +000130 DOLORES QUINTANA 23800.00 +000140 HEATHER NICHOLLS 28420.00 +000150 BRUCE ADAMSON 25280.00 ``` The actual contents will be based on the values in the `EMP` table in the database. diff --git a/build.gradle b/build.gradle index baa2e4f..0ad4500 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,11 @@ -allprojects { +allprojects +{ group = 'com.ibm.cicsdev' version = '1.0.0' - repositories { + repositories + { mavenCentral() } } diff --git a/cics-java-osgi-jdbc-app/.classpath b/cics-java-osgi-jdbc-app/.classpath new file mode 100644 index 0000000..69f34c5 --- /dev/null +++ b/cics-java-osgi-jdbc-app/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/cics-java-osgi-jdbc-app/.project b/cics-java-osgi-jdbc-app/.project index 0664f9e..7f54b6a 100644 --- a/cics-java-osgi-jdbc-app/.project +++ b/cics-java-osgi-jdbc-app/.project @@ -1,6 +1,7 @@ cics-java-osgi-jdbc-app + @@ -19,10 +20,21 @@ + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature org.eclipse.buildship.core.gradleprojectnature diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e479558 --- /dev/null +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs index abdea9a..e9441bb 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 encoding/=UTF-8 diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs index dfa4f3a..fa6bcfb 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.apt.core.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=true -org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations -org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations +org.eclipse.jdt.apt.genSrcDir=.apt_generated +org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests +org.eclipse.jdt.apt.reconcileEnabled=true diff --git a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs index 90f7a5b..0fee6a9 100644 --- a/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs +++ b/cics-java-osgi-jdbc-app/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,15 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF b/cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF new file mode 100644 index 0000000..e886fde --- /dev/null +++ b/cics-java-osgi-jdbc-app/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Automatic-Module-Name: com.ibm.cicsdev.java.osgi.jdbc +Bundle-Name: CICS OSGi JDBC application - Application +Bundle-SymbolicName: com.ibm.cicsdev.java.osgi.jdbc +Bundle-Version: 1.0.0 +Import-Package: com.ibm.cics.server;version="[2.0.0,3.0.0)", + com.ibm.cics.server.invocation;version="[1.500.0,2.0.0)", + com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0", + com.ibm.db2.jcc;resolution:=optional +Export-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0" diff --git a/cics-java-osgi-jdbc-app/build.gradle b/cics-java-osgi-jdbc-app/build.gradle index 9feb8e7..1ca7fbe 100644 --- a/cics-java-osgi-jdbc-app/build.gradle +++ b/cics-java-osgi-jdbc-app/build.gradle @@ -1,8 +1,29 @@ -plugins { +plugins +{ id 'java' + id 'eclipse' } -dependencies { + +java +{ + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + + +// If in Eclipse, add Javadoc to the local project classpath +eclipse +{ + classpath + { + downloadJavadoc = true + } +} + + +dependencies +{ annotationProcessor enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:6.1-20220617120000") annotationProcessor 'com.ibm.cics:com.ibm.cics.server.invocation' compileOnly enforcedPlatform("com.ibm.cics:com.ibm.cics.ts.bom:6.1-20220617120000") @@ -11,8 +32,10 @@ dependencies { description = 'CICS OSGi JDBC application - OSGi bundle' -jar { - manifest { - from "src/main/resources/META-INF/MANIFEST.MF" +jar +{ + manifest + { + from "META-INF/MANIFEST.MF" } } diff --git a/cics-java-osgi-jdbc-app/build.properties b/cics-java-osgi-jdbc-app/build.properties new file mode 100644 index 0000000..907a5d5 --- /dev/null +++ b/cics-java-osgi-jdbc-app/build.properties @@ -0,0 +1,5 @@ +bin.includes = META-INF/,\ + . +source.. = src/main/java/ +jre.compilation.profile = JavaSE-1.8 +output.. = bin/ diff --git a/cics-java-osgi-jdbc-app/pom.xml b/cics-java-osgi-jdbc-app/pom.xml index e320da5..f26e972 100644 --- a/cics-java-osgi-jdbc-app/pom.xml +++ b/cics-java-osgi-jdbc-app/pom.xml @@ -22,29 +22,15 @@ - - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - - - com.ibm.cics - com.ibm.cics.server.invocation - 6.1 - - - - + org.apache.maven.plugins maven-jar-plugin 3.3.0 - src/main/resources/META-INF/MANIFEST.MF - + META-INF/MANIFEST.MF + diff --git a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF b/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index a2018b8..0000000 --- a/cics-java-osgi-jdbc-app/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,9 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: CICS OSGi JDBC application - Application -Bundle-SymbolicName: com.ibm.cicsdev.java.osgi.jdbc -Bundle-Version: 1.0.0 -Import-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0", - com.ibm.cics.server;version="[2.0.0,3.0.0)" -Export-Package: com.ibm.cicsdev.java.osgi.jdbc;version="1.0.0" -CICS-MainClass: com.ibm.cicsdev.java.osgi.jdbc.JDBCQueryProgram \ No newline at end of file diff --git a/cics-java-osgi-jdbc-bundle/.project b/cics-java-osgi-jdbc-bundle/.project index 9427369..623ef68 100644 --- a/cics-java-osgi-jdbc-bundle/.project +++ b/cics-java-osgi-jdbc-bundle/.project @@ -1,6 +1,7 @@ cics-java-osgi-jdbc-bundle + diff --git a/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..309cc84 --- /dev/null +++ b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments= +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir=../cics-java-osgi-jdbc-app +eclipse.preferences.version=1 +gradle.user.home= +java.home= +jvm.arguments= +offline.mode=false +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..b196c64 --- /dev/null +++ b/cics-java-osgi-jdbc-bundle/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/cics-java-osgi-jdbc-bundle/build.gradle b/cics-java-osgi-jdbc-bundle/build.gradle index 6ae5b14..f677e82 100644 --- a/cics-java-osgi-jdbc-bundle/build.gradle +++ b/cics-java-osgi-jdbc-bundle/build.gradle @@ -1,13 +1,17 @@ -plugins { +plugins +{ id 'com.ibm.cics.bundle' version "1.0.7" } -dependencies { +dependencies +{ cicsBundlePart project(path: ':cics-java-osgi-jdbc-app', configuration: 'archives') } -cicsBundle { - build { +cicsBundle +{ + build + { defaultJVMServer = project.findProperty("cics.jvmserver") ?: "DFHOSGI" } } diff --git a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction index b4a880b..046cb90 100644 --- a/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction +++ b/cics-java-osgi-jdbc-bundle/src/main/bundleParts/JODB.transaction @@ -1,3 +1,3 @@ - \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.project b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.project new file mode 100644 index 0000000..5c66473 --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.project @@ -0,0 +1,33 @@ + + + com.ibm.cics.server.examples.osgi.jdbc.bundle + + + + + + com.ibm.cics.bundle.ui.bundlebuilder + + + bundleID + com.ibm.cics.server.examples.osgi.jdbc.bundle + + + majorVersion + + + + microVersion + + + + minorVersion + + + + + + + com.ibm.cics.bundle.ui.bundlenature + + diff --git a/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.settings/org.eclipse.core.resources.prefs b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..8356e5a --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//META-INF/cics.xml=UTF-8 +encoding/=UTF-8 +encoding/cics-java-osgi-jdbc-app.osgibundle=UTF-8 diff --git a/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/JODB.transaction b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/JODB.transaction new file mode 100644 index 0000000..ac27b4f --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/JODB.transaction @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/META-INF/cics.xml b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/META-INF/cics.xml new file mode 100644 index 0000000..eac31fd --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/META-INF/cics.xml @@ -0,0 +1,8 @@ + + + + 2016-10-28T13:21:46.339+01:00 + + + + diff --git a/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/cics-java-osgi-jdbc-app.osgibundle b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/cics-java-osgi-jdbc-app.osgibundle new file mode 100644 index 0000000..d5e4f0b --- /dev/null +++ b/etc/eclipse_projects/com.ibm.cics.server.examples.osgi.jdbc.bundle/cics-java-osgi-jdbc-app.osgibundle @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index c7c076f..92d9bd7 100644 --- a/pom.xml +++ b/pom.xml @@ -48,12 +48,33 @@ DFHOSGI - 8 + 1.8 UTF-8 ${java.version} ${java.version} + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + ${maven.compiler.source} + ${maven.compiler.target} + + + com.ibm.cics + com.ibm.cics.server.invocation + 6.1 + + + + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 29cbed0..50986e3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ -rootProject.name = 'cics-java-osgi-link' +rootProject.name = 'cics-java-osgi-jdbc' include(':cics-java-osgi-jdbc-bundle') include(':cics-java-osgi-jdbc-app') \ No newline at end of file