gpt4 book ai didi

java - JRebel with maven for Java Web App 每次都需要全新安装,对吗?

转载 作者:行者123 更新时间:2023-11-29 05:20:16 26 4
gpt4 key购买 nike

所以我正在使用 JRebel,但我认为目前我的使用方式有问题。

这是在我的 pom.xml 中:

<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>

当我部署应用程序时,我读到:

2014-08-03 15:43:42 JRebel: Directory '/Users/koraytugay/IdeaProjects/august-three/target/classes' will be monitored for changes.
2014-08-03 15:43:42 JRebel: Directory '/Users/koraytugay/IdeaProjects/august-three/src/main/webapp' will be monitored for changes.

我必须说我正在使用 IntelliJ,我使用的服务器是 Tomcat。

我有一个简单的 Java 代码,当我点击 index.jsp 时它会被调用:

public static int rollDice() {
return 11;
}

当我将值 11 更改为 9 并刷新 index.jsp 时,我没有看到更改。我必须在 maven 中进行全新安装,然后 JRebel 才能工作。

没有 maven clean install 有没有办法做到这一点?当我编辑源文件时,我可以直接在我的网络应用程序中看到更改吗?

谢谢。

最佳答案

您只需编译您更改过的单个文件。 JRebel 正在跟踪所有类,它会在下次访问时重新加载更改的类。要在 IntelliJ 中执行此操作,您需要从菜单调用 Build -> Compile 或当然使用适当的快捷方式 (Ctrl + Shift + F9)。同样在 IntelliJ 12 中,您可以在设置 -> 编译器中选中“自动创建项目”选项以自动编译所有编辑的文件)

关于java - JRebel with maven for Java Web App 每次都需要全新安装,对吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25104836/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com