diff --git a/NOTICE.md b/NOTICE.md index 862a7991f0..1f66e07a26 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -95,7 +95,7 @@ KineticJS, v4.7.1 * Project: http://www.kineticjs.com, https://github.com/ericdrowell/KineticJS * Copyright: Eric Rowell -org.objectweb.asm Version 9.6 +org.objectweb.asm Version 9.7 * License: Modified BSD (https://asm.ow2.io/license.html) * Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved. diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java index d1f86a6a2e..23ea980c84 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/AnnotationWriter.java @@ -144,7 +144,7 @@ static AnnotationWriter create( // Write type_index and reserve space for num_element_value_pairs. annotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); return new AnnotationWriter( - symbolTable, /* useNamedValues = */ true, annotation, previousAnnotation); + symbolTable, /* useNamedValues= */ true, annotation, previousAnnotation); } /** @@ -179,7 +179,7 @@ static AnnotationWriter create( // Write type_index and reserve space for num_element_value_pairs. typeAnnotation.putShort(symbolTable.addConstantUtf8(descriptor)).putShort(0); return new AnnotationWriter( - symbolTable, /* useNamedValues = */ true, typeAnnotation, previousAnnotation); + symbolTable, /* useNamedValues= */ true, typeAnnotation, previousAnnotation); } // ----------------------------------------------------------------------------------------------- @@ -284,7 +284,7 @@ public AnnotationVisitor visitAnnotation(final String name, final String descrip } // Write tag and type_index, and reserve 2 bytes for num_element_value_pairs. annotation.put12('@', symbolTable.addConstantUtf8(descriptor)).putShort(0); - return new AnnotationWriter(symbolTable, /* useNamedValues = */ true, annotation, null); + return new AnnotationWriter(symbolTable, /* useNamedValues= */ true, annotation, null); } @Override @@ -303,7 +303,7 @@ public AnnotationVisitor visitArray(final String name) { // visit the array elements. Its num_element_value_pairs will correspond to the number of array // elements and will be stored in what is in fact num_values. annotation.put12('[', 0); - return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, annotation, null); + return new AnnotationWriter(symbolTable, /* useNamedValues= */ false, annotation, null); } @Override diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java index 820a3b84bc..a2bdae3e1e 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassReader.java @@ -177,7 +177,7 @@ public ClassReader( final byte[] classFileBuffer, final int classFileOffset, final int classFileLength) { // NOPMD(UnusedFormalParameter) used for backward compatibility. - this(classFileBuffer, classFileOffset, /* checkClassVersion = */ true); + this(classFileBuffer, classFileOffset, /* checkClassVersion= */ true); } /** @@ -195,7 +195,7 @@ public ClassReader( this.b = classFileBuffer; // Check the class' major_version. This field is after the magic and minor_version fields, which // use 4 and 2 bytes respectively. - if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V22) { + if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V23) { throw new IllegalArgumentException( "Unsupported class file major version " + readShort(classFileOffset + 6)); } @@ -607,9 +607,9 @@ public void accept( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true), + classVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -625,9 +625,9 @@ public void accept( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - classVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false), + classVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -649,9 +649,9 @@ public void accept( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -673,9 +673,9 @@ public void accept( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -967,9 +967,9 @@ private int readRecordComponent( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true), + recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -985,9 +985,9 @@ private int readRecordComponent( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false), + recordComponentVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1009,9 +1009,9 @@ private int readRecordComponent( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1033,9 +1033,9 @@ private int readRecordComponent( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1151,9 +1151,9 @@ private int readField( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true), + fieldVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1169,9 +1169,9 @@ private int readField( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - fieldVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false), + fieldVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1193,9 +1193,9 @@ private int readField( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1217,9 +1217,9 @@ private int readField( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1412,9 +1412,9 @@ private int readMethod( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ true), + methodVisitor.visitAnnotation(annotationDescriptor, /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1430,9 +1430,9 @@ private int readMethod( // Parse num_element_value_pairs and element_value_pairs and visit these values. currentAnnotationOffset = readElementValues( - methodVisitor.visitAnnotation(annotationDescriptor, /* visible = */ false), + methodVisitor.visitAnnotation(annotationDescriptor, /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1454,9 +1454,9 @@ private int readMethod( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1478,9 +1478,9 @@ private int readMethod( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -1488,16 +1488,13 @@ private int readMethod( // Visit the RuntimeVisibleParameterAnnotations attribute. if (runtimeVisibleParameterAnnotationsOffset != 0) { readParameterAnnotations( - methodVisitor, context, runtimeVisibleParameterAnnotationsOffset, /* visible = */ true); + methodVisitor, context, runtimeVisibleParameterAnnotationsOffset, /* visible= */ true); } // Visit the RuntimeInvisibleParameterAnnotations attribute. if (runtimeInvisibleParameterAnnotationsOffset != 0) { readParameterAnnotations( - methodVisitor, - context, - runtimeInvisibleParameterAnnotationsOffset, - /* visible = */ false); + methodVisitor, context, runtimeInvisibleParameterAnnotationsOffset, /* visible= */ false); } // Visit the non standard attributes. @@ -1926,7 +1923,7 @@ private void readCode( } } else if (Constants.RUNTIME_VISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) { visibleTypeAnnotationOffsets = - readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ true); + readTypeAnnotations(methodVisitor, context, currentOffset, /* visible= */ true); // Here we do not extract the labels corresponding to the attribute content. This would // require a full parsing of the attribute, which would need to be repeated when parsing // the bytecode instructions (see below). Instead, the content of the attribute is read one @@ -1935,7 +1932,7 @@ private void readCode( // time. This assumes that type annotations are ordered by increasing bytecode offset. } else if (Constants.RUNTIME_INVISIBLE_TYPE_ANNOTATIONS.equals(attributeName)) { invisibleTypeAnnotationOffsets = - readTypeAnnotations(methodVisitor, context, currentOffset, /* visible = */ false); + readTypeAnnotations(methodVisitor, context, currentOffset, /* visible= */ false); // Same comment as above for the RuntimeVisibleTypeAnnotations attribute. } else if (Constants.STACK_MAP_TABLE.equals(attributeName)) { if ((context.parsingOptions & SKIP_FRAMES) == 0) { @@ -2517,9 +2514,9 @@ private void readCode( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } currentVisibleTypeAnnotationBytecodeOffset = @@ -2545,9 +2542,9 @@ private void readCode( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentAnnotationOffset, - /* named = */ true, + /* named= */ true, charBuffer); } currentInvisibleTypeAnnotationBytecodeOffset = @@ -2618,9 +2615,9 @@ private void readCode( context.currentLocalVariableAnnotationRangeEnds, context.currentLocalVariableAnnotationRangeIndices, annotationDescriptor, - /* visible = */ true), + /* visible= */ true), currentOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -2646,9 +2643,9 @@ private void readCode( context.currentLocalVariableAnnotationRangeEnds, context.currentLocalVariableAnnotationRangeIndices, annotationDescriptor, - /* visible = */ false), + /* visible= */ false), currentOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -2821,7 +2818,7 @@ private int[] readTypeAnnotations( methodVisitor.visitTryCatchAnnotation( targetType & 0xFFFFFF00, path, annotationDescriptor, visible), currentOffset, - /* named = */ true, + /* named= */ true, charBuffer); } else { // We don't want to visit the other target_type annotations, so we just skip them (which @@ -2832,7 +2829,7 @@ private int[] readTypeAnnotations( // with a null AnnotationVisitor). currentOffset = readElementValues( - /* annotationVisitor = */ null, currentOffset, /* named = */ true, charBuffer); + /* annotationVisitor= */ null, currentOffset, /* named= */ true, charBuffer); } } return typeAnnotationsOffsets; @@ -2972,7 +2969,7 @@ private void readParameterAnnotations( readElementValues( methodVisitor.visitParameterAnnotation(i, annotationDescriptor, visible), currentOffset, - /* named = */ true, + /* named= */ true, charBuffer); } } @@ -3042,9 +3039,9 @@ private int readElementValue( case 'e': // enum_const_value return currentOffset + 5; case '@': // annotation_value - return readElementValues(null, currentOffset + 3, /* named = */ true, charBuffer); + return readElementValues(null, currentOffset + 3, /* named= */ true, charBuffer); case '[': // array_value - return readElementValues(null, currentOffset + 1, /* named = */ false, charBuffer); + return readElementValues(null, currentOffset + 1, /* named= */ false, charBuffer); default: return currentOffset + 3; } @@ -3112,7 +3109,7 @@ private int readElementValue( return readElementValues( annotationVisitor.visitArray(elementName), currentOffset - 2, - /* named = */ false, + /* named= */ false, charBuffer); } switch (classFileBuffer[currentOffset] & 0xFF) { @@ -3189,7 +3186,7 @@ private int readElementValue( readElementValues( annotationVisitor.visitArray(elementName), currentOffset - 2, - /* named = */ false, + /* named= */ false, charBuffer); break; } diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java index 75881882ea..0af80ce0e6 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/ClassWriter.java @@ -774,7 +774,7 @@ private byte[] replaceAsmInstructions(final byte[] classFile, final boolean hasF lastRecordComponent = null; firstAttribute = null; compute = hasFrames ? MethodWriter.COMPUTE_INSERTED_FRAMES : MethodWriter.COMPUTE_NOTHING; - new ClassReader(classFile, 0, /* checkClassVersion = */ false) + new ClassReader(classFile, 0, /* checkClassVersion= */ false) .accept( this, attributes, diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java index 918bd717c6..bccc99717a 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/MethodWriter.java @@ -651,7 +651,7 @@ public void visitParameter(final String name, final int access) { @Override public AnnotationVisitor visitAnnotationDefault() { defaultValue = new ByteVector(); - return new AnnotationWriter(symbolTable, /* useNamedValues = */ false, defaultValue, null); + return new AnnotationWriter(symbolTable, /* useNamedValues= */ false, defaultValue, null); } @Override diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java index 4256afae68..f796c9430b 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/Opcodes.java @@ -288,6 +288,7 @@ public interface Opcodes { int V20 = 0 << 16 | 64; int V21 = 0 << 16 | 65; int V22 = 0 << 16 | 66; + int V23 = 0 << 16 | 67; /** * Version flag indicating that the class is using 'preview' features. diff --git a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java index dc601a16b9..9ceffb1c5b 100644 --- a/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java +++ b/core-server/src/main/java/jersey/repackaged/org/objectweb/asm/SymbolTable.java @@ -1414,23 +1414,23 @@ private static final class Entry extends Symbol { } Entry(final int index, final int tag, final String value, final int hashCode) { - super(index, tag, /* owner = */ null, /* name = */ null, value, /* data = */ 0); + super(index, tag, /* owner= */ null, /* name= */ null, value, /* data= */ 0); this.hashCode = hashCode; } Entry(final int index, final int tag, final String value, final long data, final int hashCode) { - super(index, tag, /* owner = */ null, /* name = */ null, value, data); + super(index, tag, /* owner= */ null, /* name= */ null, value, data); this.hashCode = hashCode; } Entry( final int index, final int tag, final String name, final String value, final int hashCode) { - super(index, tag, /* owner = */ null, name, value, /* data = */ 0); + super(index, tag, /* owner= */ null, name, value, /* data= */ 0); this.hashCode = hashCode; } Entry(final int index, final int tag, final long data, final int hashCode) { - super(index, tag, /* owner = */ null, /* name = */ null, /* value = */ null, data); + super(index, tag, /* owner= */ null, /* name= */ null, /* value= */ null, data); this.hashCode = hashCode; } } diff --git a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java index 7e9db27d3d..f5384f8c6c 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/internal/scanning/AnnotationAcceptingListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -309,7 +309,7 @@ private Class getClassForName(final String className) { private static class ClassReaderWrapper { private static final Logger LOGGER = Logger.getLogger(ClassReader.class.getName()); - private static final int WARN_VERSION = Opcodes.V22; + private static final int WARN_VERSION = Opcodes.V23; private static final int INPUT_STREAM_DATA_CHUNK_SIZE = 4096; private final byte[] b; diff --git a/core-server/src/main/resources/META-INF/NOTICE.markdown b/core-server/src/main/resources/META-INF/NOTICE.markdown index 92d64be4ec..27c798d82b 100644 --- a/core-server/src/main/resources/META-INF/NOTICE.markdown +++ b/core-server/src/main/resources/META-INF/NOTICE.markdown @@ -36,7 +36,7 @@ org.glassfish.jersey.server.internal.monitoring.core * Copyright (c) 2015-2018 Oracle and/or its affiliates. All rights reserved. * Copyright 2010-2013 Coda Hale and Yammer, Inc. -org.objectweb.asm Version 9.6 +org.objectweb.asm Version 9.7 * License: Modified BSD (https://asm.ow2.io/license.html) * Copyright: (c) 2000-2011 INRIA, France Telecom. All rights reserved. diff --git a/etc/scripts/TCK/EE10/jakarta-ee10-tck.sh b/etc/scripts/TCK/EE10/jakarta-ee10-tck.sh new file mode 100644 index 0000000000..75dd07cd73 --- /dev/null +++ b/etc/scripts/TCK/EE10/jakarta-ee10-tck.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for listing staging from the staging repo. +# +# Input Parameters: +# JERSEY_VERSION - type: String +# - example: 3.1.5 +# - description: version of Jersey (EE10) to be tested +# GLASSFISH_VERSION - type: String +# - example: 7.0.6 +# - description: version of GF (EE10) to be used within tests +# TCK_VERSION - type: String +# - example: 3.1.3 +# - description: version of a TCK bundle which will be downloaded from the staging/central +# Configuration: +# +# JDK: +# openjdk-jdk11-latest +# Git: +# https://github.com/eclipse-ee4j/jersey +# Branch: +# */3.1 +# +# + +# +# The first sh invocation +# +#!/bin/bash -xe + +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +mvn -f tests/jersey-tck/pom.xml clean install \ + -Dtck.version=${TCK_VERSION} \ + -Dglassfish.container.version=${GLASSFISH_VERSION} \ + -Djersey.version=${JERSEY_VERSION} | tee tck.log + + +# +# The second sh invocation +# +#!/bin/bash -xe + +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +mvn -f tests/jersey-tck/pom.xml dependency:copy -Dartifact=jakarta.ws.rs:jakarta-restful-ws-tck:${TCK_VERSION} -Dtck.version=${TCK_VERSION} -Dtransitive=false +export DOWNLOAD_PATH='tests/jersey-tck/target/dependency/' +export NAME=`ls ${DOWNLOAD_PATH}` + +echo '***********************************************************************************' >> SUMMARY.TXT +echo '*** TCK bundle information ***' >> SUMMARY.TXT +echo "*** Name: ${NAME} ***" >> SUMMARY.TXT +echo '*** Artifact ID: jakarta.ws.rs:jakarta-restful-ws-tck:'${TCK_VERSION}' ***' >> SUMMARY.TXT +echo '*** Date and size: '`stat -c "date: %y, size(b): %s" ${DOWNLOAD_PATH}/${NAME}`' ***' >> SUMMARY.TXT +echo '*** SHA256SUM: '`sha256sum ${DOWNLOAD_PATH}/${NAME} | awk '{print $1}'`' ***' >> SUMMARY.TXT +echo '*** ***' >> SUMMARY.TXT +echo '***********************************************************************************' >> SUMMARY.TXT +echo '*** TCK results summary ***' >> SUMMARY.TXT +export TESTS_RUN=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Tests run: [0-9]*' | awk '{ SUM += $3 } END { print SUM }'` +export FAILURES=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Failures: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'` +export ERRORS=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Errors: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'` +export SKIPPED=`grep 'Skipped: [0-9]*$' tck.log | grep -o 'Skipped: [0-9]*' | awk '{ SUM += $2 } END { print SUM }'` +echo '[INFO] Number of Tests Passed = '${TESTS_RUN} >> SUMMARY.TXT +echo '[INFO] Number of Tests Failed = '${FAILURES} >> SUMMARY.TXT +echo '[INFO] Number of Tests with Errors = '${ERRORS} >> SUMMARY.TXT +echo '[INFO] Number of Skipped Tests = '${SKIPPED} >> SUMMARY.TXT +echo '[INFO] ****************************************************************************' >> SUMMARY.TXT +grep 'Tests run:' tck.log | grep --invert-match 'Skipped: [0-9]*$' >> SUMMARY.TXT + + +# +# Archive the artifacts: +# tck.log,tests/jersey-tck/target/glassfish7/glassfish/domains/domain1/logs/server.log,tests/jersey-tck/pom.xml,SUMMARY.TXT +# \ No newline at end of file diff --git a/etc/scripts/TCK/EE8/jersey-staging-GF-integration.sh b/etc/scripts/TCK/EE8/jersey-staging-GF-integration.sh new file mode 100644 index 0000000000..92c43c0406 --- /dev/null +++ b/etc/scripts/TCK/EE8/jersey-staging-GF-integration.sh @@ -0,0 +1,106 @@ +#!/bin/bash -ex +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for Jersey EE8 integration into Glassfish 5. +# +# Input Parameters: +# GF_URL - type: String +# - value: http://central.maven.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip +# - description: actual URL of the Glassfish 5 +# MAVEN_REPO_URL - type: String +# - value: https://jakarta.oss.sonatype.org/content/groups/staging/org/glassfish/jersey +# - description: Jersey binaries location +# JERSEY_VERSION - type: String +# - value: 2.42 +# - description: the version of Jersey to be integrated into the GF +# JERSEY_JARS - type: Multi-line String +# - value: containers/glassfish/jersey-gf-ejb/${JERSEY_VERSION}/jersey-gf-ejb +# containers/jersey-container-grizzly2-http/${JERSEY_VERSION}/jersey-container-grizzly2-http +# containers/jersey-container-servlet/${JERSEY_VERSION}/jersey-container-servlet +# containers/jersey-container-servlet-core/${JERSEY_VERSION}/jersey-container-servlet-core +# core/jersey-client/${JERSEY_VERSION}/jersey-client +# core/jersey-common/${JERSEY_VERSION}/jersey-common +# core/jersey-server/${JERSEY_VERSION}/jersey-server +# ext/jersey-bean-validation/${JERSEY_VERSION}/jersey-bean-validation +# ext/cdi/jersey-cdi1x/${JERSEY_VERSION}/jersey-cdi1x +# ext/cdi/jersey-cdi1x-servlet/${JERSEY_VERSION}/jersey-cdi1x-servlet +# ext/cdi/jersey-cdi1x-transaction/${JERSEY_VERSION}/jersey-cdi1x-transaction +# ext/jersey-entity-filtering/${JERSEY_VERSION}/jersey-entity-filtering +# ext/jersey-mvc/${JERSEY_VERSION}/jersey-mvc +# ext/jersey-mvc-jsp/${JERSEY_VERSION}/jersey-mvc-jsp +# inject/jersey-hk2/${JERSEY_VERSION}/jersey-hk2 +# media/jersey-media-jaxb/${JERSEY_VERSION}/jersey-media-jaxb +# media/jersey-media-json-binding/${JERSEY_VERSION}/jersey-media-json-binding +# media/jersey-media-json-jackson/${JERSEY_VERSION}/jersey-media-json-jackson +# media/jersey-media-json-jettison/${JERSEY_VERSION}/jersey-media-json-jettison +# media/jersey-media-json-processing/${JERSEY_VERSION}/jersey-media-json-processing +# media/jersey-media-moxy/${JERSEY_VERSION}/jersey-media-moxy +# media/jersey-media-multipart/${JERSEY_VERSION}/jersey-media-multipart +# media/jersey-media-sse/${JERSEY_VERSION}/jersey-media-sse +# - description: List of binaries to be integrated into the GF 5 +# +# +# Configuration: +# +# JDK: +# (System) +# Git: +# ------none------ +# +# Copy artifacts from another project: +# JAXRS_build +# Latest successful build +# Artifacts to copy: +# **/*.jar +# Target directory: +# download +# [X] Flatten directories [X] Fingerprint Artifacts +# +# +# +ls +cd download +wget -q ${GF_URL} -O glassfish.zip +#wget -q ${JAX_RS_JAR} -O jakarta.ws.rs-api.jar + +while IFS= read -r line ; do wget -q ${MAVEN_REPO_URL}/$line-${JERSEY_VERSION}.jar; done <<< "${JERSEY_JARS}" + +echo Listing grabbed jars +ls *.jar + +#unzip +unzip -q glassfish.zip -d ${WORKSPACE} +cd ${WORKSPACE}/glassfish5/glassfish/modules + +#replace API jar +#cp -v ${WORKSPACE}/download/jakarta.ws.rs-api.jar . + +#replace Jersey Jar +for jarfile in ${WORKSPACE}/download/*.jar; do + echo $(basename $jarfile) | sed -e 's/-RC[0-9][0-9]*//' | sed -e 's/-SNAPSHOT//' | sed -e 's/\.[0-9][0-9]*//' | sed -e 's/\.[0-9][0-9]*//' | sed -e 's/-[0-9][0-9]*//' | while IFS= read -r gfnamejar ; do if [ -f $gfnamejar ]; then rm -v $gfnamejar; cp -v $jarfile $gfnamejar; fi; done; +done + +cd ${WORKSPACE} +zip -r glassfish.zip glassfish5 + + +# +# Archive the artifacts: +# glassfish.zip +# +# diff --git a/etc/scripts/TCK/EE8/tck-build.sh b/etc/scripts/TCK/EE8/tck-build.sh new file mode 100644 index 0000000000..40a9cb1484 --- /dev/null +++ b/etc/scripts/TCK/EE8/tck-build.sh @@ -0,0 +1,163 @@ +#!/bin/bash -ex +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for building EE8 TCK bundle for Jersey. +# +# Input Parameters: +# GF_URL - type: String +# - value: https://search.maven.org/remotecontent?filepath=org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip +# - description: actual URL of the Glassfish 5 +# +# Configuration: +# +# JDK: +# oracle-jdk8-latest +# Git: +# https://github.com/eclipse-ee4j/jakartaee-tck.git +# Branch: +# */master +# Check out to a sub-directory: +# CTS +# +# [X] With Ant: +# apache-ant-latest +# JDK: +# oracle-jdk8-latest +# +# Copy artifacts from another project: +# ts_jte_alter +# Latest successful build +# Artifacts to copy: +# ts.jte +# Target directory: +# download +# [X] Flatten directories [X] Fingerprint Artifacts +# +# +# + +mkdir ${WORKSPACE}/CTS/tools +mkdir ${WORKSPACE}/CTS/tools/ant + +#create zip command +#mkdir batch +#touch ${WORKSPACE}/batch/zip.sh +#chmod +x ${WORKSPACE}/batch/zip.sh +#touch ${WORKSPACE}/batch/zip +#chmod +x ${WORKSPACE}/batch/zip +#alias zip='${WORKSPACE}/batch/zip.sh' + +#echo "echo ARG1=\$1">batch/zip.sh +#echo "echo ARG2=\$2">>batch/zip.sh +#echo "echo ARG3=\$3">>batch/zip.sh +#echo "if [ \$1='-T' ]; then">>batch/zip.sh +#echo " exit">>batch/zip.sh +#echo "fi">>batch/zip.sh +#echo "filename=\`echo \$2 | cut -d'.' -f 1,2\`">>batch/zip.sh +#echo "echo filename=\$filename">>batch/zip.sh +#echo "tar -zcvf '\${filename}'.tar.gz \$3">>batch/zip.sh +#echo "mv \${filename}.tar.gz \${filename}.zip">>batch/zip.sh +#echo "echo created \${filename}.zip">>batch/zip.sh + +#echo "${WORKSPACE}/batch/zip.sh \$*">batch/zip + +#cat batch/zip.sh +#cat batch/zip + + +#Set variables +export ANT_OPTS=-Djavax.xml.accessExternalSchema=all + +cd download +#wget -4 https://jenkins.eclipse.org/jersey/view/TCK/job/ts_jte_alter/lastSuccessfulBuild/artifact/ts.jte + +#wget -q https://ci.adoptopenjdk.net/view/Build%20Monitor/job/jtharness/lastSuccessfulBuild/artifact/jtharness.tar.gz -O jtharness.tar.gz +#wget -q https://ci.adoptopenjdk.net/view/Build%20Monitor/job/sigtest/lastSuccessfulBuild/artifact/sigtest.tar.gz -O sigtest.tar.gz +#wget -q http://central.maven.org/maven2/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar -O jaxb-xjc.jar +#wget -q http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar -O ant-contrib.jar +#wget -q http://central.maven.org/maven2/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar +#wget -q http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar +#wget -q http://central.maven.org/maven2/commons-codec/commons-codec/1.3/commons-codec-1.3.jar +#tar xfz jtharness.tar.gz +#tar xvfz sigtest.tar.gz +#unzip -q sigtest-4.0 +#cp -av ${WORKSPACE}/download/sigtest-4.0/lib/. ${WORKSPACE}/CTS/lib/ +#cp -v ${WORKSPACE}/download/jtharness/lib/javatest.jar ${WORKSPACE}/CTS/lib/javatest.jar +#cp -v ${WORKSPACE}/download/jaxb-xjc.jar ${WORKSPACE}/CTS/lib/ +#cp -v ${WORKSPACE}/download/ant-contrib.jar ${WORKSPACE}/CTS/lib/ +#cp -v ${WORKSPACE}/download/ant-contrib.jar ${WORKSPACE}/CTS/lib/ant-contrib-1.0b3.jar +#cp -v ${WORKSPACE}/download/commons-httpclient-3.1.jar ${WORKSPACE}/CTS/lib/ +#cp -v ${WORKSPACE}/download/commons-logging-1.1.1.jar ${WORKSPACE}/CTS/lib/ +#cp -v ${WORKSPACE}/download/commons-codec-1.3.jar ${WORKSPACE}/CTS/lib/ + + +ls + +yes | cp -vr ${WORKSPACE}/download/ts.jte ${WORKSPACE}/CTS/install/jaxrs/bin/ +#cp -v ${WORKSPACE}/download/ts.jte ${WORKSPACE}/CTS/bin/ts.jte + +wget -q ${GF_URL} -O glassfish.zip +unzip -q glassfish.zip -d ${WORKSPACE} + +#COMPILE TCK + +export TS_HOME=${WORKSPACE}/CTS +export deliverabledir=jaxrs +export javaee_home=${WORKSPACE}/glassfish5 + +#touch ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/api = servlet >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/api/rs/ext/interceptor = standalone >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/ee = standalone >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/jaxrs21 = standalone >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/jaxrs21/api = servlet >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/spec = standalone >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/servlet3 = standalone >> ${WORKSPACE}/CTS/vehicle.properties +#echo com/sun/ts/tests/jaxrs/platform = standalone >> ${WORKSPACE}/CTS/vehicle.properties + +#cat ${WORKSPACE}/CTS/vehicle.properties + +#fix the test +cd ${WORKSPACE}/CTS/src/com/sun/ts/tests/jaxrs/jaxrs21/ee/sse/sseeventsink +sed -i '314s/open()/register(holder::add)/' JAXRSClient.java +sed -i '315s/register(holder::add)/open()/' JAXRSClient.java +#end of fix + +cd ${WORKSPACE}/CTS/install/${deliverabledir}/bin +ant build.all +ant update.jaxrs.wars + +# BUNDLE TCK + +cd ${WORKSPACE}/CTS/release/tools/ +ant jakartaee-jaxrs +#ls ${WORKSPACE}/CTS/release/JAXRS_BUILD/ +cd ${WORKSPACE}/CTS/release/JAXRS_BUILD/latest +for fn in `ls *.zip`; do cp -v "${fn}" `echo ${fn} | cut -d'_' -f 1`_latest.zip; done + +#zip -s 10m jaxrstck_split_latest.zip jaxrstck-2.1_latest.zip +#ls + + + +# +# Archive the artifacts: +# CTS/release/JAXRS_BUILD/latest/*.z* +# +# + diff --git a/etc/scripts/TCK/EE8/tck-run-pipeline.groovy b/etc/scripts/TCK/EE8/tck-run-pipeline.groovy new file mode 100644 index 0000000000..95936f14a6 --- /dev/null +++ b/etc/scripts/TCK/EE8/tck-run-pipeline.groovy @@ -0,0 +1,150 @@ +#!/usr/bin/env groovy + +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Runs TCK for Jersey EE8 on GlassFish 5 + * + * Input Parameters: + * + * GF_INTEGRATION_JOB_NAME - type: String + * - value: Jersey_Staging_GF_Integration + * - description: name of a job from which the prepared archive of the Glassfish 5 is taken + * - possible values: Jersey_binaries_GF_integration + * Jersey_Staging_GF_Integration + * GF5_Jersey2_Archive_Integration + * TS_JTE_JOB_NAME - type: String + * - value: ts_jte_alter + * - description: name of a job from which prepared ts.jte is taken + * TCK_BUNDLE_JOB_OR_URL - type: String + * - value: tck_build + * - description: name of a job from which prepared TCK bundle is taken + */ + +node { + + // Job that created the API artifact + def GF_BUILD_JOB = "${env.GF_INTEGRATION_JOB_NAME}" + def TS_JTE_BUILD_JOB = "${env.TS_JTE_JOB_NAME}" + def TCK_BUNDLE_URL = "${env.TCK_BUNDLE_JOB_OR_URL}" + def API_JAR_NAME="jakarta.ws.rs-api.jar" + + echo "GF_BUILD_JOB=${GF_BUILD_JOB}" + echo "TS_JTE_BUILD_JOB=${TS_JTE_BUILD_JOB}" + echo "TCK_BUNDLE_URL=${TCK_BUNDLE_URL}" + + //TCK properties + env.deliverabledir="jaxrs" + env.tck_root="restful-ws-tck" + env.TS_HOME="${env.WORKSPACE}/${env.tck_root}" + env.javaee_home="${env.WORKSPACE}/glassfish5" + + env.JAVA_HOME= tool name: 'oracle-jdk8-latest', type: 'jdk' + env.ANT_HOME= tool name: 'apache-ant-latest', type: 'ant' + env.PATH="${ANT_HOME}/bin:${JAVA_HOME}/bin:${PATH}" + env.ANT_OPTS="-Djavax.xml.accessExternalSchema=all" + + stage("Grab GF and ts.jte artifacts") { + //https://go.cloudbees.com/docs/cloudbees-documentation/cjoc-user-guide/index.html#cluster-copy-artifacts + dir ("download") { + copyArtifacts(projectName: "${GF_BUILD_JOB}") + copyArtifacts(projectName: "${TS_JTE_BUILD_JOB}") + } + } + + stage("Grab TCK bundle") { + env.TCK_BUNDLE_URL = "${TCK_BUNDLE_URL}" + if (!(env.TCK_BUNDLE_URL).startsWith("http")) { + dir ("download") { + copyArtifacts(projectName: "${TCK_BUNDLE_URL}", filter: "**/*_latest.zip") + //flatten - could be done by copyRemoteArtifacts but mapper arg expects java class + sh "find . -mindepth 2 -type f -print -exec mv {} . \\;" + + //sh "rm *doc*.zip" + sh "mv ${deliverabledir}-tck*.zip ${deliverabledir}-tck.zip" + } + } else { + sh '''#!/bin/bash -ex + cd ${WORKSPACE}/download + wget -q ${TCK_BUNDLE_URL} -O ${deliverabledir}-tck.zip + ''' + } + } + + stage("Unzip TCK and GF") { + sh '''#!/bin/bash -ex + cd ${WORKSPACE} + unzip ${WORKSPACE}/download/glassfish.zip + unzip -q ${WORKSPACE}/download/${deliverabledir}-tck.zip + ls + ls ${tck_root} + + cd ${WORKSPACE}/glassfish5/glassfish/modules + jar xf jersey-common.jar META-INF/MANIFEST.MF + cat META-INF/MANIFEST.MF | grep Bundle-Version + ''' + } + + stage ("Replace ts.jte") { + sh '''#!/bin/bash -ex + ls ${TS_HOME} + ls ${TS_HOME}/bin + yes | cp -rfv ${WORKSPACE}/download/ts.jte ${TS_HOME}/bin/ts.jte + ''' + } + + stage("Configure TCK") { + sh '''#!/bin/bash -ex + cd ${TS_HOME}/bin + ant config.vi + ''' + } + + stage ("Deploy TCK tests") { + sh '''#!/bin/bash -ex + cd ${TS_HOME}/bin + ant deploy.all + ''' + } + + stage ("Run TCK tests") { + sh '''#!/bin/bash -ex + cd ${TS_HOME}/bin + ant run.all | tee run.log + ''' + } + + stage ("Create summary.txt, API, and run.log artifacts") { + sh '''#!/bin/bash -ex + cd ${TS_HOME}/bin + cat run.log | sed -e '1,/Completed running/d' > summary.txt + PASSED_COUNT=`head -1 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'` + FAILED_COUNT=`head -2 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'` + ERROR_COUNT=`head -3 summary.txt | tail -1 | sed 's/.*=\\s\\(.*\\)/\\1/'` + + echo ERROR_COUNT=${ERROR_COUNT} + echo FAILED_COUNT=${FAILED_COUNT} + echo PASSED_COUNT=${PASSED_COUNT} + ''' + + archiveArtifacts artifacts: "${env.tck_root}/bin/summary.txt", fingerprint: true + archiveArtifacts artifacts: "${env.tck_root}/bin/run.log", fingerprint: true + archiveArtifacts artifacts: "glassfish5/glassfish/modules/${API_JAR_NAME}", fingerprint: true + archiveArtifacts artifacts: "glassfish5/glassfish/modules/META-INF/MANIFEST.MF", fingerprint: true + archiveArtifacts artifacts: "glassfish5/glassfish/domains/domain1/logs/server.log", fingerprint: true + } +} \ No newline at end of file diff --git a/etc/scripts/TCK/EE8/ts-jte-alter.sh b/etc/scripts/TCK/EE8/ts-jte-alter.sh new file mode 100644 index 0000000000..27d908afa0 --- /dev/null +++ b/etc/scripts/TCK/EE8/ts-jte-alter.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for generating ts.jte for EE8 Jersey TCK. +# +# Input Parameters: +# +# SERVER_HOME - type: String +# - value: ${ts.home}/../glassfish5/glassfish +# JAXRS_API_JAR_NAME - type: String +# - value: jakarta.ws.rs-api.jar +# HARNESS_REPORT_DIR - type: String +# - value: ${ts.home}/../JTreport +# HARNESS_WORK_DIR - type: String +# - value: ${ts.home}/../JTwork +# +# Configuration: +# +# JDK: +# (System) +# Git: +# ----none---- +# +# + +wget https://raw.githubusercontent.com/eclipse-ee4j/jakartaee-tck/master/install/jaxrs/bin/ts.jte + +JARS_ON_CP="\ +\${web.home}/modules/jersey-client.jar:\ +\${web.home}/modules/jersey-common.jar:\ +\${web.home}/modules/jersey-container-servlet.jar:\ +\${web.home}/modules/jersey-container-servlet-core.jar:\ +\${web.home}/modules/jersey-hk2.jar:\ +\${web.home}/modules/jersey-media-jaxb.jar:\ +\${web.home}/modules/jersey-media-json-binding.jar:\ +\${web.home}/modules/jersey-media-json-processing.jar:\ +\${web.home}/modules/jersey-media-sse.jar:\ +\${web.home}/modules/jersey-server.jar:\ +\${web.home}/modules/jsonp-jaxrs.jar:\ +\${web.home}/modules/asm-all-repackaged.jar:\ +\${web.home}/modules/bean-validator.jar:\ +\${web.home}/modules/endorsed/jakarta.annotation-api.jar:\ +\${web.home}/modules/cdi-api.jar:\ +\${web.home}/modules/cglib.jar:\ +\${web.home}/modules/hk2-api.jar:\ +\${web.home}/modules/hk2-locator.jar:\ +\${web.home}/modules/hk2-utils.jar:\ +\${web.home}/modules/javassist.jar:\ +\${web.home}/modules/jakarta.ejb-api.jar:\ +\${web.home}/modules/jakarta.inject.jar:\ +\${web.home}/modules/jakarta.json.jar:\ +\${web.home}/modules/jakarta.json-api.jar:\ +\${web.home}/modules/jakarta.json.bind-api.jar:\ +\${web.home}/modules/jakarta.interceptor-api.jar:\ +\${web.home}/modules/jakarta.servlet-api.jar:\ +\${web.home}/modules/osgi-resource-locator.jar:\ +\${web.home}/modules/weld-osgi-bundle.jar:\ +\${web.home}/modules/yasson.jar" + +sed -i 's/^impl\.vi=/impl\.vi=glassfish/g' ts.jte +sed -i "s/^web\.home=/$(echo web\.home=${SERVER_HOME} | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^impl\.vi\.deploy\.dir=/$(echo impl\.vi\.deploy\.dir=\${web.home}/domains/domain1/autodeploy | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i 's/^jaxrs_impl_name=/jaxrs_impl_name=jersey/g' ts.jte +sed -i 's/^harness\.log\.traceflag=/harness\.log\.traceflag=true/g' ts.jte +sed -i 's/^webServerHost=/webServerHost=localhost/g' ts.jte +sed -i 's/^webServerPort=/webServerPort=8080/g' ts.jte +sed -i "s/^work\.dir=\/tmp\/JTwork/$(echo work\.dir=${HARNESS_WORK_DIR} | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^report\.dir=\/tmp\/JTreport/$(echo report\.dir=${HARNESS_REPORT_DIR} | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^jaxrs_impl\.classes=/$(echo jaxrs_impl\.classes=${JARS_ON_CP} | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^jaxrs\.classes=/$(echo jaxrs\.classes=\${web.home}/modules/${JAXRS_API_JAR_NAME} | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^jaxrs_impl_lib=/$(echo jaxrs_impl_lib=\${web.home}/modules/jersey-container-servlet-core.jar | sed -e 's/\\/\\\\/g; s/\//\\\//g;')/g" ts.jte +sed -i "s/^servlet_adaptor=/servlet_adaptor=org\/glassfish\/jersey\/servlet\/ServletContainer.class/g" ts.jte + +sed -i "s/-Dcts.tmp=\.*/-Djavax.xml.accessExternalSchema=all -Dcts.tmp=/g" ts.jte + + +# +# Archive the artifacts: +# ts.jte \ No newline at end of file diff --git a/etc/scripts/release/EE10/bundle-apidocs.sh b/etc/scripts/release/EE10/bundle-apidocs.sh new file mode 100644 index 0000000000..089a1a901a --- /dev/null +++ b/etc/scripts/release/EE10/bundle-apidocs.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing api docs bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 3.1.6 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk17-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Branches to build: +# tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + +#!/bin/bash -xe + +# Execution environment +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +echo '-[ Run maven release plugin ]---------------------------------------------------' + +mvn -q -V -C -DstagingDescription="org.glassfish.jersey.bundles.apidocs:${VERSION}" \ + -Pstaging,oss-release,pre-release -DskipTests -pl :apidocs \ + -Djersey.version=${VERSION} -Dsource.mvn.plugin.version=3.2.0 install javadoc:jar gpg:sign deploy \ No newline at end of file diff --git a/etc/scripts/release/EE10/bundle-examples.sh b/etc/scripts/release/EE10/bundle-examples.sh new file mode 100644 index 0000000000..c49fa1cded --- /dev/null +++ b/etc/scripts/release/EE10/bundle-examples.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing examples bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 3.1.6 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk11-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Branches to build: +# tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + + + # Execution environment + MVN_HOME="/opt/tools/apache-maven/latest/" + PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + + mvn clean install -C -B -Djersey.version=${VERSION} -DskipTests -Ppre-release,staging -pl org.glassfish.jersey.examples:project -amd + + mvn -C -B -DstagingDescription="org.glassfish.jersey.examples:${VERSION}" \ + -Pstaging,oss-release,pre-release \ + -Djersey.version=${VERSION} -DskipTests -pl :jersey-examples \ + deploy \ No newline at end of file diff --git a/etc/scripts/release/EE10/bundle-user-guide.sh b/etc/scripts/release/EE10/bundle-user-guide.sh new file mode 100644 index 0000000000..8890a79004 --- /dev/null +++ b/etc/scripts/release/EE10/bundle-user-guide.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing User Guide bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 3.1.6 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk11-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Credentials: +# GitHub bot SSH +# Branches to build: +# refs/tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + +#!/bin/bash -xe + +# Execution environment +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +cd docs + +echo '-[ Run maven release plugin ]---------------------------------------------------' + +mvn -q -C -DstagingDescription="org.glassfish.jersey.jersey-documentation:${VERSION}" \ + -Pstaging,oss-release,pre-release \ + -DskipTests \ + install javadoc:jar gpg:sign deploy \ No newline at end of file diff --git a/etc/scripts/release/EE10/release.groovy b/etc/scripts/release/EE10/release.groovy new file mode 100644 index 0000000000..ad2f1678d2 --- /dev/null +++ b/etc/scripts/release/EE10/release.groovy @@ -0,0 +1,333 @@ +#!/usr/bin/env groovy + +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Release script for Jakarta EE10 Jersey versions + * Release branch is 3.1 + * + * Input Parameters: + * RELEASE_VERSION - type: String + * - example: 3.1.6 + * - Description: mandatory release version. Later is being published to staging/central. + * NEXT_VERSION - type: String + * - example: 3.1.99-SNAPSHOT + * - Description: mandatory next developing version will be committed in to the release branch and later + * merged into the original release branch for further developing. + * BRANCH - type: Choice Parameter + * - values: 3.1 + * - Description: Original release branch from which the codebase is being checked out + * DRY_RUN - type: Boolean + * - Description: if checked nothing is really committed to Git nor published to the staging + * OVERWRITE - type: Boolean + * - Description: if checked allows replacing of the previously published RELEASE_VERSION of Jersey + * + */ + +#!/usr/bin/env groovy + +node { + + def MVN_HOME = tool name: 'apache-maven-latest', type: 'maven' + def HELP_PLUGIN = 'org.apache.maven.plugins:maven-help-plugin:2.1.1' + def TARGET = 'package javadoc:jar gpg:sign install:install' + def DEPLOY_TARGET = '' + def RELEASE_VERSION = RELEASE_VERSION + def NEXT_VERSION = NEXT_VERSION + def RELEASE_TAG = '' + def NEW_RELEASE_BRANCH = '' + def OVERWRITE = OVERWRITE + def PROJECT_NAME = 'Jersey' + def LOGIN = 'jersey-bot' + def EMAIL = 'jersey-bot@eclipse.org' + def REPO = 'git@github.com:eclipse-ee4j/jersey.git' + def SECRET_FILE_ID = 'secret-subkeys.asc' + def CREDENTIALS_ID = 'github-bot-ssh' + def GIT_ORIGIN = 'origin' + def RELEASE_FOLDER = env.WORKSPACE + def RELEASE_BRANCH = BRANCH + + def STAGING_NAME_PATTERN = 'orgglassfishjersey-[0-9]+' + def STAGING_NAME = '' + def STAGING_PREV_NAME = '' + def STAGING_OPEN_NAME = '' + def STAGING_DESC = 'org.glassfish.jersey:' + RELEASE_VERSION + def STAGING_BOM_DESC = 'org.glassfish.jersey.bom:' + RELEASE_VERSION + def STAGING_PROFILE_ID = '70fa3a107a8918' + + def MULTIRELEASE_MODULES = ':jersey-wadl-doclet,:jersey-spring6,:jersey-helidon-connector,:jersey-jetty-connector,:jersey-jetty-http2-connector,:jersey-container-jetty-http,:jersey-container-jetty-http2,:jersey-test-framework-provider-jetty,:jersey-test-framework-provider-jetty-http2' + + def JDK_11_HOME = tool name: 'openjdk-jdk11-latest', type: 'jdk' + //def JDK_12_HOME = tool name: 'openjdk-jdk12-latest', type: 'jdk' + def JDK_21_HOME = tool name: 'openjdk-jdk21-latest', type: 'jdk' + //def JDK_8_HOME = tool name: 'oracle-jdk8-latest', type: 'jdk' + + env.JAVA_HOME = JDK_11_HOME + env.PATH = "${env.JAVA_HOME}/bin:${env.PATH}:${MVN_HOME}/bin" + + sh 'java -version' + + stage('Fetch from git') { + git(branch: RELEASE_BRANCH, credentialsId: CREDENTIALS_ID, url: REPO) + } + stage('Prepare environment') { + + dir(RELEASE_FOLDER) { + //# Check whether top level pom.xml contains SNAPSHOT version + if (!sh(returnStdout: true, script: "grep '' pom.xml | grep 'SNAPSHOT'")?.trim()) { + error('-[ Missing SNAPSHOT version in POM! ]-------------------------------------------') + } + + //# Compute release versions + def SNAPSHOT_VERSION = sh(returnStdout: true, script: 'mvn -q -Dexec.executable="echo" -Dexec.args=\'${project.version}\' --non-recursive exec:exec -Pstaging').trim() + + if (!RELEASE_VERSION?.trim()) { + if (!SNAPSHOT_VERSION?.trim()) { + error('-[ Missing required snapshot version number! ]----------------------------------') + } else { + def versionTokens = SNAPSHOT_VERSION.split('-') + RELEASE_VERSION = versionTokens[0] + } + } + + if (!NEXT_VERSION?.trim()) { + def (MAJOR_VERSION, MINOR_VERSION) = RELEASE_VERSION.tokenize('.') + def NEXT_MINOR_VERSION = (MINOR_VERSION as Integer) + 1 + NEXT_VERSION = MAJOR_VERSION + '.' + NEXT_MINOR_VERSION + '-SNAPSHOT' + } + + RELEASE_TAG = RELEASE_VERSION + NEW_RELEASE_BRANCH = RELEASE_VERSION+'-BRANCH' + + echo "Current version: ${SNAPSHOT_VERSION}" + echo "Release version: ${RELEASE_VERSION}" + echo "Next version: ${NEXT_VERSION}" + echo "Release tag: ${RELEASE_TAG}" + echo "Release branch: ${NEW_RELEASE_BRANCH}" + + if (!SNAPSHOT_VERSION?.trim() || !RELEASE_VERSION?.trim() || !NEXT_VERSION?.trim()) { + error '-[ Missing required version numbers! ]------------------------------------------' + } + + if (DRY_RUN == 'true') { + echo '-[ Dry run turned on ]----------------------------------------------------------' + //TARGET = 'install' + } else { + DEPLOY_TARGET = ' deploy:deploy' + } + echo '-[ Configure git user ]--------------------------------------------------------' + sh "git config --local user.email \"${EMAIL}\"" + sh "git config --local user.name \"$LOGIN\"" + + } + + } + stage('Prepare GPG') { + withCredentials([file(credentialsId: SECRET_FILE_ID, variable: 'KEYRING')]) { + //# Workaround: GPG initialization + sh("gpg --batch --import ${KEYRING}") + sh ''' + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + ''' + } + } + stage('Prepare branch') { + echo '-[ Prepare branch ]-------------------------------------------------------------' + + echo '-[ Switching to release branch ]-------------------------------------------------' + sh """ + git checkout ${GIT_ORIGIN}/${RELEASE_BRANCH} && true + git reset --hard ${GIT_ORIGIN}/${RELEASE_BRANCH} && true + git checkout -B ${NEW_RELEASE_BRANCH} + """ + echo '-[ Release tag cleanup ]--------------------------------------------------------' + def TAG_NAME = sh(returnStdout: true, script: "git tag | grep ${RELEASE_TAG}\$ || true").trim() + if (RELEASE_TAG == TAG_NAME) { + if (OVERWRITE == 'true') { + echo "${RELEASE_TAG} tag already exists, deleting" + sshagent([CREDENTIALS_ID]) { + sh "git push --delete origin ${RELEASE_TAG} && true" + } + } else { + error "${RELEASE_TAG} tag already exists" + } + //# Always delete local tag if exists + sh """ + git tag --delete ${RELEASE_TAG} && true + """ + } + sh ''' + sed -i 's|||g' etc/config/checkstyle-suppressions.xml + ''' + } + stage('Check previous stagings') { + if (DRY_RUN == 'true') { + echo DRY_RUN + ' ------' + } else { + if (OVERWRITE == 'true') { + STAGING_PREV_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/\\[INFO] $STAGING_NAME_PATTERN[ ]+CLOSED[ ]+$STAGING_DESC[ ]*\$/ {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'").trim() + echo 'Previously closed staging name: ' + STAGING_PREV_NAME + } + + STAGING_OPEN_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/$STAGING_NAME_PATTERN OPEN / {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'").trim() + + if (!STAGING_OPEN_NAME?.trim()) { + echo 'No currently open stagings' + } else { + echo 'Currently open redundand staging: ' + STAGING_OPEN_NAME + ', immediately closing' + sh """ + OPEN_STAGINGS=${STAGING_OPEN_NAME} + mvn -B -q -Pstaging nexus-staging:rc-drop -DstagingRepositoryId=\${OPEN_STAGINGS} + """ + } + } + } + /* + stage('Open new staging') { + if (DRY_RUN == 'true') { + echo DRY_RUN + ' ------' + } else { + STAGING_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging -DstagingProfileId=${STAGING_PROFILE_ID} -DstagingDescription=${STAGING_DESC} nexus-staging:rc-open | awk '/\\[INFO] Opened / {print \$3}'").trim() + echo 'New staging name: '+STAGING_NAME + } + }*/ + stage("Build ${PROJECT_NAME}") { + echo env.JAVA_HOME + echo '-[ Run maven release ]---------------------------------------------------------' + echo '-[ Set Release version ]-------------------------------------------------------' + sh """ + cd ${RELEASE_FOLDER} + mvn -q -B -V -Pstaging versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false + mvn -q -B -V -Pstaging versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false -f bom/pom.xml + """ + echo '-[ Update Copyright years ]----------------------------------------------------' + sh '''#!/bin/bash -e + + export CURRENT_YEAR=`date '+%Y'` + export SED_CMD_LINE='sed -i "s#, 20.. Oracle and/or its affiliates#, ${CURRENT_YEAR} Oracle and/or its affiliates#g"' + + git status --porcelain --untracked-files=no > modified_pom.log + cp modified_pom.log list_of_poms.txt + sed -i "s| M |$SED_CMD_LINE |g" modified_pom.log + sed -i "s| M ||g" list_of_poms.txt + + bash modified_pom.log + + echo ${CURRENT_YEAR} current year + + while IFS= read -r path_to_pom + do + export CP_YEAR=`grep -o 'Copyright (c) 20.. Oracle and/or its affiliates' ${path_to_pom} | awk '{print $3}'` + [[ -z ${CP_YEAR} ]] && CP_YEAR=${CURRENT_YEAR} || echo ${CP_YEAR} + [[ ${CP_YEAR} == ${CURRENT_YEAR} ]] || ( sed -i "s#Copyright (c) ${CP_YEAR} Oracle and/or its affiliates#Copyright (c) ${CP_YEAR}, ${CURRENT_YEAR} Oracle and/or its affiliates#g" ${path_to_pom} ; echo ${path_to_pom} ) + unset CP_YEAR + done < "list_of_poms.txt" + ''' + echo '-[ Run release build ]---------------------------------------------------------' + dir(RELEASE_FOLDER) { + //env.JAVA_HOME = JDK_12_HOME + //sh 'mvn clean install -am -Pstaging -pl :jersey-wadl-doclet -DskipTests -B -q -V -Djersey.version=${RELEASE_VERSION}' + env.JAVA_HOME = JDK_21_HOME + sh "mvn clean install -B -q -V -DskipTests -am -Pstaging -Djersey.version=${RELEASE_VERSION} --projects ${MULTIRELEASE_MODULES}" + env.JAVA_HOME = JDK_11_HOME + // + sh "mvn -q -B -V -Djersey.version=${RELEASE_VERSION} -DskipTests -Ddoclint=none -Dadditionalparam='-Xdoclint:none' " + + " -Poss-release,staging -U -C ${TARGET} ${DEPLOY_TARGET}" + //sh "mvn -Poss-release,staging -pl :jersey-wadl-doclet -am install gpg:sign ${DEPLOY_TARGET} -B -q -V -DskipTests -Djersey.version=${RELEASE_VERSION}" + + } + } + stage('Prepare release') { + sh ''' + git checkout -- etc/config/checkstyle-suppressions.xml + ''' + echo '-[ Perform release commit to git ]---------------------------------------------' + sh "git commit -a -m ${RELEASE_VERSION}" + sh "git tag -m ${RELEASE_TAG} -a ${RELEASE_TAG}" + echo '-[ Set next snapshot version ]-------------------------------------------------' + dir(RELEASE_FOLDER) { + sh """ + mvn -q -B -Pstaging -Djersey.version=${RELEASE_VERSION} versions:set -DnewVersion=${NEXT_VERSION} -DgenerateBackupPoms=false + mvn -q -B -Pstaging -Djersey.version=${RELEASE_VERSION} versions:set -DnewVersion=${NEXT_VERSION} -DgenerateBackupPoms=false -f bom/pom.xml + """ + } + echo '-[ Perform commit to git ]-----------------------------------------------------' + sh "git commit -a -m ${NEXT_VERSION}" + } + stage('Publish release') { + if (DRY_RUN == 'true') { + echo '-[ Prepared branch ]----------------------------------------------------------' + sh "git branch --list ${NEW_RELEASE_BRANCH}" + echo '-[ Prepared tag ]-------------------------------------------------------------' + sh "git tag --list ${NEW_RELEASE_BRANCH}" + echo '-[ Prepared commits ]---------------------------------------------------------' + sh 'git log -n 5' + sshagent([CREDENTIALS_ID]) { + sh "git push ${GIT_ORIGIN} ${NEW_RELEASE_BRANCH} --dry-run" + } + return + } else { + sshagent([CREDENTIALS_ID]) { + sh "git push -f ${GIT_ORIGIN} ${NEW_RELEASE_BRANCH} --follow-tags" + } + } + } + stage('Find related staging') { + if (DRY_RUN != 'true') { + if (!STAGING_NAME?.trim()) { + try { + STAGING_NAME = + sh(returnStdout: true, + script: "mvn -Djersey.version=${RELEASE_VERSION} -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/$STAGING_NAME_PATTERN OPEN / {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'" + ).trim() + } catch (Error err) { + currentBuild.result = 'UNSTABLE' + } + } + echo 'Staging name: ' + STAGING_NAME + } else { + echo 'DRY_RUN' + } + } + stage('Close released staging') { + if (!STAGING_NAME?.trim()) { + echo 'Nothing to be closed' + } else { + sh("mvn -B -q -Pstaging -Djersey.version=${RELEASE_VERSION} nexus-staging:rc-close -DstagingRepositoryId=${STAGING_NAME} -DstagingDescription='${STAGING_DESC}'") + } + } + stage('Drop redundant staging') { + if (!STAGING_PREV_NAME?.trim()) { + echo 'Nothing to be dropped' + } else { + try { + sh(""" + OPEN_STAGINGS=${STAGING_PREV_NAME} + mvn -Djersey.version=${RELEASE_VERSION} -B -q -Pstaging nexus-staging:rc-drop -DstagingRepositoryId=\${OPEN_STAGINGS} + """) + } catch (Error err) { + currentBuild.result = 'UNSTABLE' + } + } + } +} \ No newline at end of file diff --git a/etc/scripts/release/EE8/bundle-apidocs.sh b/etc/scripts/release/EE8/bundle-apidocs.sh new file mode 100644 index 0000000000..dc360cc008 --- /dev/null +++ b/etc/scripts/release/EE8/bundle-apidocs.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing api docs bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 2.42 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk8-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Branches to build: +# tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + + # Execution environment + MVN_HOME="/opt/tools/apache-maven/latest/" + PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + + if [[ $VERSION == 2* ]] ; + then + export PROFILE_BUNDLE=',jetty2x' + fi + + sed -i "s|org.glassfish.jersey.ext.micrometer|org.glassfish.jersey.ext|g" bundles/apidocs/pom.xml + + echo '-[ Run maven release plugin ]---------------------------------------------------' + + mvn -q -C -DstagingDescription="org.glassfish.jersey.bundles.apidocs:${VERSION}" \ + -Pstaging,oss-release,pre-release${PROFILE_BUNDLE} -DskipTests -Denforcer.skip -pl bundles/apidocs \ + install javadoc:jar gpg:sign deploy -Dsource.mvn.plugin.version=3.2.0 \ No newline at end of file diff --git a/etc/scripts/release/EE8/bundle-examples.sh b/etc/scripts/release/EE8/bundle-examples.sh new file mode 100644 index 0000000000..61afc00a8a --- /dev/null +++ b/etc/scripts/release/EE8/bundle-examples.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing examples bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 2.42 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk8-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Branches to build: +# tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + + # Execution environment + MVN_HOME="/opt/tools/apache-maven/latest/" + PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + + mvn clean install -C -B -DskipTests -Denforcer.skip -Ppre-release,staging -pl org.glassfish.jersey.examples:project -amd + + mvn -C -B -DstagingDescription="org.glassfish.jersey.examples:${VERSION}" \ + -Pstaging,oss-release,pre-release -Denforcer.skip=true \ + -DskipTests -pl :jersey-examples \ + deploy \ No newline at end of file diff --git a/etc/scripts/release/EE8/bundle-user-guide.sh b/etc/scripts/release/EE8/bundle-user-guide.sh new file mode 100644 index 0000000000..f6a121da4d --- /dev/null +++ b/etc/scripts/release/EE8/bundle-user-guide.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for releasing User Guide bundle by release tag. +# +# Input Parameters: +# +# VERSION - type: String +# - example: 2.42 +# - description: Name of the existing version tag in the Git repo. +# +# Configuration: +# +# JDK: +# oracle-jdk11-latest +# Git: +# git@github.com:eclipse-ee4j/jersey.git +# Credentials: +# GitHub bot SSH +# Branches to build: +# refs/tags/${VERSION} +# +# Bindings: +# Secret file: +# Variable: +# KEYRING +# Credentials: +# secret-subkeys.asc +# +# + + + gpg --batch --import ${KEYRING} + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + + # Execution environment + MVN_HOME="/opt/tools/apache-maven/latest/" + PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + + echo '-[ Set version to ]-'${VERSION} + + mvn -q -Pstaging versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false -Djersey.version=${VERSION} + + cd docs + + echo '-[ Run maven release plugin ]---------------------------------------------------' + + mvn -q -C -DstagingDescription="org.glassfish.jersey.jersey-documentation:${VERSION}" \ + -Pstaging,oss-release,pre-release \ + -DskipTests \ + -Djersey.version=${VERSION} \ + install javadoc:jar gpg:sign deploy \ No newline at end of file diff --git a/etc/scripts/release/EE8/release.groovy b/etc/scripts/release/EE8/release.groovy new file mode 100644 index 0000000000..3a88d314c7 --- /dev/null +++ b/etc/scripts/release/EE8/release.groovy @@ -0,0 +1,347 @@ +#!/usr/bin/env groovy + +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +/** + * Release script for Jakarta EE8/9 Jersey versions + * Release branches are 2.x or 3.0 + * + * Input Parameters: + * RELEASE_VERSION - type: String + * - example: 2.42 + * - Description: mandatory release version. Later is being published to staging/central. + * NEXT_VERSION - type: String + * - example: 2.43-SNAPSHOT + * - Description: mandatory next developing version will be committed in to the release branch and later + * merged into the original release branch for further developing. + * BRANCH - type: Choice Parameter + * - values: 2.x + * 3.0 + * - Description: Original release branch from which the codebase is being checked out + * DRY_RUN - type: Boolean + * - Description: if checked nothing is really committed to Git nor published to the staging + * OVERWRITE - type: Boolean + * - Description: if checked allows replacing of the previously published RELEASE_VERSION of Jersey + * + */ + +node { + + def MVN_HOME = tool name: 'apache-maven-latest', type: 'maven' + def HELP_PLUGIN = 'org.apache.maven.plugins:maven-help-plugin:2.1.1' + def TARGET = 'package javadoc:jar gpg:sign install:install' + def DEPLOY_TARGET = '' + def RELEASE_VERSION = RELEASE_VERSION + def NEXT_VERSION = NEXT_VERSION + def RELEASE_TAG = '' + def NEW_RELEASE_BRANCH = '' + def OVERWRITE = OVERWRITE + def PROJECT_NAME = 'Jersey' + def LOGIN = 'jersey-bot' + def EMAIL = 'jersey-bot@eclipse.org' + def REPO = 'git@github.com:eclipse-ee4j/jersey.git' + def SECRET_FILE_ID = 'secret-subkeys.asc' + def CREDENTIALS_ID = 'github-bot-ssh' + def GIT_ORIGIN = 'origin' + def RELEASE_FOLDER = env.WORKSPACE + def RELEASE_BRANCH = BRANCH + + def STAGING_NAME_PATTERN = 'orgglassfishjersey-[0-9]+' + def STAGING_NAME = '' + def STAGING_PREV_NAME = '' + def STAGING_OPEN_NAME = '' + def STAGING_DESC = 'org.glassfish.jersey:' + RELEASE_VERSION + def STAGING_BOM_DESC = 'org.glassfish.jersey.bom:' + RELEASE_VERSION + def STAGING_PROFILE_ID = '70fa3a107a8918' + + def JDK_11_HOME = tool name: 'openjdk-jdk11-latest', type: 'jdk' + def JDK_12_HOME = tool name: 'openjdk-jdk12-latest', type: 'jdk' + def JDK_17_HOME = tool name: 'openjdk-jdk17-latest', type: 'jdk' + def JDK_8_HOME = tool name: 'oracle-jdk8-latest', type: 'jdk' + + def ZX_BRANCH_MODULES = ',:jersey-jetty-connector,:jersey-container-jetty-http,:jersey-container-jetty-servlet,:jersey-test-framework-provider-jetty,:jersey-test-framework-core,:jersey-container-servlet-core' + + env.JAVA_HOME = JDK_8_HOME + env.PATH = "${env.JAVA_HOME}/bin:${env.PATH}:${MVN_HOME}/bin" + + if (RELEASE_BRANCH == '2.x') { + ZX_BRANCH_MODULES = '' + } + + sh 'java -version' + + stage('Fetch from git') { + git(branch: RELEASE_BRANCH, credentialsId: CREDENTIALS_ID, url: REPO) + } + stage('Prepare environment') { + + dir(RELEASE_FOLDER) { + //# Check whether top level pom.xml contains SNAPSHOT version + if (!sh(returnStdout: true, script: "grep '' pom.xml | grep 'SNAPSHOT'")?.trim()) { + error('-[ Missing SNAPSHOT version in POM! ]-------------------------------------------') + } + + //# Compute release versions + def SNAPSHOT_VERSION = sh(returnStdout: true, script: 'mvn -q -Dexec.executable="echo" -Dexec.args=\'${project.version}\' --non-recursive exec:exec -Pstaging').trim() + + if (!RELEASE_VERSION?.trim()) { + if (!SNAPSHOT_VERSION?.trim()) { + error('-[ Missing required snapshot version number! ]----------------------------------') + } else { + def versionTokens = SNAPSHOT_VERSION.split('-') + RELEASE_VERSION = versionTokens[0] + } + } + + if (!NEXT_VERSION?.trim()) { + def (MAJOR_VERSION, MINOR_VERSION) = RELEASE_VERSION.tokenize('.') + def NEXT_MINOR_VERSION = (MINOR_VERSION as Integer) + 1 + NEXT_VERSION = MAJOR_VERSION + '.' + NEXT_MINOR_VERSION + '-SNAPSHOT' + } + + RELEASE_TAG = RELEASE_VERSION + NEW_RELEASE_BRANCH = RELEASE_VERSION+'-BRANCH' + + echo "Current version: ${SNAPSHOT_VERSION}" + echo "Release version: ${RELEASE_VERSION}" + echo "Next version: ${NEXT_VERSION}" + echo "Release tag: ${RELEASE_TAG}" + echo "Release branch: ${NEW_RELEASE_BRANCH}" + + if (!SNAPSHOT_VERSION?.trim() || !RELEASE_VERSION?.trim() || !NEXT_VERSION?.trim()) { + error '-[ Missing required version numbers! ]------------------------------------------' + } + + if (DRY_RUN == 'true') { + echo '-[ Dry run turned on ]----------------------------------------------------------' + //TARGET = 'install' + } else { + DEPLOY_TARGET = ' deploy:deploy' + } + echo '-[ Configure git user ]--------------------------------------------------------' + sh "git config --local user.email \"${EMAIL}\"" + sh "git config --local user.name \"$LOGIN\"" + + } + + } + stage('Prepare GPG') { + withCredentials([file(credentialsId: SECRET_FILE_ID, variable: 'KEYRING')]) { + //# Workaround: GPG initialization + sh("gpg --batch --import ${KEYRING}") + sh ''' + for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); + do + echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; + done + ''' + } + } + stage('Prepare branch') { + echo '-[ Prepare branch ]-------------------------------------------------------------' + + echo '-[ Switching to release branch ]-------------------------------------------------' + sh """ + git checkout ${GIT_ORIGIN}/${RELEASE_BRANCH} && true + git reset --hard ${GIT_ORIGIN}/${RELEASE_BRANCH} && true + git checkout -B ${NEW_RELEASE_BRANCH} + """ + echo '-[ Release tag cleanup ]--------------------------------------------------------' + def TAG_NAME = sh(returnStdout: true, script: "git tag | grep ${RELEASE_TAG} || true").trim() + if (RELEASE_TAG == TAG_NAME) { + if (OVERWRITE == 'true') { + echo "${RELEASE_TAG} tag already exists, deleting" + sshagent([CREDENTIALS_ID]) { + sh "git push --delete origin ${RELEASE_TAG} && true" + } + } else { + error "${RELEASE_TAG} tag already exists" + } + //# Always delete local tag if exists + sh """ + git tag --delete ${RELEASE_TAG} && true + """ + } + sh ''' + sed -i 's|||g' etc/config/checkstyle-suppressions.xml + ''' + } + stage('Check previous stagings') { + if (DRY_RUN == 'true') { + echo DRY_RUN + ' ------' + } else { + if (OVERWRITE == 'true') { + STAGING_PREV_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/\\[INFO] $STAGING_NAME_PATTERN[ ]+CLOSED[ ]+$STAGING_DESC[ ]*\$/ {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'").trim() + echo 'Previously closed staging name: ' + STAGING_PREV_NAME + } + + STAGING_OPEN_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/$STAGING_NAME_PATTERN OPEN / {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'").trim() + + if (!STAGING_OPEN_NAME?.trim()) { + echo 'No currently open stagings' + } else { + echo 'Currently open redundand staging: ' + STAGING_OPEN_NAME + ', immediately closing' + sh """ + OPEN_STAGINGS=${STAGING_OPEN_NAME} + mvn -B -q -Pstaging nexus-staging:rc-drop -DstagingRepositoryId=\${OPEN_STAGINGS} + """ + } + } + } + /* + stage('Open new staging') { + if (DRY_RUN == 'true') { + echo DRY_RUN + ' ------' + } else { + STAGING_NAME = sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging -DstagingProfileId=${STAGING_PROFILE_ID} -DstagingDescription=${STAGING_DESC} nexus-staging:rc-open | awk '/\\[INFO] Opened / {print \$3}'").trim() + echo 'New staging name: '+STAGING_NAME + } + }*/ + stage("Build ${PROJECT_NAME}") { + echo env.JAVA_HOME + echo '-[ Run maven release ]---------------------------------------------------------' + echo '-[ Set Release version ]-------------------------------------------------------' + sh """ + cd ${RELEASE_FOLDER} + mvn -B -V -Pstaging versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false + cd bom + mvn -B -V -Pstaging versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false + cd .. + """ + echo '-[ Update Copyright years ]----------------------------------------------------' + sh '''#!/bin/bash -e + + export CURRENT_YEAR=`date '+%Y'` + export SED_CMD_LINE='sed -i "s#, 20.. Oracle and/or its affiliates#, ${CURRENT_YEAR} Oracle and/or its affiliates#g"' + + git status --porcelain --untracked-files=no > modified_pom.log + cp modified_pom.log list_of_poms.txt + sed -i "s| M |$SED_CMD_LINE |g" modified_pom.log + sed -i "s| M ||g" list_of_poms.txt + + bash modified_pom.log + + echo ${CURRENT_YEAR} current year + + while IFS= read -r path_to_pom + do + export CP_YEAR=`grep -o 'Copyright (c) 20.. Oracle and/or its affiliates' ${path_to_pom} | awk '{print $3}'` + [[ -z ${CP_YEAR} ]] && CP_YEAR=${CURRENT_YEAR} || echo ${CP_YEAR} + [[ ${CP_YEAR} == ${CURRENT_YEAR} ]] || ( sed -i "s#Copyright (c) ${CP_YEAR} Oracle and/or its affiliates#Copyright (c) ${CP_YEAR}, ${CURRENT_YEAR} Oracle and/or its affiliates#g" ${path_to_pom} ; echo ${path_to_pom} ) + unset CP_YEAR + done < "list_of_poms.txt" + ''' + echo '-[ Run release build ]---------------------------------------------------------' + dir(RELEASE_FOLDER) { + env.JAVA_HOME = JDK_12_HOME + // + sh "mvn -am -Pstaging --projects core-server,core-client,media/jaxb,inject/hk2,ext/wadl-doclet,core-common${ZX_BRANCH_MODULES} clean install -B -q -V -DskipTests" + if (RELEASE_BRANCH == '3.0') { + env.JAVA_HOME = JDK_17_HOME + sh "mvn clean install -B -q -V -DskipTests -am -Pstaging --projects :jersey-spring6,connectors/helidon-connector" + } + env.JAVA_HOME = JDK_8_HOME + sh "mvn -q -B -V -DskipTests -Ddoclint=none -Dadditionalparam='-Xdoclint:none' -Dcheckstyle.skip " + + //" -DstagingDescription='${STAGING_DESC}' -DstagingRepositoryId='${STAGING_NAME}' "+ + " -Poss-release,staging -U -C ${TARGET} ${DEPLOY_TARGET}" + + sh "mvn -Poss-release,staging --projects core-server,core-client,media/jaxb,inject/hk2,ext/wadl-doclet,core-common install gpg:sign ${DEPLOY_TARGET} -B -q -V -DskipTests" + if (RELEASE_BRANCH == '2.x') { + env.JAVA_HOME = JDK_11_HOME + sh "mvn -Poss-release,staging --projects connectors/helidon-connector install gpg:sign ${DEPLOY_TARGET} -B -q -V -DskipTests" + } + } + } + stage('Prepare release') { + sh ''' + git checkout -- etc/config/checkstyle-suppressions.xml + ''' + echo '-[ Perform release commit to git ]---------------------------------------------' + sh "git commit -a -m ${RELEASE_VERSION}" + sh "git tag -m ${RELEASE_TAG} -a ${RELEASE_TAG}" + echo '-[ Set next snapshot version ]-------------------------------------------------' + dir(RELEASE_FOLDER) { + sh """ + mvn -B -Pstaging versions:set -DnewVersion=${NEXT_VERSION} -DgenerateBackupPoms=false + cd bom + mvn -B -Pstaging versions:set -DnewVersion=${NEXT_VERSION} -DgenerateBackupPoms=false + cd .. + """ + } + echo '-[ Perform commit to git ]-----------------------------------------------------' + sh "git commit -a -m ${NEXT_VERSION}" + } + stage('Publish release') { + if (DRY_RUN == 'true') { + echo '-[ Prepared branch ]----------------------------------------------------------' + sh "git branch --list ${NEW_RELEASE_BRANCH}" + echo '-[ Prepared tag ]-------------------------------------------------------------' + sh "git tag --list ${NEW_RELEASE_BRANCH}" + echo '-[ Prepared commits ]---------------------------------------------------------' + sh 'git log -n 5' + sshagent([CREDENTIALS_ID]) { + sh "git push ${GIT_ORIGIN} ${NEW_RELEASE_BRANCH} --dry-run" + } + return + } else { + sshagent([CREDENTIALS_ID]) { + sh "git push -f ${GIT_ORIGIN} ${NEW_RELEASE_BRANCH} --follow-tags" + } + } + } + stage('Find related staging') { + if (DRY_RUN != 'true') { + if (!STAGING_NAME?.trim()) { + try { + STAGING_NAME = + sh(returnStdout: true, + script: "mvn -B --non-recursive -Pstaging nexus-staging:rc-list | awk '/$STAGING_NAME_PATTERN OPEN / {if(a){a = \$2\",\"a} else{a = \$2}}END{print a}'" + ).trim() + } catch (Error err) { + currentBuild.result = 'UNSTABLE' + } + } + echo 'Staging name: ' + STAGING_NAME + } else { + echo 'DRY_RUN' + } + } + stage('Close released staging') { + if (!STAGING_NAME?.trim()) { + echo 'Nothing to be closed' + } else { + sh("mvn -B -q -Pstaging nexus-staging:rc-close -DstagingRepositoryId=${STAGING_NAME} -DstagingDescription='${STAGING_DESC}'") + } + } + stage('Drop redundant staging') { + if (!STAGING_PREV_NAME?.trim()) { + echo 'Nothing to be dropped' + } else { + try { + sh(""" + OPEN_STAGINGS=${STAGING_PREV_NAME} + mvn -B -q -Pstaging nexus-staging:rc-drop -DstagingRepositoryId=\${OPEN_STAGINGS} + """) + } catch (Error err) { + currentBuild.result = 'UNSTABLE' + } + } + } +} \ No newline at end of file diff --git a/etc/scripts/release/Release-After/list-closed-stagings.sh b/etc/scripts/release/Release-After/list-closed-stagings.sh new file mode 100644 index 0000000000..d5f32cafb1 --- /dev/null +++ b/etc/scripts/release/Release-After/list-closed-stagings.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for listing staging from the staging repo. +# +# Input Parameters: +# ----none---- +# Configuration: +# +# JDK: +# (System) +# Git: +# ----none---- +# +# + +cat <> pom.xml + + + + + 4.0.0 + + org.eclipse.ee4j + project + 1.0.9 + + + + org.glassfish.jersey + release-helper-util + 1.0.1-SNAPSHOT + pom + + Jersey Release Helper + + Generated POM for Jersey Release Helper utils + https://projects.eclipse.org/projects/ee4j.jersey + + + scm:git:git://github.com/eclipse-ee4j/jersey + scm:git:git://github.com/eclipse-ee4j/jersey + https://github.com/eclipse-ee4j/jersey + + + +EOT + +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +export STAGING_PARAMS='-DnexusUrl=https://jakarta.oss.sonatype.org/ -DserverId=ossrh' +export STAGING_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7' + + +mvn -B ${STAGING_PARAMS} ${STAGING_PLUGIN}:rc-list | grep orgglassfishjersey > closed_stagings.txt || true + + +# +# +# Archive the artifacts: +# closed_stagings.txt +# diff --git a/etc/scripts/release/Release-After/populate-documentation.sh b/etc/scripts/release/Release-After/populate-documentation.sh new file mode 100644 index 0000000000..025e512af5 --- /dev/null +++ b/etc/scripts/release/Release-After/populate-documentation.sh @@ -0,0 +1,166 @@ +#!/bin/bash -lex +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for api docs publishing. Publishes api docs from the bundle in the Maven Central to the project's site. +# +# Input Parameters: +# RELEASE_VERSION - type: String +# - example: 3.1.6 +# - description: version for which project info is being published +# DRY_RUN - type: Boolean +# - description: If checked nothing is being published/generated +# WEBSITE_URL - type: String +# - value: git@github.com:eclipse-ee4j/jersey.github.io.git +# - description: GitHub url for the project info/apidocs repository. +# Mandatory and changes only in exceptional cases +# BRANCH_SPECIFIER - type: String +# - example: 2.x +# - description: Branch for which the api docs are being published. Used only in Git commit message +# UPDATE_LATEST - type: Boolean +# - description: If checked updates the latest api docs (distinguishes for EE8/EE9/EE10) along +# with publication into the RELEASE_VERSION folder. +# Configuration: +# +# JDK: +# oracle-jdk8-latest +# Git: +# ----none---- +# +# SSH agent: +# GitHub bot SSH +# +# +# + + +# +# The first shell execution +# + + +TOOLS_PREFIX=/opt/tools +#JAVA_PREFIX=/opt/tools/java/oracle +MVN_HOME=/opt/tools/apache-maven/latest +#JAVA_HOME=/opt/tools/java/oracle/jdk-8/latest +PATH=/opt/tools/apache-maven/latest/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +export CENTRAL_URL='https://repo1.maven.org/maven2' +export STAGING_URL='https://jakarta.oss.sonatype.org/content/repositories/staging' + +# !!! if build docbook it's essentially important to turn the pre-release profile ON !!! +#mvn clean install -Pstaging,pre-release -DskipTests -V -q -e -U -B -f docs/pom.xml -Djersey.version=$RELEASE_VERSION +# however we download already published docbook from staging/central: +mkdir -p $WORKSPACE/docs/target/docbook/index +cd $WORKSPACE/docs/target/docbook/index +wget -nv ${STAGING_URL}/org/glassfish/jersey/jersey-documentation/${RELEASE_VERSION}/jersey-documentation-${RELEASE_VERSION}-docbook.zip +unzip -o jersey-documentation-${RELEASE_VERSION}-docbook.zip +rm jersey-documentation-${RELEASE_VERSION}-docbook.zip + +mkdir -p $WORKSPACE/target/site/apidocs +cd $WORKSPACE/target/site/apidocs +wget -nv ${STAGING_URL}/org/glassfish/jersey/bundles/apidocs/${RELEASE_VERSION}/apidocs-${RELEASE_VERSION}-javadoc.jar -O apidocs-javadoc.jar +jar -xf apidocs-javadoc.jar +rm apidocs-javadoc.jar +rm -rf META-INF + + +# +# The second shell execution +# + + +#!/bin/bash -lex + +TOOLS_PREFIX=/opt/tools +#JAVA_PREFIX=/opt/tools/java/oracle +MVN_HOME=/opt/tools/apache-maven/latest +#JAVA_HOME=/opt/tools/java/oracle/jdk-8/latest +PATH=/opt/tools/apache-maven/latest/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +DIRS="$RELEASE_VERSION" +if $UPDATE_LATEST; +then + if [[ $RELEASE_VERSION == 2* ]] ; + then + export DIRS="latest $DIRS" + elif [[ $RELEASE_VERSION == 3.1* ]] ; + then + export DIRS="latest31x $DIRS" + else + export DIRS="latest30x $DIRS" + fi + echo ${DIRS} for ${RELEASE_VERSION} release +fi + +#export PATH=/opt/csw/bin:$PATH +WEB_DIR=$WORKSPACE/target/jersey-web + + +function copyDocs { + APIDOCS_DIR=$WEB_DIR/apidocs/$1 + DOCS_DIR=$WEB_DIR/documentation/$1 + + # + # API docs + # + if test ! -e $APIDOCS_DIR ; then + mkdir -p $APIDOCS_DIR + fi + cd $APIDOCS_DIR + + rm -rf jersey || true + cp -R $WORKSPACE/target/site/apidocs ./jersey + + # + # user guide + # + rm -rf $DOCS_DIR || true + mkdir -p $DOCS_DIR + cp -r $WORKSPACE/docs/target/docbook/index/* $DOCS_DIR + rm $DOCS_DIR/*.fo || true +} + +if test -e $WEB_DIR ; then + rm -rf $WEB_DIR +fi + +# would couse shallow reject: git clone --depth 1 $WEBSITE_URL $WEB_DIR +git clone $WEBSITE_URL $WEB_DIR + +cd $WEB_DIR + +for dir in $DIRS; do + copyDocs $dir +done + +cd $WEB_DIR + +git config --local user.email "jersey-bot@eclipse.org" +git config --local user.name "jersey-bot" +git add -A . +git diff --cached --exit-code || git commit -m "[jenkins] automatic javadoc and documentation update [$RELEASE_VERSION @ $BRANCH_SPECIFIER]" + +if [ "$DRY_RUN" = "false" ]; then + echo "Pushing Web sources to $WEBSITE_URL" + git push origin master +else + echo "Dry run .. not pushing to the master" + git push origin master --dry-run +fi + + diff --git a/etc/scripts/release/Release-After/publish-release-notes.sh b/etc/scripts/release/Release-After/publish-release-notes.sh new file mode 100644 index 0000000000..d547134dba --- /dev/null +++ b/etc/scripts/release/Release-After/publish-release-notes.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for publishing listed stagings from the staging repo into the Maven Central. +# +# Input Parameters: +# VERSION - type: String +# - example: 3.1.6 +# - description: version for which release notes are being published +# DRY_RUN - type: Boolean +# - description: If checked nothing is being published/generated +# PUBLISH_TO_GITHUB - type: Boolean +# - description: If checked generated notes are propagated to GitHub +# Configuration: +# +# JDK: +# oracle-jdk8-latest +# Git: +# https://github.com/eclipse-ee4j/jersey +# +# Bindings: +# Username and password (separated): +# Username Variable: +# BOT_NAME +# Password Variable: +# BOT_PASSWORD +# Credentials: +# GitHub bot (username/token) +# +# +# + + +cat <> pom.xml + + + + + 4.0.0 + + org.eclipse.ee4j + project + 1.0.9 + + + + org.glassfish.jersey + release-helper-util + 1.0.1-SNAPSHOT + pom + + Jersey Release Helper + + Generated POM for Jersey Release Helper utils + https://projects.eclipse.org/projects/ee4j.jersey + + + scm:git:git://github.com/eclipse-ee4j/jersey + scm:git:git://github.com/eclipse-ee4j/jersey + https://github.com/eclipse-ee4j/jersey + + + +EOT + +# Execution environment +readonly MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" +readonly RELEASE_DATE=`date -I` + +mkdir -p target + +mvn -B -V org.glassfish.jersey.tools.plugins:jersey-release-notes-maven-plugin:1.0.1:release-notes -DskipTests \ +-DreleaseVersion=${VERSION} -DgithubLogin=${BOT_NAME} -DgithubPassword=${BOT_PASSWORD} \ +-DtemplateFilePath=release-note.html -DreleaseDate=${RELEASE_DATE} \ +-DdryRun=${DRY_RUN} -DpublishToGithub=${PUBLISH_TO_GITHUB} + +cp -a `pwd`/target/release-notes ${WORKSPACE} \ No newline at end of file diff --git a/etc/scripts/release/Release-After/release-note.html b/etc/scripts/release/Release-After/release-note.html new file mode 100644 index 0000000000..f0e5996340 --- /dev/null +++ b/etc/scripts/release/Release-After/release-note.html @@ -0,0 +1,78 @@ + + + + + + + Release Notes - Jersey @LATEST_VERSION@ + + + + +

