Skip to content

Commit

Permalink
Upgrade parent to apache:43, require JDK 11 at build time and upgrade…
Browse files Browse the repository at this point in the history
… a few plugins (fixes apache#536)
  • Loading branch information
gnodet committed Jul 23, 2024
1 parent c2d64f4 commit ee26bdc
Show file tree
Hide file tree
Showing 32 changed files with 152 additions and 276 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
java: [ '8' ]
java: [ '8', '11' ]
steps:
- uses: actions/checkout@v4

Expand All @@ -47,7 +47,7 @@ jobs:
${{ matrix.os }}-maven-
- name: Build with maven
run: mvn -B --errors --activate-profiles ci --no-transfer-progress package -DskipTests
run: mvn -B --errors --activate-profiles ci,jdk{{matrix.java}}? --no-transfer-progress package -DskipTests

test:
needs: compile
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Build and test with maven
# Skip all static checks, they were already done in the compile jobs
run: mvn -B --errors --activate-profiles ci --no-transfer-progress package
run: mvn -B --errors --activate-profiles ci,jdk{{matrix.java}}? --no-transfer-progress package

- name: Archive test results and logs
# if: success() || failure() to also get the test results on successful runs.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '8'
java-version: '11'
# Create a ~/.m2/settings.xml referencing these environment variable names
server-id: 'apache.snapshots.https'
server-username: NEXUS_USERNAME
Expand Down
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Dworkspace.root.dir=${session.rootDirectory}
-DprojectRoot=${session.rootDirectory}
194 changes: 33 additions & 161 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>32</version>
<version>33</version>
</parent>

<groupId>org.apache.sshd</groupId>
Expand Down Expand Up @@ -79,18 +79,14 @@
</scm>

<properties>
<projectRoot>${project.basedir}</projectRoot>
<minimalJavaBuildVersion>11</minimalJavaBuildVersion>
<minimalMavenBuildVersion>3.9.8</minimalMavenBuildVersion>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2024-06-20T20:44:27Z</project.build.outputTimestamp>

<!-- NOTE: actual workspace root dir value updated by gmavenplus-plugin on initialization phase -->
<!-- workspace.root.dir>${project.basedir}</workspace.root.dir -->

<java.major.version>1</java.major.version>
<java.minor.version>8</java.minor.version>
<java.sdk.version>8</java.sdk.version>
<sniffer.signatures.version>1.0</sniffer.signatures.version>
<javac.source>${java.major.version}.${java.minor.version}</javac.source>
<javac.source>${java.sdk.version}</javac.source>
<project.build.java.source>${javac.source}</project.build.java.source>
<maven.compiler.source>${javac.source}</maven.compiler.source>
<ant.version>1.10.12</ant.version>
Expand Down Expand Up @@ -137,10 +133,34 @@

<profiles>
<profile>
<id>release</id>
<id>jdk8</id>
<properties>
<required.java.version>[1.8,1.9)</required.java.version>
<minimalJavaBuildVersion>8</minimalJavaBuildVersion>
</properties>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<id>format</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<id>sort-imports</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
Expand Down Expand Up @@ -318,21 +338,6 @@
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>execute</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.rat</groupId>
Expand Down Expand Up @@ -752,27 +757,6 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.23</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java${java.major.version}${java.minor.version}</artifactId>
<version>${sniffer.signatures.version}</version>
</signature>
</configuration>
<!-- make sure the signatures artifact is downloaded -->
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java${java.major.version}${java.minor.version}</artifactId>
<version>${sniffer.signatures.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
Expand Down Expand Up @@ -844,56 +828,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>3.0.2</version>
<dependencies>
<!-- referenced indirectly by groovy-ant -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency> <!-- replace ant-junit artifact -->
<groupId>org.apache.ant</groupId>
<artifactId>ant-junit4</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-antlr</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>

<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-ant</artifactId>
<version>${groovy.version}</version>
<exclusions>
<exclusion> <!-- replaced by ant-junit4 -->
<groupId>org.apache.ant</groupId>
<artifactId>ant-junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down Expand Up @@ -1062,7 +996,7 @@
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.16.0</version>
<version>2.23.0</version>
<configuration>
<skipXmlFormatting>true</skipXmlFormatting>
<skipHtmlFormatting>true</skipHtmlFormatting>
Expand All @@ -1074,15 +1008,7 @@
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.6.2</version>
<dependencies>
<!-- Must override dependency to build on Maven 3.9.x, even though not declared (see MNG-6965) -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
</dependencies>
<version>1.11.0</version>
<configuration>
<lineEnding>LF</lineEnding>
<groups>java.,javax.,org.w3c.,org.xml.,junit.</groups>
Expand All @@ -1091,52 +1017,10 @@
<staticGroups>java.,javax.,org.w3c.,org.xml.,junit.</staticGroups>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<!-- Works only for Maven 3.x -->
<execution>
<id>detect-workspace-root-dir</id>
<!-- NOTE: phase must be BEFORE checkstyle plugin one -->
<phase>validate</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
<script>
<![CDATA[
for (java.io.File file = new java.io.File(new java.net.URI('${project.baseUri}')); file != null; file = file.getParentFile()) {
if (!file.isDirectory()) {
continue
}
java.io.File testFile = new java.io.File(file, 'LICENSE.txt')
if (testFile.canRead()) {
project.properties['workspace.root.dir'] = file.getAbsolutePath()
// System.out.println("Workspace root dir: " + project.properties['workspace.root.dir'])
return
}
}
System.err.println("Failed to detect workspace root dir")
]]>
</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
Expand Down Expand Up @@ -1430,18 +1314,6 @@
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>${maven.archiver.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>${plexus.archiver.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected void appendDedupSep(StringBuilder sb, CharSequence s) {

/**
* In case we are running on Windows, accept "\\" as a file separator. Ignore in *nix as "\\" is a valid filename
*
*
* @param name the name to fix the separator for if running on Windows
* @return the fixed name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public static String appendPathComponent(String prefix, String component) {

StringBuilder sb = new StringBuilder(
prefix.length() + component.length() + File.separator.length())
.append(prefix);
.append(prefix);

if (sb.charAt(prefix.length() - 1) == File.separatorChar) {
if (component.charAt(0) == File.separatorChar) {
Expand Down Expand Up @@ -743,7 +743,7 @@ private static List<String> removeExtraCdUps(Path toResolve) {

/**
* Build a path from the list of path parts
*
*
* @param root the root path
* @param fs the filesystem
* @param namesList the parts of the path to build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* Exposes direct access to the underlying buffer
*
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
public class ExposedBufferByteArrayOutputStream extends ByteArrayOutputStream {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* Various events used by {@link ClientChannel#waitFor(java.util.Collection, long)}
*
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
public enum ClientChannelEvent {
Expand All @@ -42,13 +42,13 @@ public enum ClientChannelEvent {
EOF,
/**
* Received exit status from remote peer
*
*
* @see ClientChannel#getExitStatus()
**/
EXIT_STATUS,
/**
* Received exit signal from remote peer
*
*
* @see ClientChannel#getExitSignal()
*/
EXIT_SIGNAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public synchronized void write(byte[] buf, int s, int l) throws IOException {
} catch (InterruptedException e) {
throw (IOException) new InterruptedIOException(
"Interrupted while waiting for remote space on write len=" + l + " to " + this)
.initCause(e);
.initCause(e);
}
session.resetIdleTimeout();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static Result fromName(String name) {
/**
* Process an SSH request. If an exception is thrown, the ConnectionService will send a failure message if needed
* and the request will be considered handled.
*
*
* @param t The input parameter
* @param request The request string
* @param wantReply Whether a reply is requested
Expand Down
Loading

0 comments on commit ee26bdc

Please sign in to comment.