【问题标题】:JRebel with maven for Java Web App requires clean install everytime, is this right?JRebel with maven for Java Web App 每次都需要全新安装,对吗?
【发布时间】:2014-08-03 12:53:38
【问题描述】:

所以我正在使用 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 全新安装,有什么方法可以做到这一点?当我编辑源文件时,我可以直接在我的 web-app 中看到更改吗?

谢谢。

【问题讨论】:

    标签: java jsp maven intellij-idea jrebel


    【解决方案1】:

    您只需编译已更改的单个文件。 JRebel 正在跟踪所有类,它会在下次访问期间重新加载更改的类。要在 IntelliJ 中执行此操作,您需要从菜单调用 Build -> Compile 或使用适当的快捷方式(Ctrl + Shift + F9)。同样在 IntelliJ 12 中,您只需在 Settings -> Compiler 中选中“Make project automatically”选项即可自动编译所有已编辑的文件)

    【讨论】:

    • 没有办法在 IntelliJ 中实现自动化吗?
    • @KorayTugay 是的,你可以,我刚刚延长了我的帖子
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-24
    • 2012-12-18
    • 2019-09-30
    相关资源
    最近更新 更多