Pergunta

Estou usando o Eclipse e o Maven-2 e gostaria de poder editar meus arquivos HTML sem "It" (não tenho certeza se é eclipse ou maven) recompilar meu aplicativo. Entendo que geralmente o Eclipse tenta fazer uma substituição quente de novas aulas de java compiladas pelo Eclipse e Tomcat.

Posso usar algo assim?

getResourceSettings().setResourcePollFrequency(null);

Sei que posso desligar a atualização automática do Tomcat no Eclipse, mas gostaria que o arquivo HTML fosse atualizado e as classes não atualizem, se possível.

Aliás, minha principal preocupação é que o Tomcat tende a obter erros de permissão depois que eu (quente) recarregue muitas aulas de Java.

Foi útil?

Solução

You're sort of correct, you're supposed to use setResourcePollFrequency(Duration.ONE_SECOND); or similar. This link has more detailed information. However what I've found is that due to Wicket's caching internal cache containers like to get really messed up after any hotswapping so you may just have to learn the hotkey for restarting Tomcat or start doing Wicket development with the integrated Jetty and WicketTester.

Outras dicas

You may want to consider increasing the permgen space when you run eclipse. There is a command line argument:

eclipse [normal arguments] -vmargs -XX:PermSize=64M -XX:MaxPermSize=128M

(copied from:) http://wiki.eclipse.org/FAQ_How_do_I_increase_the_permgen_size_available_to_Eclipse%3F

I am not sure offhand how to prevent wicket from reloading HTML files but I will see if I can find it.

Edit: If setting the poll frequency to null doesn't work, try using Duration.MAXIMUM. Also, you can uncheck "Build Automatically" in the eclipse Project menu, though this is more of a hassle then it's worth, IMHO.

According to the wicket FAQ, wicket only reloads changed markup files when you explicitly set the resource poll frequency:

http://www.wicketframework.org/faqs.html

I am not sure how to prevent eclipse from copying altered files to the output aside from disabling build automatically.

If Build Automatically is enabled (it is by default: Project->Build Automatically) then any modification to the project files will trigger the build, regardless of whether they are in source folders or not.

I always work with Build Automatically disabled as I find it too intrusive (for reasons like this), and just hit ctrl-B when I want the project to build, or alt-P N to launch the clean dialog if needed.

I understand you're using (and might want to keep using) Tomcat, but during Wicket development you can run the supplied Jetty server onder /src/test/java/com/your/package/Start.java in debug mode to get this behaviour.. Set Wicket to development mode to use this feature.

HTML files or jsp files?

Are you using tomcat? If you are editing only html files, go ahead and change them as you wish. As long as you don't deploy them somewhere else for tomcat to fetch them, you'll see the update(s).

If it's jsp, save your new file, delete the files under the old work folder. This will make tomcat think it's the first time the file is requested and it will re-compile the jsp on the fly.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top