Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LOGMGR-229] Upgrade parent pom from 26 to 31. Also remove unneeded M… #221

Merged
merged 1 commit into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,75 +93,10 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>java8-test-profile</id>
<activation>
<property>
<name>java8.home</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>java8-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<jvm>${java8.home}/bin/java</jvm>
<additionalClasspathElements>
<additionalClasspathElement>${java8.home}/lib/tools.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0-jboss-1</version>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>8</release>
<buildDirectory>${project.build.directory}</buildDirectory>
<compileSourceRoots>${project.compileSourceRoots}</compileSourceRoots>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>compile-java9</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<buildDirectory>${project.build.directory}</buildDirectory>
<compileSourceRoots>${project.basedir}/src/main/java9</compileSourceRoots>
<outputDirectory>${project.build.directory}/classes/META-INF/versions/9</outputDirectory>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -193,22 +128,6 @@
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
<executions>
<execution>
<id>default-test</id>
<configuration>
<excludes>
<exclude>**/*$*</exclude>
<!-- This test no longer applies on Java 9+ -->
<exclude>org/jboss/logmanager/formatters/FormattersTests.java</exclude>
</excludes>
<classesDirectory>${project.build.directory}/classes/META-INF/versions/9</classesDirectory>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.directory}/classes</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down
39 changes: 39 additions & 0 deletions core/src/test/java/org/jboss/logmanager/Environment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* JBoss, Home of Professional Open Source.
*
* Copyright 2018 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.jboss.logmanager;

/**
* A helper for tests with specific environment information.
*
* @author <a href="mailto:[email protected]">James R. Perkins</a>
*/
public class Environment {

/**
* Checks whether or not this is a modular JVM.
*
* @return {@code true} if this is a modular JVM (Java 9+), otherwise {@code false}
*
* @see JDKSpecific#isModularJvm()
*/
public static boolean isModularJvm() {
return JDKSpecific.isModularJvm();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@
import java.net.URLConnection;
import java.net.URLStreamHandler;

import org.jboss.logmanager.Environment;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;

public class FormattersTests {

@BeforeClass
public static void java8Only() {
Assume.assumeFalse(Environment.isModularJvm());
}

@Test
public void getJarName_jar() throws MalformedURLException {
String classResourceName = "org/alib/foo/Bar.class";
Expand Down
36 changes: 34 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>26</version>
<artifactId>jboss-parent-mr-jar</artifactId>
<version>31</version>
</parent>

<licenses>
Expand Down Expand Up @@ -148,4 +148,36 @@
</dependency>
</dependencies>
</dependencyManagement>

<profiles>
<!-- This profile is required to add the tools.jar to the class path for Java 8 for byteman -->
<profile>
<id>java8-test-tools</id>
<activation>
<jdk>[9,</jdk>
<property>
<name>java8.home</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>java8-test</id>
<phase>test</phase>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${java8.home}/lib/tools.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>