0
我的系統信息:Eclipse中,WebSphere7.0,Maven的:AspectJ的熱部署過程中不織代碼
IDE: Eclipse Blue 10.0,
Server: Websphere 7.0
Build Management Tool: Maven 3.0
我進行編譯時使用下面的配置在我的Maven項目編織:
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!-- <goal>test-compile</goal> -->
</goals>
</execution>
</executions>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>com.xxx.logger</groupId>
<artifactId>my-aspect-logger</artifactId>
</aspectLibrary>
</aspectLibraries>
<showWeaveInfo>true</showWeaveInfo>
<outxml>true</outxml>
<Xlint>warning</Xlint>
<verbose>true</verbose>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
在開發過程中,我使用下面的路徑在Eclipse中以分解模式添加我的EAR文件:
Windows > Show View > Servers > WebSphere 7 > Right Click > Add Deployment
我正面臨着一個問題,即每當我更改我的java類時,這些代碼都會在服務器中編譯和熱部署。但是,它們不會重新編織。但是,如果我刪除EAR,從命令提示符構建我的項目,並重新部署它,然後它正常工作。
有人可以幫我解決這個問題。
我更正了我的陳述「但是如果我刪除EAR,從命令提示符下構建我的項目並重新部署它,那麼它可以正常工作」。有沒有什麼方法可以定義每當我在eclipse中更改代碼時,在熱部署之前應該執行maven目標。這樣我的代碼可以按照pom.xml中提到的配置編織? – 2013-03-27 07:21:06
對不起,我錯過了這個評論。您應該探索添加構建器的可能性(右鍵單擊項目,選擇「屬性」,然後選擇「構建器」)。您可以創建一個新的Ant構建器,運行外部程序(例如maven)或從工作區導入啓動配置(可能是Maven啓動配置)。這是一個標準的日食功能,因此您可能能夠在日食聚焦網站上找到有關這樣做的信息。 – 2013-04-16 08:23:57