Skip to content

Commit

Permalink
Refresh CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jan 8, 2022
1 parent 87e80df commit 4bd150d
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 111 deletions.
7 changes: 7 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.3</version>
</extension>
</extensions>
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
10 changes: 10 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* While this is not a plugin, it is much simpler to reuse the pipeline code for CI. This allows for
* easy Linux/Windows testing and produces incrementals. The only feature that relates to plugins is
* allowing one to test against multiple Jenkins versions.
*/
buildPlugin(useContainerAgent: true, configurations: [
[ platform: 'linux', jdk: '8' ],
[ platform: 'linux', jdk: '11' ],
[ platform: 'windows', jdk: '11' ]
])
144 changes: 46 additions & 98 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,93 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.70</version>
<relativePath />
</parent>

<groupId>org.jvnet.mock-javamail</groupId>
<artifactId>mock-javamail</artifactId>
<version>1.12-SNAPSHOT</version>
<version>${revision}${changelist}</version>
<packaging>jar</packaging>

<name>JavaMail mock objects</name>
<url>https://http://java.net/projects/mock-javamail</url>

<scm>
<connection>scm:svn:https://svn.java.net/svn/mock-javamail~svn/trunk/mock-javamail</connection>
<developerConnection>scm:svn:https://svn.java.net/svn/mock-javamail~svn/trunk/mock-javamail</developerConnection>
<url>https://java.net/projects/mock-javamail/sources/browse/mock-javamail</url>
</scm>
<url>https://github.com/jenkinsci/lib-${project.artifactId}</url>

<issueManagement>
<url>http://java.net/jira/browse/MOCK_JAVAMAIL</url>
</issueManagement>
<licenses>
<license>
<name>CDDL-1.0</name>
<url>https://opensource.org/licenses/CDDL-1.0</url>
<distribution>repo</distribution>
</license>
</licenses>

<mailingLists>
<mailingList>
<name>users list</name>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
<post>[email protected]</post>
<archive>http://java.net/projects/mock-javamail/lists/users/archive</archive>
</mailingList>
</mailingLists>

<repositories>
<repository>
<id>java.net</id>
<url>http://java.net/projects/maven2-repository</url>
<layout>legacy</layout>
</repository>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>

<distributionManagement>
<snapshotRepository>
<id>jvnet-nexus-snapshots</id>
<name>Java.net Nexus Snapshots Repository</name>
<url>https://maven.java.net/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>jvnet-nexus-staging</id>
<name>Java.net Nexus Staging Repository</name>
<url>https://maven.java.net/service/local/staging/deploy/maven2/</url>
</repository>
<site>
<id>local</id>
<url>svn:https://svn.java.net/svn/mock-javamail/trunk/www/</url>
</site>
</distributionManagement>
<properties>
<revision>1.12</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
<gitHubRepo>jenkinsci/lib-${project.artifactId}</gitHubRepo>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- TODO lots of violations -->
<spotbugs.threshold>High</spotbugs.threshold>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<configuration>
<jdkName>JDK1.5</jdkName>
<downloadSources>true</downloadSources>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>javax.mail</groupId>
Expand All @@ -97,26 +50,21 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8</version>
<scope>test</scope>
</dependency>
</dependencies>

<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<licenses>
<license>
<name>Common Development And Distribution License</name>
<url>http://www.sun.com/cddl/cddl.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
16 changes: 3 additions & 13 deletions src/main/java/org/jvnet/mock_javamail/Aliases.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -33,11 +34,8 @@ public synchronized static Aliases getInstance() throws MessagingException {
if (instance == null) {
Map<Address,Address> aliasMap = new HashMap<Address,Address>();
InputStream in = Aliases.class.getResourceAsStream("/META-INF/mock-javamail.aliases");
if (in == null) {

} else {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
if (in != null) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) {
String line;
while ((line = reader.readLine()) != null) {
int index = line.indexOf('=');
Expand All @@ -52,14 +50,6 @@ public synchronized static Aliases getInstance() throws MessagingException {
catch (IOException ex) {
throw new MessagingException("Unable to read alias file", ex);
}
finally {
try {
in.close();
}
catch (IOException ex) {
// Close silently
}
}
}
instance = new Aliases(aliasMap);
}
Expand Down

0 comments on commit 4bd150d

Please sign in to comment.