diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..bc54a723 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,54 @@ +# Declare text files with unix file ending +*.conf text eol=lf +*.config text eol=lf +*.css text eol=lf +*.dtd text eol=lf +*.esp text eol=lf +*.ecma text eol=lf +*.groovy text eol=lf +*.hbrs text eol=lf +*.hbs text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.java text eol=lf +*.jpage text eol=lf +*.js text eol=lf +*.json text eol=lf +*.jsp text eol=lf +*.mustache text eol=lf +*.tld text eol=lf +*.launch text eol=lf +*.log text eol=lf +*.php text eol=lf +*.pl text eol=lf +*.project text eol=lf +*.properties text eol=lf +*.props text eol=lf +*.sass text eol=lf +*.scss text eol=lf +*.sh text eol=lf +*.shtm text eol=lf +*.shtml text eol=lf +*.sql text eol=lf +*.svg text eol=lf +*.txt text eol=lf +*.vm text eol=lf +*.xml text eol=lf +*.xsd text eol=lf +*.xsl text eol=lf +*.xslt text eol=lf +*.yml text eol=lf +*.yaml text eol=lf + + +# Declare windows-specific text files with windows file ending +*.asp text eol=crlf +*.asax text eol=crlf +*.asa text eol=crlf +*.aspx text eol=crlf +*.bat text eol=crlf +*.cmd text eol=crlf +*.cs text eol=crlf +*.csproj text eol=crlf +*.reg text eol=crlf +*.sln text eol=crlf diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100644 index 00000000..6fc0b2ad --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,34 @@ +# Build validation + +name: Build + +on: + push: + branches: + - develop + pull_request: + workflow_dispatch: + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + java: [17] + os: [ubuntu-latest] + distribution: [temurin] + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup JDK + uses: actions/setup-java@v5 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: maven + + - name: Build and verify + run: mvn -Pcontinuous-integration -B -U clean verify diff --git a/.github/workflows/maven-deploy.yml b/.github/workflows/maven-deploy.yml new file mode 100644 index 00000000..e218c2bd --- /dev/null +++ b/.github/workflows/maven-deploy.yml @@ -0,0 +1,31 @@ +# Deploy snapshots to Sonatype OSS repository and deploy site to GitHub Pages + +name: Deploy + +on: + push: + branches: + - develop + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup JDK + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + cache: maven + + - name: Build, verify, deploy + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + run: mvn -Pcontinuous-integration -B -U clean deploy diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index c8aeb3a2..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn -B package --file pom.xml diff --git a/.gitignore b/.gitignore index a9fa1aee..cb0de5f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,34 @@ -*.class -*~ -.*.swp -.*.swo -.loadpath -.buildpath +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +maven-eclipse.xml +infinitest.filters + +node_modules/ +npm-debug.log + +.nodejs .project -.settings .classpath -.metadata -.springBeans +.settings +.externalToolBuilders +.pmd +.eclipse-pmd +.checkstyle .idea +.vagrant *.iml -*.ipr -*.iws -git.properties -*.log -.checkstyle -nbproject .DS_Store -target -test-output -nbactions.xml -build -release.properties -**/pom.xml.backup -**/release.properties -**/pom.xml.branch -**/pom.xml.next -**/pom.xml.releaseBackup -**/pom.xml.tag -atlassian-ide-plugin.xml +*.retry +.rubygems +.sass-cache +.rubygems-gem-maven-plugin +*.sublime-* +*nbactions*.xml +.temp/ +.vlt +.vlt-sync* +.brackets.json diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0190d89c..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "uritemplate-test"] - path = uritemplate-test -url=https://github.com/damnhandy/uritemplate-test.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b6c371a9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -dist: trusty -language: java -jdk: -# - openjdk7 -# - oraclejdk7 disabling due to the container not being able to set JAVA_HOME correctly - - oraclejdk8 - - openjdk8 - - oraclejdk11 -sudo: false -install: ./mvnw clean -script: ./mvnw install site -notifications: - email: false -before_install: - - git submodule update --init --recursive diff --git a/LICENSE.txt b/LICENSE similarity index 97% rename from LICENSE.txt rename to LICENSE index 308a5a55..5c304d1a 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,11 +1,4 @@ -Copyright (c) 2012, Ryan J. McDonough -All rights reserved. - -==================================================================== -Licensed under the Apache License, Version 2.0. Text as follows. - - - Apache License +Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -185,7 +178,7 @@ Licensed under the Apache License, Version 2.0. Text as follows. APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" + boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -193,7 +186,7 @@ Licensed under the Apache License, Version 2.0. Text as follows. same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -205,4 +198,4 @@ Licensed under the Apache License, Version 2.0. Text as follows. 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. \ No newline at end of file + limitations under the License. diff --git a/README.md b/README.md index a2fb3a89..739a153f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ -# Handy URI Templates +# wcm.io Caravan Handy URI Templates +[![Build](https://github.com/wcm-io-caravan/wcm-io-handy-uri-templates/actions/workflows/maven-build.yml/badge.svg?branch=develop)](https://github.com/wcm-io-caravan/wcm-io-handy-uri-templates/actions?query=workflow%3ABuild+branch%3Adevelop) +[![Maven Central](https://img.shields.io/maven-central/v/io.wcm.caravan/wcm-io-handy-uri-templates)](https://repo1.maven.org/maven2/io/wcm/caravan/wcm-io-handy-uri-templates/) -[![Join the chat at https://gitter.im/damnhandy/Handy-URI-Templates](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/damnhandy/Handy-URI-Templates?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://secure.travis-ci.org/damnhandy/Handy-URI-Templates.png?branch=master)](http://travis-ci.org/damnhandy/Handy-URI-Templates) +> [!NOTE] +> This project is a fork of [Handy URI Templates](https://github.com/damnhandy/Handy-URI-Templates) originally developed by Ryan McGeary. +> We are grateful for the original implementation, which served as the foundation for this work. +> +> This fork fixes compatibility issues with JDK 21+ environments and otherwise can be used as drop-in replacement. -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.damnhandy/handy-uri-templates/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.damnhandy/handy-uri-templates) Handy URI Templates is a uritemplate processor implementing [RFC6570](http://tools.ietf.org/html/rfc6570) written in Java. If you are looking for a non-Java implementation, please check the [RFC6570 implementations page](http://code.google.com/p/uri-templates/wiki/Implementations). The current implementation is based on the final release of the uri template spec. The template processor supports the following features: @@ -20,13 +24,9 @@ Handy URI Templates is a uritemplate processor implementing [RFC6570](http://too As of version `1.1.1`, Handy URI Templates passes all tests defined by the [uritemplate-test](https://github.com/uri-templates/uritemplate-test) suite. -You can view [code coverage here](https://damnhandy.github.io/Handy-URI-Templates/cobertura/). - -The complete [JavaDocs are here](http://damnhandy.github.io/Handy-URI-Templates/apidocs/). - ## API Documentation -JavaDocs are available on [Javadocs.io](http://www.javadoc.io/doc/com.damnhandy/handy-uri-templates) +JavaDocs are available on [Javadocs.io](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates) ## Maven @@ -34,37 +34,13 @@ To use the latest version of Handy URI Templates, you need to add the following ```xml - com.damnhandy - handy-uri-templates - 2.1.7 - -``` - -The next version of Handy URI Templates includes some big changes to the API. If you want to be daring, you can use the `SNAPSHOT` release: - -```xml - - com.damnhandy - handy-uri-templates - 2.1.8-SNAPSHOT + io.wcm.caravan + wcm-io-handy-uri-templates + ``` - -In order to use a SNAPSHOT release, you'll have to add the Sonatype snapshots repository: - -```xml - - sonatype-nexus-snapshots - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - -``` - -You can also download the artifact directly at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Chandy-uri-templates) - - ## Basic Usage Using the library is simple: @@ -121,13 +97,13 @@ When `Request.getUrl()` is called, it will return: "https://api.github.com/repos/damnhandy/Handy-URI-Templates/commits" -Please have a look at the example [test case](https://github.com/damnhandy/Handy-URI-Templates/blob/master/src/test/java/com/damnhandy/uri/template/examples/TestGitHubApis.java) for more details. +Please have a look at the example [test case](https://github.com/wcm-io-caravan/wcm-io-handy-uri-templates/blob/develop/src/test/java/com/damnhandy/uri/template/examples/TestGitHubApis.java) for more details. Usage with the [Apache HTTP Client](http://hc.apache.org/httpcomponents-client-ga/index.html) is just as similar. ## Supported Value Types -While the `set()` method of the [UriTemplate](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/UriTemplate.html) accepts any Java object, the following Java types are preferred: +While the `set()` method of the [UriTemplate](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/UriTemplate.html) accepts any Java object, the following Java types are preferred: * Primitive and Object types such as: * int & Integer @@ -166,9 +142,9 @@ The URI Template spec supports [composite values](http://tools.ietf.org/html/rfc ## POJOs as Composite Values -The template processor can treat simple Java objects as composite value. When a POJO is set on a template variable and the variable specifies the an explode modifier "*", a [VarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/VarExploder.html) is invoked. The purpose of the `VarExploder` is to expose the object properties as name/value pairs. +The template processor can treat simple Java objects as composite value. When a POJO is set on a template variable and the variable specifies the an explode modifier "*", a [VarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/VarExploder.html) is invoked. The purpose of the `VarExploder` is to expose the object properties as name/value pairs. -For most use cases, the [DefaultVarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/DefaultVarExploder.html) should be sufficient. The `DefaultVarExploder` is a VarExploder implementation that takes in a Java object and extracts the properties for use in a URI Template. This class is called by default when a POJO is passed into the UriTemplate and the explode modifier is present on the variable. Given the following URI template expression: +For most use cases, the [DefaultVarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/DefaultVarExploder.html) should be sufficient. The `DefaultVarExploder` is a VarExploder implementation that takes in a Java object and extracts the properties for use in a URI Template. This class is called by default when a POJO is passed into the UriTemplate and the explode modifier is present on the variable. Given the following URI template expression: /mapper{?address*} @@ -187,7 +163,7 @@ The expanded URI will be: /mapper?city=Newport%20Beach&state=CA -The [DefaultVarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/DefaultVarExploder.html) breaks down the object properties as follows: +The [DefaultVarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/DefaultVarExploder.html) breaks down the object properties as follows: * All properties that contain a non-null return value will be included * Getters or fields annotated with `@UriTransient` will be excluded @@ -197,7 +173,7 @@ The [DefaultVarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs Please refer to the JavaDoc for more details on how the `DefaultVarExploder` works. -Should the [DefaultVarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/DefaultVarExploder.html) not be suitable for your needs, custom [VarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/VarExploder.html) implementations can be added by rolling your own implementation. A custom VarExploder implementation can be used by wrapping your object in your implementation: +Should the [DefaultVarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/DefaultVarExploder.html) not be suitable for your needs, custom [VarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/VarExploder.html) implementations can be added by rolling your own implementation. A custom VarExploder implementation can be used by wrapping your object in your implementation: ```java UriTemplate.fromTemplate("/mapper{?address*}") @@ -205,7 +181,7 @@ UriTemplate.fromTemplate("/mapper{?address*}") .expand(); ``` -Note: All [VarExploder](http://damnhandy.github.com/Handy-URI-Templates/apidocs/com/damnhandy/uri/template/VarExploder.html) implementations are ONLY invoked when the explode modifier "*" is declared in the URI Template expression. If the variable declaration does not specify the explode modifier, an exception is raised. +Note: All [VarExploder](http://www.javadoc.io/doc/io.wcm.caravan/wcm-io-handy-uri-templates/latest/com/damnhandy/uri/template/VarExploder.html) implementations are ONLY invoked when the explode modifier "*" is declared in the URI Template expression. If the variable declaration does not specify the explode modifier, an exception is raised. License ------- diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 3a04c231..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Maven -# Build your Java project and run tests with Apache Maven. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/java - -trigger: -- master - -pool: - vmImage: 'Ubuntu-16.04' - -steps: -- task: Maven@3 - inputs: - mavenPomFile: 'pom.xml' - mavenOptions: '-Xmx3072m' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - jdkArchitectureOption: 'x64' - publishJUnitResults: false - testResultsFiles: '**/surefire-reports/TEST-*.xml' - goals: 'package' diff --git a/buildtools/bin/submodule.sh b/buildtools/bin/submodule.sh deleted file mode 100644 index 1b0c74c9..00000000 --- a/buildtools/bin/submodule.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -git submodule update --init --recursive \ No newline at end of file diff --git a/config/checkstyle.xml b/config/checkstyle.xml deleted file mode 100644 index 71155689..00000000 --- a/config/checkstyle.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/eclipse/code-format.xml b/config/eclipse/code-format.xml deleted file mode 100755 index 080378f6..00000000 --- a/config/eclipse/code-format.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/eclipse/code-template.xml b/config/eclipse/code-template.xml deleted file mode 100755 index bf845755..00000000 --- a/config/eclipse/code-template.xml +++ /dev/null @@ -1,32 +0,0 @@ - -