Skip to content

Commit 4fedd38

Browse files
committed
revert unwanted changes
1 parent 2ecb456 commit 4fedd38

34 files changed

+341
-31
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ buildNumber.properties
1313

1414
# Eclipse m2e generated files
1515
# Eclipse Core
16-
.project
16+
#.project
1717
# JDT-specific (Eclipse Java Development Tools)
18-
.classpath
18+
#.classpath
1919

2020

2121
# Gradle ignores
@@ -37,9 +37,9 @@ gradle-app.setting
3737

3838
# Eclipse Gradle plugin generated files
3939
# Eclipse Core
40-
.project
40+
#.project
4141
# JDT-specific (Eclipse Java Development Tools)
42-
.classpath
42+
#.classpath
4343

4444

4545
# Java ignores
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=cics-java-osgi-link-app
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=false
12+
show.console.view=false
13+
show.executions.view=false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

.settings/org.eclipse.jdt.core.prefs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
12+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
13+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
14+
org.eclipse.jdt.core.compiler.release=disabled
15+
org.eclipse.jdt.core.compiler.source=1.8

README.md

Lines changed: 110 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,167 @@ Demonstrates how OSGi CICS Java programs link to other CICS programs sending a C
1414
* [`ChannelLinkCICSProgram.java`](cics-java-osgi-link-app/src/main/java/com/ibm/cicsdev/java/osgi/link/cicsprogram/ChannelLinkCICSProgram.java) - OSGi `@CICSProgram` defined program linked to with a channel
1515

1616

17+
## Downloading
18+
19+
- Clone the repository using your IDEs support, such as the Eclipse Git plugin
20+
- **or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-osgi-link/archive/cicsts/v5.5.zip) and unzip onto the workstation
21+
22+
> [!TIP]
23+
> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository.
24+
25+
---
26+
1727
## Repository structure
1828
* [`cics-java-osgi-link-app/`](cics-java-osgi-link-app) - Java application source
1929
* [`cics-java-osgi-link-bundle/`](cics-java-osgi-link-bundle/) - Build files for CICS bundle project
20-
* [`etc/`](etc) - Supporting materials
30+
* [`etc/eclipse_projects/`](etc/eclipse_projects) - Static CICS Bundle Project
2131

2232

2333
## Building
24-
The sample can be built using Gradle or Maven to produce an OSGi bundle JAR file and optionally a CICS Bundle archive.
34+
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.
35+
36+
Choose from the following approach:
37+
* Use the built-in Eclipse and CICS Explorer SDK capability
38+
* Use Eclipse with Buildship (Gradle), or m2e (Maven) to drive Gradle, or Maven.
39+
* Use the command line, or IDE terminal, to drive Gradle or Apache Maven (if installed on your workstation)
40+
* 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)
41+
42+
43+
** 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.
44+
45+
46+
### Option 1 - Building with Eclipse
2547

26-
### Building with Gradle
48+
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.
2749

28-
A JAR file will be created in `cics-java-osgi-link-app/build/libs/cics-java-osgi-link-app-1.0.0.jar` and a CICS bundle ZIP file in `cics-java-osgi-link-app/build/distributions/cics-java-osgi-link-bundle-1.0.0.zip`.
50+
To resolve issues:
51+
* ensure you have the CICS Explorer SDK plug-in installed
52+
* configure the Project's build-path, and Application Project settings to use your preferred JDK and Java compiler settings
53+
* set the CICS TS Target Platform to your intended CICS target (Hint: Window | Preferences | Plug-in Development | Target Platform | Add | Template | Other...)
2954

30-
If using the CICS bundle ZIP, the CICS JVM server name for the OSGi bundle part should be modified in the `cics.jvmserver` property in the gradle build properties file to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line.
55+
56+
### Option 2 - Building with Gradle
57+
58+
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-link-app project. For example, in Eclipse: right-click on "Project", select "Gradle | Refresh Gradle Project".
59+
60+
The CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-link-bundle/build.gradle](cics-java-osgi-link-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below).
61+
62+
If you have the Gradle buildship plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-link project to configure and run the `clean` and `build` tasks. Otherwise choose from the command-line approaches.
3163

3264
**Gradle Wrapper (Linux/Mac):**
3365
```shell
3466
./gradlew clean build
3567
```
68+
3669
**Gradle Wrapper (Windows):**
3770
```shell
3871
gradle.bat clean build
3972
```
73+
4074
**Gradle (command-line):**
4175
```shell
4276
gradle clean build
4377
```
78+
4479
**Gradle (command-line & setting jvmserver):**
4580
```shell
4681
gradle clean build -Pcics.jvmserver=MYJVM
4782
```
4883

