Intellij + maven jetty plugin vs eclipse + jetty hot deploy? - java

I have eclipse and intellij from the same workspace because both replies on pom.xml file. I notice something different. In eclipse, when I setup Jetty Webapp under Run Configurations and run jetty it looks at /classes folder for any changes if some of the projects are open (I have about 15 projects, some of them closed some of them open). If some of the projects are not open it will look at jar files from .m2 folder which is fine. So, when I change something I could just compile the file and see the changes without restarting the server.
However, in Intellij CE when I run jetty:run from maven it only looks at .m2 folder for the jar files, so I had to mvn clean install every time to update .m2 folder and restart the server. How could I achieve the same thing in IntelliJ? So, when I change something in Java classes I don't have to restart the server?

Related

Deploying Maven project tusing eclipse jboss tools

I'm trying to get my maven project deployed to Jboss AS 7.1 using the jbos tools plugin version 4.3.1.FINAL.
My project setup is
parentPom
common.jar
util.jar
mywebapp.war
When I run mvn clean install form both eclipse and command line the resulting target folder is the same atleast for the mywebapp.war and /mywebapp (folder)
If i copy either the folder or war file from the target folder directly into the servers /standalone/deployments directory. The application starts up without a problem.
However if I go to my server setup in eclipse which is pointing to the same base and do Add/Remove -> select mywebapp -> run
The problem is this doesnt copy all the files over to the server becasue when i run a diff I see a whole load of files missing. Consequently the build fails saying it canot load some annotation, presumably this is because some of the files are missing.
Ideally I wouldn't want to copy the war or folder manually and would love to be able to edit jsp/css/javascript files etc without having to go through this laborious task.

Maven plugin for clean the tomcat target folder and war file

I want to know how can i remove the target folder and war file which created within webapps folder when i deploy the project.
I'm using eclipse IDE for the deploy project. I want to what is the maven plugin for this goal.
But if I used terminal for deploy the project i can used. But sometimes this command also unable to clean the webapps folder.
mvn clean compile war:war
Do you get an error message when using mvn clean ?
Do you have open files which are located in the structure under target? This prevents the target folder from being deleted.

How to deploy a Maven WAR to JBoss EAP 6.3 within Eclipse Luna

I have read every page that shows up on the first Google result page with that search. But nothing seems to help.
Of course I can run "mvn clean install" in or out of Eclipse and get the .war generated in the target folder. I can copy the .war in the deployments folder of JBoss installation myself. And then I can start the server through the server adapter in Eclipse.
But I want that "manual copy of war" to be automatic as well.
How can I do this? What do I need to do to add a new item to "Run As" menu, say, "Maven JBoss Deploy" where underneath, it does a clean, install, deploy (copy to deployments)?
I have Maven 3.1.1 installed separately (outside of Eclipse) and I have told Eclipse where my Maven is. I have JBoss Tools (latest version) installed with JBoss Maven Integration part of it.
I just don't see any way to integrate JBoss and Maven within Eclipse :(
You can do with fileName tag
<fileName>${basedir}/target/webapp.war</fileName> in pom.xml
or
You can go with Profiles in pom.xml
More 1
More 2
By trial and error, I was able to get Eclipse to deploy a maven project WAR on JBoss.
I just needed to have "Dynamic Web Module" facet attached to the project. I did that using the Project properties in eclipse.
Now I am able to right click the project and Run As Server and that deploys to JBoss. And the project is still a Maven project. Yay!

Tomcat not uploading all files

When i make the war i see the XCV.Jar, but I add the project on Tomcat (IDE eclipse), and when I deploy it, I have all jars except XCV.Jar (This jar is the parent of the project I deployed).
When you deploy to Tomcat from Eclipse it often fails to clean up the work directory directory. Try to clean $TOMCAT_HOME/work/Catalina// and the web apps directory then try redeploying.
If you are running tomcat inside eclipse you're asking for trouble. Its often better to build and validate the .war independently(with ant or maven) then deploy manually or with a script.

Eclipse and SubClipse: How to deploy my own package with svn to a TomCat server?

I'm using SubClipse for Eclipse for my project.
And in this project I've added my own package "com.mytestpkg.www"
I then use TortoiseSVN to deploy my project on the TomCat server where the project is running, because i the easily can update the site with "SVN Update".
But using this method I always have to manually update my package by copying it from my Eclipse workspace build path to the WEB-INF folder classes/com/mytestpkg/www.
Is there a way to make Subclipse/SVN update this file directly with the other files?
Why don't you do this a more conventional way; e.g.
get Eclipse to create and deploy a WAR file
use Ant or Maven to build the WAR file and deploy it by hand. (The Maven way of building WAR files is really slick!)
Doing a checkout into a Tomcat server's webapps directory is ... weird. And you've got the problem of stopping the world seeing the .svn directories.

Categories