Release Notes - Jersey @LATEST_VERSION@

+ +Release date: @RELEASE_DATE@ + +

Previous releases

+ + + + + diff --git a/etc/scripts/release/Release-After/release-project-info.sh b/etc/scripts/release/Release-After/release-project-info.sh new file mode 100644 index 0000000000..ebfe9b125b --- /dev/null +++ b/etc/scripts/release/Release-After/release-project-info.sh @@ -0,0 +1,103 @@ +#!/bin/bash -lex +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for project info publishing. MUST BE RUN ONLY AFTER THE APIDOCS PUBLISHING. +# +# Input Parameters: +# RELEASE_VERSION - type: String +# - example: 3.1.6 +# - description: version for which project info is being published +# DRY_RUN - type: Boolean +# - description: If checked nothing is being published/generated +# WEBSITE_URL - type: String +# - value: git@github.com:eclipse-ee4j/jersey.github.io.git +# - description: GitHub url for the project info/apidocs repository. +# Mandatory and changes only in exceptional cases +# Configuration: +# +# JDK: +# openjdk-jdk11-latest +# Git: +# https://github.com/eclipse-ee4j/jersey +# +# Branches to build: +# tags/${RELEASE_VERSION} +# +# SSH agent: +# GitHub bot SSH +# +# +# + + +# +# The first shell execution +# + +MVN_HOME=/opt/tools/apache-maven/latest +PATH=${PATH}:${MVN_HOME}/bin:${JAVA_HOME}/bin + +mvn clean install -B -V -q -PtestsSkip,checkstyleSkip -Dtests.excluded -DskipTests '-Dmaven.test.skip=true' + +mvn -B -V -q -Pproject-info,checkstyleSkip,testsSkip,findbugsSkip,staging site site:stage \ + -DgenerateProjectInfo=true -Dtests.excluded -Ddependency.locations.enabled=false \ + -Dmaven.jxr.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -DskipTests \ + -Dfindbugs.skip=true + +# +# The second shell execution +# + +#!/bin/bash -lex + +export PATH=/opt/csw/bin:$PATH +WEB_DIR=$WORKSPACE/target/jersey-web +PROJECT_INFO_DIR=$WEB_DIR/project-info/$RELEASE_VERSION + +if test -e $WEB_DIR ; then + rm -rf $WEB_DIR +fi + +# would couse shallow reject: git clone --depth 1 $WEBSITE_SOURCE_URL $WEB_DIR +git clone $WEBSITE_URL $WEB_DIR +cd $WEB_DIR + +if test ! -e $PROJECT_INFO_DIR ; then + mkdir -p $PROJECT_INFO_DIR +fi + +cd $PROJECT_INFO_DIR + +rm -rf jersey || true +cp -R $WORKSPACE/target/staging ./jersey + +cd $WEB_DIR + +git config --local user.email "jersey-bot@eclipse.org" +git config --local user.name "jersey-bot" +git add -A . +#git diff --cached --exit-code || +git commit -m "[jenkins] automatic project-info update [$RELEASE_VERSION]" + +if [ "$DRY_RUN" = "false" ]; then + echo Pushing Web sources to $WEBSITE_URL + git push origin master +else + echo "Dry run .. not pushing to the master" + git push origin master --dry-run +fi \ No newline at end of file diff --git a/etc/scripts/release/Release-After/release-staging-to-central.sh b/etc/scripts/release/Release-After/release-staging-to-central.sh new file mode 100644 index 0000000000..b470730610 --- /dev/null +++ b/etc/scripts/release/Release-After/release-staging-to-central.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0, which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# This Source Code may also be made available under the following Secondary +# Licenses when the conditions for such availability set forth in the +# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, +# version 2 with the GNU Classpath Exception, which is available at +# https://www.gnu.org/software/classpath/license.html. +# +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 +# + +# +# script for publishing listed stagings from the staging repo into the Maven Central. +# +# Input Parameters: +# STAGING_REPO_ID - type: String +# - example: orgglassfishjersey-1226,orgglassfishjersey-1227,orgglassfishjersey-1228,orgglassfishjersey-1229,orgglassfishjersey-1230 +# - description: list all staggings (comma separated) to be published to the Maven Central +# STAGING_DESC - type: String +# - example:org.glassfish.jersey:2.42 +# - description: description of what is published. Usually : +# Configuration: +# +# JDK: +# (System) +# Git: +# ----none---- +# +# + +cat <> pom.xml + + + + + 4.0.0 + + org.eclipse.ee4j + project + 1.0.9 + + + + org.glassfish.jersey + release-helper-util + 1.0.1-SNAPSHOT + pom + + Jersey Release Helper + + Generated POM for Jersey Release Helper utils + https://projects.eclipse.org/projects/ee4j.jersey + + + scm:git:git://github.com/eclipse-ee4j/jersey + scm:git:git://github.com/eclipse-ee4j/jersey + https://github.com/eclipse-ee4j/jersey + + + +EOT + +MVN_HOME="/opt/tools/apache-maven/latest/" +PATH="${MVN_HOME}/bin:${JAVA_HOME}:/bin:${PATH}" + +export STAGING_PARAMS='-DnexusUrl=https://jakarta.oss.sonatype.org/ -DserverId=ossrh' +export STAGING_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7' + + +mvn ${STAGING_PARAMS} -B -C -V ${STAGING_PLUGIN}:rc-release -DstagingRepositoryId="${STAGING_REPO_ID}" -DstagingDescription="${STAGING_DESC}" + diff --git a/examples/NOTICE.md b/examples/NOTICE.md index c68ea536d6..b14ed9dd37 100644 --- a/examples/NOTICE.md +++ b/examples/NOTICE.md @@ -96,7 +96,7 @@ KineticJS, v4.7.1 * Project: http://www.kineticjs.com, https://github.com/ericdrowell/KineticJS * Copyright: Eric Rowell -org.objectweb.asm Version 9.6 +org.objectweb.asm Version 9.7 * License: Modified BSD (https://asm.ow2.io/license.html) * Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved. diff --git a/pom.xml b/pom.xml index 8069240374..dca426bd52 100644 --- a/pom.xml +++ b/pom.xml @@ -2240,7 +2240,7 @@ 3.0.1.Final - 9.6 + 9.7 1.9.21.1