Skip to content

Commit

Permalink
Merge pull request #2802 from batmat/JENKINS-42709
Browse files Browse the repository at this point in the history
[JENKINS-27624][JENKINS-42709] Bump Jenkins baseline to Java 8 minimum
  • Loading branch information
batmat committed Apr 4, 2017
2 parents df6528e + 067ba0e commit 09cfe3b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Expand Up @@ -38,8 +38,8 @@ for(i = 0; i < buildTypes.size(); i++) {
timeout(time: 180, unit: 'MINUTES') {
// See below for what this method does - we're passing an arbitrary environment
// variable to it so that JAVA_OPTS and MAVEN_OPTS are set correctly.
withMavenEnv(["JAVA_OPTS=-Xmx1536m -Xms512m -XX:MaxPermSize=1024m",
"MAVEN_OPTS=-Xmx1536m -Xms512m -XX:MaxPermSize=1024m"]) {
withMavenEnv(["JAVA_OPTS=-Xmx1536m -Xms512m",
"MAVEN_OPTS=-Xmx1536m -Xms512m"]) {
// Actually run Maven!
// The -Dmaven.repo.local=${pwd()}/.repository means that Maven will create a
// .repository directory at the root of the build (which it gets from the
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -771,7 +771,7 @@ THE SOFTWARE.
<configuration>
<forkCount>0.5C</forkCount>
<reuseForks>true</reuseForks>
<argLine>-XX:MaxPermSize=128m -noverify</argLine> <!-- some versions of JDK7/8 causes VerifyError during mock tests: http://code.google.com/p/powermock/issues/detail?id=504 -->
<argLine>-noverify</argLine> <!-- some versions of JDK7/8 causes VerifyError during mock tests: http://code.google.com/p/powermock/issues/detail?id=504 -->
<trimStackTrace>false</trimStackTrace> <!-- SUREFIRE-1226 workaround -->
</configuration>
</plugin>
Expand Down
1 change: 0 additions & 1 deletion core/src/build-script/Cobertura.groovy
Expand Up @@ -56,7 +56,6 @@ public class Cobertura {
}
sysproperty(key:"net.sourceforge.cobertura.datafile",value:ser)
sysproperty(key:"hudson.ClassicPluginStrategy.useAntClassLoader",value:"true")
jvmarg(value:"-XX:MaxPermSize=128m")
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Computer.java
Expand Up @@ -791,7 +791,7 @@ public List<AbstractProject> getTiedJobs() {
}

public RunList getBuilds() {
return RunList.fromJobs(Jenkins.getInstance().allItems(Job.class)).node(getNode());
return RunList.fromJobs((Iterable)Jenkins.getInstance().allItems(Job.class)).node(getNode());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/User.java
Expand Up @@ -655,7 +655,7 @@ private boolean relatedTo(@Nonnull AbstractBuild<?,?> b) {
@SuppressWarnings("unchecked")
@WithBridgeMethods(List.class)
public @Nonnull RunList getBuilds() {
return RunList.fromJobs(Jenkins.getInstance().allItems(Job.class)).filter(new Predicate<Run<?,?>>() {
return RunList.fromJobs((Iterable)Jenkins.getInstance().allItems(Job.class)).filter(new Predicate<Run<?,?>>() {
@Override public boolean apply(Run<?,?> r) {
return r instanceof AbstractBuild && relatedTo((AbstractBuild<?,?>) r);
}
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -96,7 +96,7 @@ THE SOFTWARE.
<findbugs.failOnError>true</findbugs.failOnError>
<test-annotations.version>1.2</test-annotations.version>

<java.level>7</java.level>
<java.level>8</java.level>

<changelog.url>https://jenkins.io/changelog</changelog.url>
</properties>
Expand Down Expand Up @@ -482,7 +482,7 @@ THE SOFTWARE.
<plugin>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-injector</artifactId>
<version>1.13</version>
<version>1.15</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -673,7 +673,7 @@ THE SOFTWARE.
<configuration>
<rules>
<requireJavaVersion>
<version>1.7.0</version>
<version>1.8.0</version>
</requireJavaVersion>
<requireMavenVersion>
<version>3.0</version>
Expand Down
2 changes: 1 addition & 1 deletion test/pom.xml
Expand Up @@ -213,7 +213,7 @@ THE SOFTWARE.
<artifactId>maven-surefire-plugin</artifactId>
<!-- version specified in grandparent pom -->
<configuration>
<argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx1g -XX:MaxPermSize=128m</argLine>
<argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx1g</argLine>
<systemPropertyVariables>
<!-- use AntClassLoader that supports predictable file handle release -->
<hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
Expand Down
Expand Up @@ -6,8 +6,10 @@
import java.io.IOException;

import hudson.EnvVars;
import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenModuleSetBuild;
import hudson.tasks.Maven.MavenInstallation;
import hudson.util.StreamTaskListener;

Expand Down Expand Up @@ -69,24 +71,23 @@ private void whenJenkinsMasterHasNoExecutors() throws IOException {
public void testMaven() throws Exception {
MavenModuleSet m = createSimpleMavenProject();

assertGetEnvironmentCallOutsideBuildWorks(m);
final MavenModuleSetBuild build = buildAndAssertSuccess(m);

assertGetEnvironmentWorks(build);
}

public void testFreestyle() throws Exception {
FreeStyleProject project = createFreeStyleProject();

assertGetEnvironmentCallOutsideBuildWorks(project);
final FreeStyleBuild build = buildAndAssertSuccess(project);

assertGetEnvironmentWorks(build);
}

public void testMatrix() throws Exception {
MatrixProject createMatrixProject = jenkins.createProject(MatrixProject.class, "mp");

assertGetEnvironmentCallOutsideBuildWorks(createMatrixProject);
}

@SuppressWarnings({"rawtypes", "unchecked"})
private void assertGetEnvironmentCallOutsideBuildWorks(AbstractProject job) throws Exception {
AbstractBuild build = buildAndAssertSuccess(job);
final MatrixBuild build = buildAndAssertSuccess(createMatrixProject);

assertGetEnvironmentWorks(build);
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/test/java/jenkins/util/JenkinsJVMRealTest.java
Expand Up @@ -17,7 +17,7 @@ public class JenkinsJVMRealTest {
public static JenkinsRule j = new JenkinsRule();

@Test
public void isJenkinsJVM() throws Exception {
public void isJenkinsJVM() throws Throwable {
assertThat(new IsJenkinsJVM().call(), is(true));
DumbSlave slave = j.createOnlineSlave();
assertThat(slave.getChannel().call(new IsJenkinsJVM()), is(false));
Expand Down

0 comments on commit 09cfe3b

Please sign in to comment.