Skip to content

Commit

Permalink
Merge pull request #42 from dheid/master
Browse files Browse the repository at this point in the history
Dependency updates, clean ups and refactorings
  • Loading branch information
jamesward committed Feb 21, 2022
2 parents 3211291 + a710a94 commit 6e657f6
Show file tree
Hide file tree
Showing 10 changed files with 465 additions and 222 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
charset = utf-8
max_line_length = 180
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false


11 changes: 11 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '36 5 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ This project provides a means to locate assets within WebJars.

[Check out the JavaDoc](https://javadocs.dev/org.webjars/webjars-locator-core/latest)

[![Build Status](https://travis-ci.com/webjars/webjars-locator-core.svg?branch=master)](https://travis-ci.com/webjars/webjars-locator-core) [![Latest Release](https://img.shields.io/maven-central/v/org.webjars/webjars-locator-core.svg)](https://mvnrepository.com/artifact/org.webjars/webjars-locator-core)
[![.github/workflows/test.yml](https://github.com/webjars/webjars-locator-core/actions/workflows/test.yml/badge.svg)](https://github.com/webjars/webjars-locator-core/actions/workflows/test.yml) [![Latest Release](https://img.shields.io/maven-central/v/org.webjars/webjars-locator-core.svg)](https://mvnrepository.com/artifact/org.webjars/webjars-locator-core)

Obtain the full path of an asset
--------------------------------
Expand Down
110 changes: 96 additions & 14 deletions pom.xml
@@ -1,5 +1,6 @@
<?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/xsd/maven-4.0.0.xsd">
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -14,6 +15,7 @@
<version>0.49-SNAPSHOT</version>
<name>webjars-locator-core</name>
<description>WebJar Locator Core functionality</description>
<inceptionYear>2012</inceptionYear>
<url>http://webjars.org</url>

<licenses>
Expand Down Expand Up @@ -41,10 +43,21 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.30</slf4j.version>
<springboot.version>2.5.0</springboot.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<slf4j.version>1.7.36</slf4j.version>
<springboot.version>2.6.3</springboot.version>
</properties>

<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/webjars/webjars-locator-core/issues</url>
</issueManagement>

<ciManagement>
<system>GitHub Actions</system>
<url>https://github.com/webjars/webjars-locator-core/actions</url>
</ciManagement>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -54,12 +67,18 @@
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.115</version>
<version>4.8.139</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.12.5</version>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -89,7 +108,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -188,12 +207,6 @@
<version>${springboot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>rxjs</artifactId>
Expand Down Expand Up @@ -234,10 +247,79 @@

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.21</version>
<configuration>
<checkTestClasses>true</checkTestClasses>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
</configuration>
<executions>
<execution>
<id>check-java-version-compatibility</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -253,7 +335,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.11</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/org/webjars/MultipleMatchesException.java
@@ -1,21 +1,25 @@
package org.webjars;

import java.util.List;
import javax.annotation.Nullable;

/**
* Thrown when a path matches multiple assets.
*/
public class MultipleMatchesException extends IllegalArgumentException {

private static final long serialVersionUID = -5499824108129968936L;

private final List<String> matches;

public MultipleMatchesException(final String message, List<String> matches) {
public MultipleMatchesException(@Nullable final String message, @Nullable List<String> matches) {
super(message);
this.matches = matches;
}

@Nullable
public List<String> getMatches() {
return matches;
return matches;
}

}
}
6 changes: 5 additions & 1 deletion src/main/java/org/webjars/NotFoundException.java
@@ -1,11 +1,15 @@
package org.webjars;

import javax.annotation.Nullable;

/**
* Thrown when a path matches multiple assets.
*/
public class NotFoundException extends IllegalArgumentException {

public NotFoundException(final String message) {
private static final long serialVersionUID = -3946078288741435789L;

public NotFoundException(@Nullable final String message) {
super(message);
}

Expand Down

0 comments on commit 6e657f6

Please sign in to comment.