Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 11 additions & 28 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ on:
- cron: '0 0 * * *'

jobs:
build-maven:
name: Build Maven
build-mvnw:
name: Build Maven Wrapper

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
jdk: [8, 11]
experimental: [false]
include:
- jdk: 17
experimental: true
jdk: [8, 11, 17, 21]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
Expand All @@ -30,28 +25,16 @@ jobs:
distribution: "semeru"
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} package
- run: |
mkdir staging
cp cics-java-osgi-jdbc-app/target/*.jar staging
cp cics-java-osgi-jdbc-bundle/target/*.zip staging
- uses: actions/upload-artifact@v4
with:
name: cics-java-osgi-jdbc (Maven, Java ${{ matrix.jdk }})
path: staging
run: ./mvnw --batch-mode --update-snapshots --file pom.xml -Djava.version=${{ matrix.jdk }} verify


build-gradlew:
name: Build Gradle Wrapper

build-gradle:
name: Build Gradle

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
jdk: [8, 11]
experimental: [false]
include:
- jdk: 17
experimental: true
jdk: [8, 11, 17, 21]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
Expand All @@ -61,6 +44,6 @@ jobs:
distribution: 'semeru'
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 7.6
gradle-version: 8.6
- name: Build with Gradle
run: gradle build -Pjava_version=${{ matrix.jdk }}
run: ./gradlew clean build -Pjava_version=${{ matrix.jdk }}
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
8 changes: 8 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Maintainers

- Ivan D. Hargreaves [@IvanHargreaves](https://github.com/IvanHargreaves)
- Alex Brown [@AlexBrown](https://github.com/SoftlySplinter)
- Phil Wakelin [@PhilWakelin](https://github.com/PhilWakelin)
- Aaron Jhaj [@AaronJhaj](https://github.com/AaronJhaj)

*Last reviewed:* December 2024
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ On the command line, you simply swap the Gradle or Maven command for the wrapper

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 required build-tasks are typically `clean assemble` for Gradle and `clean package` for Maven. Once run, Gradle will generate a JAR file in the `build/libs` directory, while Maven will generate it in the `target` directory.
The required build-tasks are typically `clean build` for Gradle and `clean verify` for Maven. Once run, Gradle will generate a JAR file in the `build/libs` directory, while Maven will generate it in the `target` directory.

**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:
Expand All @@ -34,12 +34,12 @@ Run the following in a local command prompt:
On Linux or Mac:

```shell
./gradlew clean assemble
./gradlew clean build
```
On Windows:

```shell
gradlew.bat clean assemble
gradlew.bat clean build
```

This creates a JAR file in the `build/libs` directory.
Expand All @@ -50,13 +50,13 @@ Run the following in a local command prompt:
On Linux or Mac:

```shell
./mvnw clean package
./mvnw clean verify
```

On Windows:

```shell
mvnw.cmd clean package
mvnw.cmd clean verify
```

This creates a JAR file in the `target` directory.
Expand Down
14 changes: 14 additions & 0 deletions cics-java-osgi-jdbc-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>com.ibm.cics</groupId>
<artifactId>com.ibm.cics.server.invocation</artifactId>
<version>6.1</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ 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="[1.700.0,2.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
4 changes: 2 additions & 2 deletions cics-java-osgi-jdbc-bundle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.ibm.cics.bundle' version "1.0.5"
id 'com.ibm.cics.bundle' version "1.0.7"
}

dependencies {
Expand All @@ -8,7 +8,7 @@ dependencies {

cicsBundle {
build {
defaultJVMServer = "DFHOSGI"
defaultJVMServer = project.findProperty("cics.jvmserver") ?: "DFHOSGI"
}
}

Expand Down
5 changes: 5 additions & 0 deletions cics-java-osgi-jdbc-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<plugin>
<groupId>com.ibm.cics</groupId>
<artifactId>cics-bundle-maven-plugin</artifactId>
<version>1.0.7</version>
<extensions>true</extensions>
<configuration>
<defaultjvmserver>${cics.jvmserver}</defaultjvmserver>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading