Skip to content
Merged
87 changes: 87 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ limitations under the License.
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
Expand Down Expand Up @@ -134,7 +149,79 @@ limitations under the License.
</systemProperties>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk9+</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-java-9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk10+</id>
<activation>
<jdk>[10,)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-java-10</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>10</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java10</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
27 changes: 27 additions & 0 deletions src/main/java/org/codehaus/plexus/util/BaseIOUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.codehaus.plexus.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
* Implementation specific to Java SE 8 version.
*/
abstract class BaseIOUtil
{
private static final int DEFAULT_BUFFER_SIZE = 1024 * 16;

static void copy( final InputStream input, final OutputStream output )
throws IOException
{
IOUtil.copy( input, output, DEFAULT_BUFFER_SIZE );
}

static void copy( final Reader input, final Writer output )
throws IOException
{
IOUtil.copy( input, output, DEFAULT_BUFFER_SIZE );
}
}
6 changes: 3 additions & 3 deletions src/main/java/org/codehaus/plexus/util/IOUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
* method variants to specify buffer size and encoding, each row may correspond to up to 4 methods.
*/

public final class IOUtil
public final class IOUtil extends BaseIOUtil
{
private static final int DEFAULT_BUFFER_SIZE = 1024 * 16;

Expand All @@ -156,7 +156,7 @@ private IOUtil()
public static void copy( final InputStream input, final OutputStream output )
throws IOException
{
copy( input, output, DEFAULT_BUFFER_SIZE );
BaseIOUtil.copy( input, output );
}

/**
Expand Down Expand Up @@ -186,7 +186,7 @@ public static void copy( final InputStream input, final OutputStream output, fin
public static void copy( final Reader input, final Writer output )
throws IOException
{
copy( input, output, DEFAULT_BUFFER_SIZE );
BaseIOUtil.copy( input, output );
}

/**
Expand Down
25 changes: 25 additions & 0 deletions src/main/java10/org/codehaus/plexus/util/BaseIOUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.codehaus.plexus.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
* Implementation specific to Java SE 10 version.
*/
abstract class BaseIOUtil
{
static void copy( final InputStream input, final OutputStream output )
throws IOException
{
input.transferTo( output );
}

static void copy( final Reader input, final Writer output )
throws IOException
{
input.transferTo( output );
}
}
27 changes: 27 additions & 0 deletions src/main/java9/org/codehaus/plexus/util/BaseIOUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.codehaus.plexus.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
* Implementation specific to Java SE 9 version.
*/
abstract class BaseIOUtil
{
private static final int DEFAULT_BUFFER_SIZE = 1024 * 16;

static void copy( final InputStream input, final OutputStream output )
throws IOException
{
input.transferTo( output );
}

static void copy( final Reader input, final Writer output )
throws IOException
{
IOUtil.copy( input, output, DEFAULT_BUFFER_SIZE );
}
}