[英]How can I update Spring and Hibernate libraries in NetBeans IDE?
[英]How can I speed up Maven and Netbeans
我有一個相當大的項目(有很大的堆棧,包括Spring和Hibernate),我使用Maven通過Netbeans構建。
不幸的是,每次我對課程進行更改時,我都需要重建。 這意味着
這可能需要5分鍾的時間來檢查一個小的變化是否有所作為。 也許我的方法不對?
請指教...
好吧,我也在進行類似的設置,所以這里是我的2美分。
首先,用Maven-Jetty Plugin弄濕你的腳。 使其掃描文件以進行更改,這樣您就不必為每個更改重建/部署整個項目。 還要將其配置為存儲會話,以便在進行每次(自動)部署時,您無需重新登錄並進入更改前所處的狀態:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<stopPort>9669</stopPort>
<stopKey>myapp</stopKey>
<!-- Redeploy every x seconds if changes are detected, 0 for no automatic redeployment -->
<scanIntervalSeconds>3</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/myapp</contextPath>
<sessionHandler implementation="org.mortbay.jetty.servlet.SessionHandler">
<sessionManager implementation="org.mortbay.jetty.servlet.HashSessionManager">
<storeDirectory>${project.build.directory}/sessions</storeDirectory>
</sessionManager>
</sessionHandler>
</webAppConfig>
</configuration>
</plugin>
現在,轉到項目Properties
(通過右鍵單擊項目)> Build
> Compile
> Compile on save
並選擇For both application and text execution
。
還可以轉到Options
> Miscellaneous
> Maven
>並選中Skip Tests for any build executions not directly related to testing
,以便僅在實際運行'測試'時運行測試。
按照這些簡單的步驟,我可以快速編寫和測試更改,無需重新部署。 也就是說,我遇到了一些小問題/煩惱:
當某些東西不起作用時,您仍然需要進行清理構建(例如,您刪除了某些內容並且更改未反映)
保持運行很長時間可以給PermGen異常(空間不足),這是合理的,你總是可以使用jvm opts來增加內存
一旦習慣了這種設置,你就會討厭在像jboss / websphere這樣的容器上開發/測試項目
試試JRebel吧。 http://www.zeroturnaround.com/jrebel/
順便說一下,我沒有被zt支付 - 只有滿意的用戶。
為什么需要在每次更改時運行測試? 當進行微不足道的改變時,這是一個巨大的成本。 使用-DskipTests = true將其關閉
看看: http : //wiki.netbeans.org/HotDeploymentWebApplicationWithMaven
此外,將Netbeans設置為在Tomcat上進行熱部署(使用Jetty)。 請參閱以下文章: 使用Maven和NetBeans在Tomcat上進行增量熱部署 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.