How to see changes without building maven project?

506 views Asked by At

I have simple java web application. web application has some js, css, html files. when I change js files, i am not able to view new changes in browser. For new changes i have to perform "mvn clean install" command then only i am able to see new changes. So Is there any way to see changes without performing this command ?

thanks.

1

There are 1 answers

0
mirlitone On

it's not recommended to perform "mvn clean install" unless you want to use your code into another project.

That's what I do when I want to publish code change into a webserver for debug purposes

1/ I configure tomcat7-maven-plugin into the parent pom project:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <version>2.2</version>
     </plugin>
    </plugins>
</build>

2/ then

mvn tomcat7:run 

will launch an embded tomcat7 server with your resources deployed.

to publish your code to a remote tomcat, you can use

tomcat7:deploy

after having configured tomcat7 plugin correctly

alternatively, import your maven project as an eclipse project (plugin name: m2e) then right click on the projet, debug on server will launch the eclipse configured tomcat. whenever you save a resource, it will be automagically deployed on the eclipse-managed tomcat.