Sublime Forum

Working with Tomcat and Maven

#1

Hello,

at work, we develop java applications and are using Eclipse. As Frontenddev I would like to switch completely to Sublime, but its missing a feature of Eclipse, I cant work without it.
When developing, I had to build the project with maven and publish it to a tomcat server. Eclipse does this all automatically and also republish changed files.
I came so far, building the app with maven and publish it to tomcat with the maven-tomcat plugin. But with Tomcat 7 republishing isn’t possible and changed files aren’t copied to the working directory. So I have to leave Eclipse open and refresh its workspace everytime I changed files in Sublime.

Would it be possible to integrate this functionality into Sublime?

0 Likes

#2

I’d like to know as well.
Currently I have to alternate between IntelliJ and ST.

0 Likes

#3

Did you ever find a solution? I’m struggling with this exact same problem.

0 Likes

#4

I would also be interested in finding a solution.

The current workflow of swapping between Eclipse (or Spring tool suite) and Sublime text is pretty irritating.

0 Likes

#5

True, but some people are forced to use windows but would still like to be able to do normal things like setting up a batch process that involves the usage of SublimeText. I have no choice but to use windows at work and often create dos batch scripts to help with repetitive tasks. Having good command line access to applications has saved me a lot of time and seriously reduced the risk of human error creeping into some daily tasks that I need to perform.

0 Likes

#6

I use a grunt watch task to handle a Spring Tools Maven project. Here is part of the code that updates the grunt run server (which is dependent on the STS tc server). Just Google “grunt watch” for guidelines on setting up something like this.

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            less: {
                files: '<%= config.app %>/styles/{,*/}*.less', '<%= config.app %>/bower_components/{,*/}*.{less}'],
                tasks: 'less:server','buildBootstrap','autoprefixer']
            },
            bower: {
                files: 'bower.json'],
                tasks: 'bowerInstall']
            },
            js: {
                files: '<%= config.app %>/js/**/*.js'],
                tasks: 'jshint'],
                options: {
                    livereload: true
                }
            },
            jstest: {
                files: 'test/spec/{,*/}*.js'],
                tasks: 'test:watch']
            },
            gruntfile: {
                files: 'Gruntfile.js']
            },
            styles: {
                files: '<%= config.app %>/styles/**/*.css'],
                tasks: 'copy:styles', 'copy:vendorstyles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: 
                    '<%= config.app %>/templates/**/*.html',
                    '.tmp/styles/{,*/}*.css',
                    '<%= config.app %>/images/{,*/}*',
                    '{.tmp,<%= config.app %>}/scripts/**/*.js',
                ]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                open: true,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return 
                            connect.static('.tmp'),
                            connect().use('/<%= config.app %>/bower_components', connect.static('./<%= config.app %>/bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            test: {
                options: {
                    open: false,
                    port: 9001,
                    middleware: function(connect) {
                        return 
                            connect.static('.tmp'),
                            connect.static('test'),
                            connect().use('/<%= config.app %>/bower_components', connect.static('./<%= config.app %>/bower_components')),
                            connect().use('/<%= config.app %>/test/bower_components', connect.static('./<%= config.app %>/test/bower_components')),
                            connect.static(config.app)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    base: '<%= config.dist %>',
                    livereload: false
                }
            }
        },
0 Likes