allegro / grunt-maven-plugin

Grunt + Maven integration done right
Other
213 stars 32 forks source link

Eclipse configuration for "integrated workflow" #11

Closed koraysels closed 10 years ago

koraysels commented 11 years ago

Some of my colleagues use eclipse to run our project and since we switched to grunt for compiling our js and less they no longer have css and js in their browser.

The problem is that eclipse does not use the target/ to deploy to tomcat..

targetMaven: { // copy dist files to exploded WAR target
                files: [
                    { expand: true, cwd: './dist', src: ['./**'], dest: '../target/<war_name>/' }
                ]
            }

In the readme.md from this repo it says that eclipse needs extra configuring but I can not find what to do! This is really breaking progress because all people that are using eclipse do not have javascript or css in our webapp..

adamdubiel commented 11 years ago

Ah, Eclipse and it's custom wrappers.. hardly anyone in my company uses Eclipse, so i haven't tested it nor tried to find any workarounds for it. I would have to spend some time on crunching quirks of Eclipse to come up with special version of integrated flow. Since i have never really used Eclipse, maybe there are some people in your team that would be willing to help with this?

koraysels commented 11 years ago

I might have some kind of a solution but this is actually a "hack".. This is a very naive approach assuming everybody on windows is using eclipse

targetMaven: { // copy dist files to exploded WAR target
                files: [
                    { expand: true, cwd: './dist', src: ['./**'], dest: '../target/<war_name>/' }
                ]
            },
            targetEclipse: { // copy dist files to eclipse's wacky structure
                files: [
                    { expand: true, cwd: './dist', src: ['./**'], dest: '../target/' } //notice no <war_name> here
                ]
            }
   grunt.registerTask('copyPlatformSpecific', 'A nice task with two subtasks', function () {
        grunt.log.writeln("================COPY PROCESS==================== ");
        grunt.log.writeln("The platform you're working on is " + process.platform);
        if (process.platform.indexOf("win") != -1 && process.platform.indexOf("darwin") == -1) {
            grunt.log.writeln("Targetting Eclipse");
            grunt.task.run('copy:targetEclipse');
        } else {
            grunt.log.writeln("Targetting regular Maven directory structure");
            grunt.task.run('copy:targetMaven');
        }
        grunt.log.writeln("================================================ ");
    });

maybe in the future I will set the IDE in a json file and import it in grunt like "pkg" ..

adamdubiel commented 11 years ago

Hm, maybe some IDE-pluggable tasks is a way? I will think about ways of implementing it, might be a nice way to contain eclipse wackiness in one place. If you happen have any new thoughts on this, please comment. I can't commit to any release date though (but this month seems realistic).

adamdubiel commented 10 years ago

Okay, so i have some vision and done some hacking on it already. What now exists as "integrated workflow" only in README will be transformed into Grunt task. All paths and properties will be configurable, most defaults will be transfered from application pom.xml using bit of magic. Now i'm just trying to figure out where to hook potential IDE-specific settings, but that should be the easier part. I should be done with it after Xmass.

adamdubiel commented 10 years ago

I just released 1.1.0 version, there are some hints on how to deal with Eclipse, but i don't know much about inner Eclipse stuff. Could you try to configure grunt-maven-plugin to work with Eclipse using hints from README?

koraysels commented 10 years ago

I will try this in the new year, right now I made a custom config.json File where the user writes it's IDE and it will be loaded in to a global variable so the grunt processes will know where to copy the resources. Thank you for the update! Will definitely let you know if it does the job!

adamdubiel commented 10 years ago

Hey, any feedback on this issue? Or can i just close it :)

koraysels commented 10 years ago

I have not tested the new approach yet, It might work, but we couldn't wait as I said in my previous comment;-) maybe in our next project we might test it! So I will close this for now , Thanks!