Autosync web-app on application server

i am new to intelliJ i just switched from eclipse to try it (my company bought licenses for all). I am working on 2 modules one is JavaEE 7 (jpa, jax-rs...) the other is a AngularJS app. All is working fine so far: i have added an application server (jboss/wildfly) and added run configuration i deployed both war files on it. The server is local/stand-alone.
My problem is: How to get files in IntelliJ into sync with server? On Eclipse i just save and Eclipse sync automatically  ("republish...synced"). How to achieve this in IntelliJ? At the moment my frist priority is to sync the Angular app (just html,js,css files). But to be able to sync classes would be nice.
So how to set it up and how to trigger sync? I there an autosync?


thanks in advance

6 comments
Comment actions Permalink

I read this already. I deployed the html/js war as "exploeded" and the other war not exploded (if i deploy it exploded i get class not found for whatever reason). But as i said i need the update only for html-project: I do nat have the option "Update classes and resources". This options seem to exist per application server/run config and not per deployment?!

So how to get my html/js-war(exploded) synced with server while there is also another not exploded war deployed? Or why i get calss not found error (for a existent class) if i deploy the JavaEE war "exploded"? (all works fine if deployed manually/not exploded or via eclipse)

0
Comment actions Permalink

There is some problem with your artifact configuration, like missing classes/jars. Fix it per http://www.jetbrains.com/idea/webhelp/configuring-artifacts.html .

Update classes and resources is available only for exploded artifacts.

0
Comment actions Permalink

As i stated before: i deployed the web-project "exploded" - so autosync should be available for it shouldn't it?
Besides this the project is a maven project, artifacts and classes and manifest is managed by maven. The class not found error is for an own class - that is there and i could edit it, and there is no error elswhere (manual deploy, war deploy, eclipse). The odd thing about exploded deployment is: IntelliJ seems to give the deployment another name (don't know if this is a problem):
In maven-war plugin the name for war is "timetracker-backend.war" and thus deployment name is "timetracker-backend" but if i deploy "exploded" the name changes to "timetracker-backend-1.1-SNAPSHOT".

This is the error (i think that is just the first class not found):

"Caused by: java.lang.ClassNotFoundException: com.prodyna.pac.timtracker.model.BookingRepository from [Module "deployment.timetracker-backend-1.1-SNAPSHOT:main" from Service Module Loader]"
exploeded.PNG

As you see in screenshot, the name of deployment is correctly shown but for some reason if deployed it becomes "timetracker-backend-1.1-SNAPSHOT", but i am not sure if this is the reason for class not found exception.

0
Comment actions Permalink

You can use workDirectory option for maven-war-plugin to change it: https://youtrack.jetbrains.com/issue/IDEA-112722 .

0
Comment actions Permalink

Thanks, exploeded deployment is working now (and stuf is also instantly updated - great!):

i changed the maven-war-plugin config to have warName == name of webappDirectory (not workDirectory):

<configuration>
   <webappDirectory>${project.build.directory}/${artifactId}</webappDirectory> <-- new
   <warName>${artifactId}</warName>
   <failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>



For some reason this is only necessary for javaee project (the html/js project worked before). Do you know the cause? Is my assumption right that war's name must match directory? (i don't have good feeling to change maven config for one IDE)


0

Please sign in to leave a comment.