aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Somov <public.somov@gmail.com>2016-02-27 21:40:14 +0100
committerAndrey Somov <public.somov@gmail.com>2016-02-27 21:40:14 +0100
commit80c0ebb5a9f21c7c6948431eaa03fa78e1e3e382 (patch)
treec61b5da6d986eea9173d1385128becb924d82928
parentacef7a2953778aeca78a5b64a96d0c4d44f74111 (diff)
parent41668438c9edf8da5669688f51c143102703ccf3 (diff)
downloadsnakeyaml-80c0ebb5a9f21c7c6948431eaa03fa78e1e3e382.tar.gz
Merge
-rw-r--r--pom.xml64
-rw-r--r--src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java41
2 files changed, 51 insertions, 54 deletions
diff --git a/pom.xml b/pom.xml
index cdd4c326..91886afa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,6 +9,9 @@
<project.scm.id>bitbucket</project.scm.id>
<release.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</release.repo.url>
<snapshot.repo.url>https://oss.sonatype.org/content/repositories/snapshots/</snapshot.repo.url>
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
</properties>
<name>SnakeYAML</name>
<description>YAML 1.1 parser and emitter for Java</description>
@@ -111,6 +114,11 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.5</version>
</plugin>
@@ -122,8 +130,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
@@ -210,7 +218,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.3</version>
<configuration>
<links>
<link>http://java.sun.com/javase/6/docs/api/</link>
@@ -323,7 +330,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.1</version>
<reportSets>
<reportSet>
<id>html</id>
@@ -343,32 +349,32 @@
</reporting>
<profiles>
<profile>
- <id>jdk8</id>
+ <id>toolchain</id>
<activation>
- <jdk>[1.8,)</jdk>
+ <file>
+ <exists>${user.home}/.m2/toolchains.xml</exists>
+ </file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <additionalparam>-Xdoclint:none</additionalparam>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>toolchain</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
- <reportPlugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <additionalparam>-Xdoclint:none</additionalparam>
- </configuration>
- </plugin>
- </reportPlugins>
+ <toolchains>
+ <jdk>
+ <version>${maven.compiler.target}</version>
+ </jdk>
+ </toolchains>
</configuration>
</plugin>
</plugins>
@@ -376,17 +382,13 @@
</profile>
<profile>
<id>with-java8-tests</id>
+ <properties>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ </properties>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
diff --git a/src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java b/src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java
index c6ca59bb..82f29ee7 100644
--- a/src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java
+++ b/src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java
@@ -76,32 +76,30 @@ public class ContextClassLoaderTest {
@Before
public void before() throws MalformedURLException {
Properties classpath = new Properties();
- InputStream cpProperties = getClass()
- .getResourceAsStream("classpath.properties");
+ InputStream cpProperties = getClass().getResourceAsStream("classpath.properties");
try {
classpath.load(cpProperties);
} catch (IOException e2) {
fail(e2.getLocalizedMessage());
}
- File runtimeClassesDir = new File(
- classpath.getProperty("runtime_classes_dir"));
+ File runtimeClassesDir = new File(classpath.getProperty("runtime_classes_dir"));
- yamlCL = new URLClassLoader(
- new URL[] { runtimeClassesDir.toURI().toURL() }, null);
+ yamlCL = new URLClassLoader(new URL[] { runtimeClassesDir.toURI().toURL() }, null);
}
@After
public void after() {
- if (yamlCL != null) {
- try {
- yamlCL.close();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- yamlCL = null;
- }
- }
+ // URLClassLoader.close is @since 1.7
+ // if (yamlCL != null) {
+ // try {
+ // yamlCL.close();
+ // } catch (IOException e) {
+ // e.printStackTrace();
+ // } finally {
+ yamlCL = null;
+ // }
+ // }
}
@Test(expected = ClassNotFoundException.class)
@@ -115,10 +113,9 @@ public class ContextClassLoaderTest {
}
@Test
- public void domainInDifferentConstructor()
- throws ClassNotFoundException, InstantiationException,
- IllegalAccessException, NoSuchMethodException, SecurityException,
- IllegalArgumentException, InvocationTargetException {
+ public void domainInDifferentConstructor() throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException, NoSuchMethodException,
+ SecurityException, IllegalArgumentException, InvocationTargetException {
Class<?> yamlClass = yamlCL.loadClass(Yaml.class.getName());
@@ -127,12 +124,10 @@ public class ContextClassLoaderTest {
Object yaml = yamlClass.newInstance();
- Method dumpMethod = yaml.getClass().getMethod("dump",
- new Class<?>[] { Object.class });
+ Method dumpMethod = yaml.getClass().getMethod("dump", new Class<?>[] { Object.class });
String dump = dumpMethod.invoke(yaml, bean).toString();
- Method loadMethod = yaml.getClass().getMethod("load",
- new Class<?>[] { String.class });
+ Method loadMethod = yaml.getClass().getMethod("load", new Class<?>[] { String.class });
DomainBean object = (DomainBean) loadMethod.invoke(yaml, dump);
assertEquals(bean, object);