diff --git a/README.md b/README.md index b848836..8c303c1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ gulp-maven-deploy ================= -*** -**Warning** This readme contains changes for the upcoming 1.0.0 release. For using the 0.x versions, have a look into the [0.x support branch](https://github.com/micha149/gulp-maven-deploy/tree/support/0.x) -*** - A [Gulp](//gulpjs.com/) wrapper for the [maven-deploy](https://www.npmjs.org/package/maven-deploy) module. Enables you to have projects which are built with Gulp, but deploys to Maven repositories. [![Build Status](https://travis-ci.org/micha149/gulp-maven-deploy.svg?branch=master)](https://travis-ci.org/micha149/gulp-maven-deploy) @@ -13,7 +9,7 @@ A [Gulp](//gulpjs.com/) wrapper for the [maven-deploy](https://www.npmjs.org/pac [![NPM](https://nodei.co/npm/gulp-maven-deploy.png?stars=true&downloads=true)](https://npmjs.org/package/gulp-maven-deploy) -All the samples below require a basic understanding of [Gulp](//gulpjs.com/) and [Maven](http://maven.apache.org/). Please look at the documentation for those projects for details. +All the samples below require a basic understanding of [Gulp](//gulpjs.com/) and [Maven](http://maven.apache.org/). Please look at the documentation for those projects for details. This readme refers to 1.x versions. If you are still using the 0.x versions, have a look into the [0.x support branch](https://github.com/micha149/gulp-maven-deploy/tree/support/0.x). ## Installing diff --git a/package.json b/package.json index b17ecaf..c7f4b15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-maven-deploy", - "version": "1.0.0-beta.5", + "version": "1.0.0", "description": "Simple gulp plugin for the maven-deploy module", "main": "index.js", "scripts": { diff --git a/src/util/buildFileOptions.js b/src/util/buildFileOptions.js index fccf031..3d62415 100644 --- a/src/util/buildFileOptions.js +++ b/src/util/buildFileOptions.js @@ -5,10 +5,10 @@ module.exports = function(file, baseOptions) { // Ensure file to be of new vinyl version file = new File(file); - var fileOptions = assign({}, baseOptions, { + var fileOptions = assign({}, { artifactId: file.stem, type: file.extname.replace(/^\./, '') - }); + }, baseOptions); return fileOptions; }; diff --git a/test/deployTest.js b/test/deployTest.js index 43684cc..c2c2bc4 100644 --- a/test/deployTest.js +++ b/test/deployTest.js @@ -3,6 +3,7 @@ var plugin = require('../index.js'), sinon = require('sinon'), Vinyl = require('vinyl'), mavenDeploy = require('maven-deploy'), + assign = require('lodash.assign'), fs = require('fs'); /* globals describe: false, it: false, beforeEach: false, afterEach: false */ @@ -142,6 +143,23 @@ describe('gulp-maven-deploy plugin', function () { stream.end(); }); + it('uses provided artifactId', function (done) { + var config = assign({}, testConfig); + config.artifactId = 'file'; + var stream = plugin.deploy(config); + var expectedOptions = { + artifactId: 'file' + }; + + stream.on('finish', function() { + expect(mavenDeploy.config).to.be.calledWith(sinon.match(expectedOptions)); + done(); + }); + + stream.write(fileA); + stream.end(); + }); + it('removes temporary file when finished', function(done) { var stream = plugin.deploy(testConfig); diff --git a/test/installTest.js b/test/installTest.js index 7786955..1b37a2b 100644 --- a/test/installTest.js +++ b/test/installTest.js @@ -3,6 +3,7 @@ var plugin = require('../index.js'), sinon = require('sinon'), Vinyl = require('vinyl'), mavenDeploy = require('maven-deploy'), + assign = require('lodash.assign'), fs = require('fs'); /* globals describe: false, it: false, beforeEach: false, afterEach: false */ @@ -94,6 +95,23 @@ describe('gulp-maven-deploy plugin', function () { stream.end(); }); + it('uses provided artifactId', function (done) { + var config = assign({}, testConfig); + config.artifactId = 'file'; + var stream = plugin.install(config); + var expectedOptions = { + artifactId: 'file' + }; + + stream.on('finish', function() { + expect(mavenDeploy.config).to.be.calledWith(sinon.match(expectedOptions)); + done(); + }); + + stream.write(fileA); + stream.end(); + }); + it('ensures to work with old vinyl versions', function (done) { var stream = plugin.install(testConfig); var expectedOptions = {