Sunday 15 August 2010

Eclipse on-click deploy to remote Tomcat -


I'm looking for all this internet and I can not find an easy way to do this.

What I need is really simple and I believe many of you already do this: - I develop Java web applications in Eclipse and my team will do the same. is; - We have a Settlement 7 server running on a Ubuntu machine which acts as a centralized dev environment; - I want to click on a Deployment button instead of exporting the war and manually uploading it to the server and sending new data to the server and reloading it.

So far it seems that the only way to do this is with the Maven Plugin for Eclipse, which uses Tomcat's manager / HTML interface.

Problem: I can not get it to work, but in some way I am not able to walk straight through it, which tells how to do it. I am not even experiencing with Eclipse or Linux, but the configuration of the local Tomato server is very clear. I do not understand why setting up a remote is so difficult.

Would you please explain in detail how to do this? Thank you in advance for your patience.

Yes, you can use the Tomcat 7 Maven plugin. Here are the steps:

1) Install Maven integration for eclipse (M2 Eclipse) from Eclipse Marketplace.

1.1) Navigate help - & gt; Eclipse Marketplace and Search "Meven Integration for Eclipse"

2) With Eclipse, create a Maven project.

2.1) Go to File - & gt; New - & gt; Project ... - & gt; Maven - & gt; Maven Project

2.2) Click next (leave all fields by default).

2.3) Select "maven-archetype-webapp" and click Next.

2.4) Enter the arbitrary value on the Group ID and Artifact ID (for example, "Group for" Org.myorg "for Group ID and" myapp "for Arfact ID) and click Finish (you can add your project's Will see pom.xml in the root.)

3) Edit POM.xm like this: (Change yourhost below with your hostname or IP address).

  & lt; Project ... & gt; ... & lt; Build & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; Group & gt; Org.apache.tomcat.maven & lt; / Group & gt; & Lt; ArtifactId & gt; Tomcat7-maven-plugin & lt; / ArtifactId> & Lt; Version & gt; 2.1 & lt; / Edition & gt; & Lt; Configuration & gt; & Lt; URL & gt; Http: // yourhost: 8080 / manager / text & lt; / URL & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt; & Lt; / Project & gt; 4) Add the following lines to your CATALINA_BASE / conf / tomcat-users.xml and restart your Tomcat.  
  & lt; Tomcat-users & gt; ... & lt; Role rolename = "manager-script" /> & Lt; User user name = "admin" password = "" roles = "manager-script" /> & Lt; / Badge users & gt;   

5) With Eclipse, run the Tomcat 7: redeploy target.

5.1) Right-click on your project and navigate to run in this form - & gt; "Maven Build ...".

5.2) Enter tomcat7: redeploy on target and click Run.

6) Once you run the run configuration setting, you can run the Tomcat 7: RADIO target from the run - & gt; Run the configuration.

Please see the following documentation for details:

If you use the blank password With the other user instead of the administrator (which is the default of plug-ins), you need to create% USERPROFILE% .m2 \ settings.xml and edit pom.xml as below:

% USERPROFILE% .m2 \ Settings.xml: & lt; Settings & gt; & Lt; Server & gt; & Lt; Server & gt; & Lt; ID & gt; Tomcat7 & lt; / Id & gt; & Lt; Username & gt; Badge & lt; / Username & gt; & Lt; Password & gt; Badge & lt; / Password & gt; & Lt; / Server & gt; & Lt; / Server & gt; & Lt; / Settings & gt;

% USERPROFILE% is your home folder. (Like C: \ users \ yourusername)

pom.xml:

  & lt; Configuration & gt; & Lt; Server & gt; Tomcat7 & lt; / Server & gt; & Lt; URL & gt; Http: // localhost: 8080 / manager / text & lt; / URL & gt; & Lt; / Configuration & gt;   

Add Server tag.

No comments:

Post a Comment