49-
### Building with Apache Maven
50-
A JAR file will be created in `cics-java-osgi-link-app/target/cics-java-osgi-link-app-1.0.0.jar`. The CICS bundle ZIP file will be stored in `cics-java-osgi-link-bundle/target/cics-java-osgi-link-bundle-1.0.0.zip`.
84+
A JAR file is created inside the `cics-java-osgi-link-app/build/libs/` directory and a CICS bundle ZIP file inside the `cics-java-osgi-link-bundle/build/distributions` directory.
85+
86+
87+
### Option 3 - Building with Apache Maven
5188

52-
If building a CICS bundle ZIP the CICS bundle plugin is driven using the maven verify phase. The CICS JVM server name for the OSGi bundle part should be modified in the `cics.jvmserver` property in the pom.xml to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line.
89+
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-link-app project. For example, in Eclipse: right-click on "Project", select "Maven -> Update Project...".
90+
91+
> [!TIP]
92+
> 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.
93+
94+
The CICS JVM server name should be modified in the `<cics.jvmserver>` 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).
95+
96+
If you have the Maven m2e plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-link project to configure and run the `clean` and `verify` tasks. Otherwise choose from the command-line approaches.
5397

5498
**Maven Wrapper (Linux/Mac):**
5599
```shell
56100
./mvnw clean verify
57101
```
102+
58103
**Maven Wrapper (Windows):**
59104
```shell
60105
mvnw.cmd clean verify
61106
```
107+
62108
**Maven (command-line):**
63109
```shell
64110
mvn clean verify
65111
```
112+
66113
**Maven (command-line & setting jvmserver):**
67114
```shell
68115
mvn clean verify -Dcics.jvmserver=MYJVM
69116
```
70117

118+
A JAR file is created inside the `cics-java-osgi-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-link-bundle/target` directory.
119+
120+
---
121+
71122
## Deploying to CICS
123+
1. Configure an OSGi JVMSERVER.
124+
125+
2. CICS resource definitions for the bundle, programs, transactions and a JVM server are supplied in a group CDEVSAMP as a DFHCSDUP sample input stream supplied in [`DFHCSD.txt`](etc/DFHCSD.txt). Alternatively they can be installed using the bundle parts supplied with the cics-java-osgi-link-bundle project.
126+
Note that the resource definitions for the CICS programs `CDEVMCLC` and `CDEVMCTC` for the Channel sample are not supplied as they will be auto-installed by the processing of @CICSProgram annotation.
127+
128+
129+
### Option 1 - Deploying using CICS Explorer SDK and the provided CICS bundle project
130+
1. Deploy the CICS bundle project 'com.ibm.cics.server.examples.osgi.link.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the osgi bundlepart, the MCLC & MCLM transactions and the CDEVMCLM & CDEVMCTM programs to run the sample.
131+
132+
133+
### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project
134+
1. Copy and paste the built JAR from your *projects/cics-java-osgi-link-app/target* or *projects/cics-java-osgi-link-app/build/libs* directory into a new Eclipse CICS bundle project.
135+
2. Create a new OSGi bundlepart that references the JAR (OSGi bundle) file.
136+
3. Optionally customise the CICS bundle contents, perhaps adding a TRANDEF of your choice
137+
4. Right click using the ** Export Bundle Project to z/OS UNIX File System ** wizard.
138+
139+
140+
### Option 3 - Deploying using CICS Explorer (Remote System Explorer) and CICS Bundle ZIP
141+
1. Connect to USS on the host system
142+
2. Create the bundle directory for the project.
143+
3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-link-bundle/target* or *projects/cics-java-osgi-link-bundle/build/distributions* directory to z/FS on the host system into the bundle directory.
144+
4. Extract the ZIP by right-clicking on the ZIP file > User Action > unjar...
145+
5. Refresh the bundle directory
146+
147+
148+
### Option 4 - Deploying using command line tools
149+
1. Upload the built CICS bundle ZIP file from your *projects/cics-java-osgi-link-bundle/target* or *projects/cics-java-osgi-link-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP).
150+
2. Connect to USS on the host system (e.g. SSH).
151+
3. Create the bundle directory for the project.
152+
4. Move the CICS bundle ZIP file into the bundle directory.
153+
5. Change directory into the bundle directoy.
154+
6. Extract the CICS bundle ZIP file. This can be done using the `jar` command. For example:
155+
```shell
156+
jar xf file.zip
157+
```
158+
159+
---
72160

