简体   繁体   中英

maven ear / war problems and “deploy on save” not working

I have an ear project which packages an ejb module and 2 war's. Each of them is declared as a maven dependency. I use maven-ejb-plugin, maven-ear-plugin and maven-war-plugin. All projects share a common super-pom, which has every project declared as a module.

When I run my ear project, changing a web resource in the war doesn't redeploy it on the server, although I checked "deploy on save" everywhere I could (war/ear).

Some information that could be useful:

  • I didn't generate the pom.xml from netbeans. The projects were previously ant project which I migrated by mimicking what netbeans seems to generate from an ear/ejb/war setup.
  • I sometimes have difficult times making changes in my war file. I need to clean all projects, stop the server, etc.. I guess something is wrong somewhere. I suppose just changing my files and running maven install (or hitting 'run' or 'debug') should work?
  • I'm running the ear project (not sure if I shouldn't run the superpom somehow).
  • Netbeans doesn't run the right url when starting browser ( /XXX-1.0-snapshot instead of /XXX , which I specified and which is the one actually working). I always have to edit it manually in my address bar. Could be related?

EDIT: Seeing this for a local project: Seeing this for a local project:

Downloading: http://repository.primefaces.org/be/valuya/xyzproj/XYZproj-ejb/1.0-SNAPSHOT/maven-metadata.xml

EDIT2: opened this netbeans bug: http://netbeans.org/bugzilla/show_bug.cgi?id=218806

deploy on save : this option is only applicable if you set the netbeans.deploy property to true (it means that netbeans will handle the deployment of your webapp and will monitor your files and perform redeployment when necessary). in netbeans, right-click on your maven project go to "properties", select "actions" under the categories listing, select "run action" and you can specify netbeans.deploy=true in the "set properties" textbox.

making changes in war : if i'm not wrong, you only encounter this problem when modifying static web content (eg html, css, javascript, etc). this is because most servers memory map static content and locked the files for performance purposes. you will need to configure your server to disable memory mapped files. the configuration is dependent on the server (glassfish/jetty/tomcat) your are using.

netbean launches the wrong url : netbeans uses the url based on the folder name of your project. i havent been able to change this either (it always resets), so i guess it's a IDE bug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM