Domanda

I have a project with several applications. I have one war and one EAR package. I am using Glassfish, Netbeans and Maven.

The problem is everytime I make a small change in jsf page I have to build the project and run it on server from the beginning ( deploy).

Also I have changed the build -> compile " Compile on Save" property for WAR to "For application execution only". Also at project properties Run -> I have enabled deploy on save.

Still I have to redeploy it from the beginning to see the changes. Please help, this is taking my time!

Thanks, Sara.

È stato utile?

Soluzione

Make sure the PROJECT_STAGE is set to Development. If it is on production your JSF implementation may cache compiled version and won't check on disk for changes.

You should have something like this in your web.xml

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

BTW I have only used maven once with a netbeans java-ee project and using maven is slower then a normal netbeans project. If I remember correctly maven always builds a new war and deploys that. A netbeans project does a so called in place deployment which means that it uses the files from the project directly so any changes to for instance JSF pages or CSS are picked up even without redeploying. Redeploying is only needed for changes to the java code and deployment descriptors.

Altri suggerimenti

NetBeans provides the "Deploy on Save" feature. However, it still redeploys the full app. Despite it claims to be able to preserve the session it still takes time.

You might want to check out JRebel - the JVM plugin that can handle in-app updates instantly.

The plugin for NetBeans 7.1 is available here: http://plugins.netbeans.org/plugin/22254/jrebel-netbeans-plugin And for NetBeans 7.2 the plugin is in development.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top