micha149 / gulp-maven-deploy

Gulp wrapper for the maven-deploy plugin
MIT License
12 stars 11 forks source link

Plugin did not work as expected #8

Closed micha149 closed 8 years ago

micha149 commented 9 years ago

The gulp-maven-deploy plugin did not work as expected. When piping my files into the plugin, it get the following error:

Error: ENOENT, no such file or directory 'dist'

After looking into the plugins code and after that into the documentation of maven deploy, it seems that the plugin did not handle gulps files. When I write my files to disk and pass the folder as buildDiroption, I will get the expected result.

The streaming concept of gulp did not mean, that I have to write my files on disk and configure the buildDir option of the gulp task to deploy them. The Plugin should take the in coming stream of files and handle internally whats necessary to deploy an artifact with maven. What could mean: Take the files, write them into a temporary folder, do a maven deploy by passing this folder and delete the temporary files afterwards.

Would this not be a much better workflow?

leftieFriele commented 9 years ago

@micha149 your points seem valid, however I'm not going to rewrite the plugin as things stand right now. I'd be happy to add you as a contributor or you can take over the module if you want to, since I'm not working in a Java/Node environment anymore.

micha149 commented 9 years ago

I can implement this behavior, for sure. This may also affect #5 and #6 what would make a callback function for settings obsolete. I would prefer it as the default that incoming files are interpreted as artifacts and are deployed to the maven repository.

Compressing multiple files into a single artifact can be done with gulp-zip:

var deploy = require('gulp-maven-deploy').deploy;

gulp.task('publish', function () {
    return gulp.src('dist/*')
        .pipe(zip('myArtifact.war'))
        .pipe(deploy({
            groupId: 'com.mygroup',
            isSnapshot: true,
            repositories: [
                { id: 'some-repo-id', url: 'http://some-repo/url' }
            ]
        }));
});

A single callback function for the whole config seems to be a bit unusual. I would prefer callbacks for those properties were it make sense.


@leftieFriele If your have no interest for being involved in the future of this plugin, feel free to transfer it to me. I am interested to bring this plugin forward, because I expect we will have some more projects needing this plugin in the future.

leftieFriele commented 9 years ago

That sounds great, I'll transfer it to you and hope it continues to be of some value :)