73-
1. CICS resource definitions for the bundle, programs, transactions and a JVM server are supplied in a group CDEVSAMP as a DFHCSDUP sample input stream supplied in [`DFHCSD.txt`](etc/DFHCSD.txt). Alternatively they can be installed using the bundle parts supplied with the cics-java-osgi-link-bundle project.
74-
Note that the resource definitions for the CICS programs `CDEVMCLC` and `CDEVMCTC` for the Channel sample are not supplied as they will be autoinstalled by the processing of @CICSProgram annotation.
161+
## Installing the CICS bundle
162+
### Installing the CICS bundle from a CICS terminal
163+
1. Create a new bundle definition, setting the bundle directory to the deployed bundle directory:
164+
```
165+
BUNDLE(CDEVCJOL) GROUP(CDEVCJOL) BUNDLEDIR(/path/to/bundle/directory)
166+
```
167+
2. Install the bundle
75168

76-
1. First deploy the CICS bundle project to z/FS.
77-
1. Via CICS explorer "Export to UNIX filesystem".
78-
2. Via the bundle deploy endpoint (create the bundle definition in step 5 first).
79-
3. Via FTP to z/FS, and extract the ZIP file.
80169

81-
1. Update the BUNDLEDIR attribute on the BUNDLE resource to match the zFS location of the deployed CICS bundle project.
170+
### Installing the CICS bundle with CICS Explorer
171+
1. Definitions > Bundle Definitions
172+
2. Right-click > New...
173+
3. Fill in the Bundle and Group names as `CDEVJODB`
174+
4. Fill in the Bundle Directory to point to the directory you expanded the ZIP
175+
5. Install the bundle
82176

83-
1. Install the sample group CDEVCJOL
177+
---
84178

85179

86180
## Running

cics-java-osgi-link-app/.classpath

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src/main/java"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
5+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="src" path=".apt_generated">
7+
<attributes>
8+
<attribute name="optional" value="true"/>
9+
</attributes>
10+
</classpathentry>
11+
<classpathentry kind="output" path="bin/"/>
12+
</classpath>

cics-java-osgi-link-app/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,21 @@
2020
<arguments>
2121
</arguments>
2222
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.ManifestBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>org.eclipse.pde.SchemaBuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
2333
</buildSpec>
2434
<natures>
2535
<nature>org.eclipse.jdt.core.javanature</nature>
2636
<nature>org.eclipse.m2e.core.maven2Nature</nature>
2737
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
38+
<nature>org.eclipse.pde.PluginNature</nature>
2839
</natures>
2940
</projectDescription>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=false
12+
show.console.view=false
13+
show.executions.view=false
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
eclipse.preferences.version=1
22
encoding//src/main/java=UTF-8
3-
encoding//src/main/resources=UTF-8
43
encoding/<project>=UTF-8
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.apt.aptEnabled=true
3-
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
4-
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
3+
org.eclipse.jdt.apt.genSrcDir=.apt_generated
4+
org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests
5+
org.eclipse.jdt.apt.reconcileEnabled=true
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
24
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
36
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
411
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5-
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6-
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7-
org.eclipse.jdt.core.compiler.processAnnotations=enabled
8-
org.eclipse.jdt.core.compiler.release=enabled
9-
org.eclipse.jdt.core.compiler.source=1.8
12+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
13+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
14+
org.eclipse.jdt.core.compiler.release=disabled
15+
org.eclipse.jdt.core.compiler.source=1.8

cics-java-osgi-link-app/build.gradle

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11

22
plugins {
33
id 'java'
4+
id 'eclipse'
5+
}
6+
7+
java
8+
{
9+
sourceCompatibility = JavaVersion.VERSION_1_8
10+
targetCompatibility = JavaVersion.VERSION_1_8
11+
}
12+
13+
14+
// If in Eclipse, add Javadoc to the local project classpath
15+
eclipse
16+
{
17+
classpath
18+
{
19+
downloadJavadoc = true
20+
}
421
}
522

623
dependencies {
@@ -12,6 +29,6 @@ description = 'CICS OSGi link application'
1229

1330
jar {
1431
manifest {
15-
from 'src/main/resources/META-INF/MANIFEST.MF'
32+
from 'META-INF/MANIFEST.MF'
1633
}
1734
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin.includes = META-INF/,\
2+
.
3+
source.. = src/main/java/
4+
jre.compilation.profile = JavaSE-1.8
5+
output.. = bin/

cics-java-osgi-link-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<version>3.3.0</version>
3434
<configuration>
3535
<archive>
36-
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
36+
<manifestFile>META-INF/MANIFEST.MF</manifestFile>
3737
</archive>
3838
</configuration>
3939
</plugin>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=../cics-java-osgi-link-app
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=false
12+
show.console.view=false
13+
show.executions.view=false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false

0 commit comments

Comments
 (0)