From 5d798317e49fd15ac4f5e1d7c92865b74e258660 Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Tue, 26 Feb 2019 16:13:39 +0100 Subject: [PATCH 1/6] Fix dependencies (remove Grunt, update Maven dependencies), fix Travis build --- .gitignore | 4 ++- .travis.yml | 6 ++-- Gruntfile.js | 18 ---------- package-lock.json | 14 ++++++++ package.json | 6 ++-- pom.xml | 91 ++++++++++++++++++----------------------------- 6 files changed, 57 insertions(+), 82 deletions(-) delete mode 100644 Gruntfile.js create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 4de0f79..468d82b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ /node_modules /bower_components /release.properties -/pom.xml.releaseBackup \ No newline at end of file +/pom.xml.releaseBackup +*.iml +.idea \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 88ccde2..5af472f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: java jdk: - - oraclejdk7 - - openjdk6 \ No newline at end of file + - oraclejdk8 + - oraclejdk11 + - openjdk10 + - openjdk11 \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index db99085..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = function (grunt) { - - grunt.initConfig({ - bower_postinst: { - all: { - options: { - components: { - 'js-cookie': ['npm', 'grunt'] - } - } - } - } - }); - - grunt.loadNpmTasks('grunt-bower-postinst'); - - grunt.registerTask('default', ['bower_postinst']); -}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..68eb935 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "java-cookie", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "bower": { + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/bower/-/bower-1.8.8.tgz", + "integrity": "sha512-1SrJnXnkP9soITHptSO+ahx3QKp3cVzn8poI6ujqc5SeOkg5iqM1pK9H+DSc2OQ8SnO0jC/NG4Ur/UIwy7574A==", + "dev": true + } + } +} diff --git a/package.json b/package.json index 4edcf21..cffb38a 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,12 @@ { "name": "java-cookie", "version": "1.0.0", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/js-cookie/java-cookie.git" }, "devDependencies": { - "bower": "1.4.1", - "grunt": "0.4.5", - "grunt-bower-postinst": "0.2.1", - "grunt-cli": "0.1.13" + "bower": "1.8.8" } } diff --git a/pom.xml b/pom.xml index d5637e3..65a0590 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 com.github.js-cookie java-cookie @@ -35,8 +36,8 @@ - RedHat - https://maven.repository.redhat.com/earlyaccess/all + RedHat GA + https://maven.repository.redhat.com/ga/ @@ -64,13 +65,12 @@ - - org.jboss.arquillian - arquillian-bom - 1.1.8.Final - import - pom - + + org.jboss.arquillian + arquillian-bom + 1.4.1.Final + pom + @@ -83,12 +83,12 @@ joda-time joda-time - 2.7 + 2.10.1 com.fasterxml.jackson.core jackson-databind - 2.8.11.1 + 2.9.8 junit @@ -123,25 +123,32 @@ org.jboss.arquillian.junit arquillian-junit-container + 1.4.1.Final test org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-bom - 2.2.0-beta-2 - pom - import + shrinkwrap-resolver-impl-maven + 3.1.3 + test org.apache.httpcomponents httpclient - 4.3.3 + 4.5.7 test org.apache.httpcomponents fluent-hc - 4.3.3 + 4.5.7 + test + + + org.jboss.as + jboss-as-dist + 7.5.7.Final-redhat-3 + pom test @@ -153,30 +160,6 @@ - - maven-dependency-plugin - - - unpack - process-test-classes - - unpack - - - - - org.jboss.as - jboss-as-dist - 7.5.0.Final-redhat-15 - zip - false - target - - - - - - org.codehaus.mojo failsafe-maven-plugin @@ -193,22 +176,22 @@ com.github.eirslett frontend-maven-plugin - 0.0.23 + 1.5 install node and npm - install-node-and-npm + install-node-and-npm - v0.10.18 - 1.3.8 + v11.10.0 + 6.8.0 npm install - npm + npm @@ -217,12 +200,6 @@ bower - - grunt build - - grunt - - @@ -245,7 +222,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.3 + 3.0.1 attach-javadocs @@ -258,7 +235,7 @@ org.apache.maven.plugins maven-source-plugin - 2.4 + 3.0.1 attach-sources @@ -271,7 +248,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.5 + 1.6.8 true ossrh @@ -300,4 +277,4 @@ simple - + \ No newline at end of file From c16727be4de5e1c4f0b5403456d2a62e20a58c6e Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Wed, 27 Feb 2019 16:16:48 +0100 Subject: [PATCH 2/6] Extend JDK versions to all available on Travis --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5af472f..2ba37be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,16 @@ language: java +addons: + apt: + packages: + - openjdk-6-jdk + jdk: - oraclejdk8 + - oraclejdk9 - oraclejdk11 + - openjdk6 + - openjdk7 + - openjdk8 - openjdk10 - openjdk11 \ No newline at end of file From 5b8bd1a91a083f3d9dd93c153495467a4e8f9ed4 Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Wed, 27 Feb 2019 16:18:38 +0100 Subject: [PATCH 3/6] Fix integration tests - Updated to a recent version of Wildfly (15.0.1.Final) - Works out-of-the-box with `mvn verify` - All dependencies like node, npm, bower are used as specified in pom.xml - Run `npm install` in js-cookie (installed via bower) to use qunit.js and qunit.css in IT --- package.json | 3 ++ pom.xml | 62 +++++++++++++++++++++++++------ src/test/resources/arquillian.xml | 8 ++-- src/test/resources/web.xml | 17 +++++---- 4 files changed, 67 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index cffb38a..81a3c55 100644 --- a/package.json +++ b/package.json @@ -8,5 +8,8 @@ }, "devDependencies": { "bower": "1.8.8" + }, + "scripts": { + "test": "cd bower_components/js-cookie && ../../node/node \"../../node/node_modules/npm/bin/npm-cli.js\" install" } } diff --git a/pom.xml b/pom.xml index 65a0590..aade83c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,8 @@ UTF-8 UTF-8 - 2.45.0 + 3.141.59 + 15.0.1.Final java-cookie-scm @@ -69,6 +70,7 @@ org.jboss.arquillian arquillian-bom 1.4.1.Final + import pom @@ -115,9 +117,9 @@ test - org.jboss.as - jboss-as-arquillian-container-managed - 7.2.0.Final + org.jboss.arquillian.protocol + arquillian-protocol-servlet + 1.4.1.Final test @@ -126,12 +128,24 @@ 1.4.1.Final test + + org.wildfly.arquillian + wildfly-arquillian-container-managed + 2.1.1.Final + test + org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven 3.1.3 test + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-spi + 3.1.3 + test + org.apache.httpcomponents httpclient @@ -144,13 +158,6 @@ 4.5.7 test - - org.jboss.as - jboss-as-dist - 7.5.7.Final-redhat-3 - pom - test - @@ -160,6 +167,30 @@ + + maven-dependency-plugin + + + unpack + process-test-classes + + unpack + + + + + org.wildfly + wildfly-dist + ${wildfly.version} + zip + false + target + + + + + + org.codehaus.mojo failsafe-maven-plugin @@ -200,6 +231,15 @@ bower + + npm test + + npm + + + test + + diff --git a/src/test/resources/arquillian.xml b/src/test/resources/arquillian.xml index a751238..299cfe4 100644 --- a/src/test/resources/arquillian.xml +++ b/src/test/resources/arquillian.xml @@ -1,11 +1,11 @@ - + - target/jboss-eap-6.4 + target/wildfly-15.0.1.Final -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n diff --git a/src/test/resources/web.xml b/src/test/resources/web.xml index 72a6fb8..958c662 100644 --- a/src/test/resources/web.xml +++ b/src/test/resources/web.xml @@ -9,12 +9,13 @@ encoding /encoding - - multiple-set-cookie - com.github.jscookie.javacookie.test.integration.write.MultipleSetCookieServlet - - - multiple-set-cookie - /multiple-set-cookie - + + + + + + + + + From 8057635b8f3f27756efc9a5d0398007798ef0ebb Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Wed, 27 Feb 2019 16:27:51 +0100 Subject: [PATCH 4/6] JDK6 and JDK7 fail on Travis, require JDK8 --- .travis.yml | 7 ------- README.md | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ba37be..4de9bac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,9 @@ language: java -addons: - apt: - packages: - - openjdk-6-jdk - jdk: - oraclejdk8 - oraclejdk9 - oraclejdk11 - - openjdk6 - - openjdk7 - openjdk8 - openjdk10 - openjdk11 \ No newline at end of file diff --git a/README.md b/README.md index 2c07b77..b4d9ac8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple Java API for handling cookies -* Supports Java 6+, Servlet 2.2+ +* Supports Java 8+, Servlet 2.2+ * [Unobtrusive](#json-data-binding) JSON Data Binding support * [RFC 6265](http://www.rfc-editor.org/rfc/rfc6265.txt) compliant * Enable [custom decoding](#converter) From 590619d58410b2559b250ae791b2b395b1869329 Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Thu, 28 Feb 2019 07:57:41 +0100 Subject: [PATCH 5/6] Remove configuration for missing test --- src/test/resources/web.xml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/test/resources/web.xml b/src/test/resources/web.xml index 958c662..fd34de0 100644 --- a/src/test/resources/web.xml +++ b/src/test/resources/web.xml @@ -1,5 +1,6 @@ - + encoding @@ -9,13 +10,4 @@ encoding /encoding - - - - - - - - - From 5f9fb26ee0d7eaf68fdfbfba451b7ce8316d9cd5 Mon Sep 17 00:00:00 2001 From: Thomas Lutz Date: Thu, 28 Feb 2019 09:59:50 +0100 Subject: [PATCH 6/6] Update CONTRIBUTING guidelines, remove grunt, update Tools --- CONTRIBUTING.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f12362..db56ab2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,7 @@ - If reporting a bug, please add a [simplified example](http://sscce.org/). ## Pull requests + - Create a new topic branch for every separate change you make. - Create a test case if you are fixing a bug or implementing an important feature. - Make sure the build runs successfully [(see below)](#development). @@ -11,15 +12,17 @@ ## Development ### Tools + We use the following tools for development: - [Maven](https://maven.apache.org/) for Java Build. -- [NodeJS](http://nodejs.org/download/) required to run grunt. -- [Grunt](http://gruntjs.com/getting-started) for JavaScript task management. +- [NodeJS](https://nodejs.org/en/download/) used for NPM (installed by Maven automatically). +- [NPM](https://www.npmjs.com) used to install Bower (installed by Maven automatically). +- [Bower](https://bower.io) used to get [js-cookie](https://github.com/js-cookie/js-cookie/) for Integration tests (installed by NPM automatically). + ### Getting started -Install [NodeJS](http://nodejs.org/). Install [Maven](https://maven.apache.org/download.cgi) and add `mvn` as a global alias to run the `/bin/mvn` command inside Maven folder. Browse to the project root directory and run the build: @@ -33,6 +36,7 @@ After the build completes, you should see the following message in the console: ---------------------------------------------------------------------------- ### Unit tests + To run the unit tests, execute the following command: $ mvn test @@ -41,7 +45,7 @@ To run the unit tests, execute the following command: If you want to debug the integration tests in the browser, switch `Debug.FALSE` to `Debug.TRUE` in `CookiesEncodingIT.java` and run the build: - $ mvn install + $ mvn verify [Arquillian](http://arquillian.org/) will start the server, [Selenium](http://www.seleniumhq.org/) will run the tests in Firefox, but the build will hang to allow debugging in the browser.