jetty插件的配置
咱們使用jetty插件來進行啓動咱們的maven項目,在pom.xml中進行配置:html
- <plugins>
- <plugin>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>9.3.0.M2</version>
- <configuration>
- <webAppConfig>
- <contextPath>/</contextPath>
- </webAppConfig>
- <httpConnector>
- <port>8081</port>
- <idleTimeout>10000</idleTimeout>
- </httpConnector>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp/WEB-INF</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>dev</id>
- <properties>
- <ejs.url.resources>http://127.0.0.1:8080</ejs.url.resources>
- <ejs.static.resources>http://127.0.0.1:8080</ejs.static.resources>
- <ejs.image.resources>http://127.0.0.1:8070/ejsimage</ejs.image.resources>
- <ejs.cookie.domain>.ejavashop.com</ejs.cookie.domain>
- <ejs.cookie.name>ejavashop_b2b2c_admin</ejs.cookie.name>
- <ejs.front.url>http://120.0.0.1:8807</ejs.front.url>
- <ejs.h5.url>http://120.0.0.1:8808</ejs.h5.url>
-
- <shop.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.write.url>
- <shop.write.username>root</shop.write.username>
- <shop.write.password>root</shop.write.password>
-
- <shop.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.read.url>
- <shop.read.username>root</shop.read.username>
- <shop.read.password>root</shop.read.password>
-
- <analysis.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.write.url>
- <analysis.write.username>root</analysis.write.username>
- <analysis.write.password>root</analysis.write.password>
-
- <analysis.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.read.url>
- <analysis.read.username>root</analysis.read.username>
- <analysis.read.password>root</analysis.read.password>
-
- <search.solr.url>http://127.0.0.1:8070/solr</search.solr.url>
- <search.solr.server>ejavashopcore</search.solr.server>
-
- <pom.log.file>F:/Users/logs/ejavashop-admin.log</pom.log.file>
- <pom.log.level>info</pom.log.level>
- </properties>
- </profile>
-
- </profiles>
plugin:下載咱們使用的jetty插件。java
profile:目的是不一樣環境使用不一樣的配置信息, 有點至關於咱們的properties文件mysql
而後咱們在web
這樣咱們就能夠sql
使用這幾個按鈕進行啓動了。apache
最後兩個綠色按鈕你們可能沒有,那個是jrebel的按鈕。cookie
jrebel配置
咱們在idea中安裝了jrebel,咱們那個項目能夠使用jrebel來進行啓動,從這裏設置:app
能夠使用jrebel的項目,咱們還能夠從這裏設置:dom
效果等同eclipse
最後設置完成的效果:
對於rebel.xml中的內容:
- <?xml version="1.0" encoding="UTF-8"?>
-
- <!--
- This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
- Refer to https://manuals.zeroturnaround.com/jrebel/standalone/config.html for more information.
- -->
- <application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
-
- <classpath>
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/target/classes">
- </dir>
- </classpath>
-
- <web>
- <link target="/">
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp/WEB-INF">
- </dir>
- </link>
- <link target="/">
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp">
- </dir>
- </link>
- </web>
-
- </application>
jrebel監控的是F:/ejavashop/ejavashop/ejavashop-admin/target/classes下的文件哦,因此只要改動的類編譯事後就能夠監控到了。
使用jetty插件的時候,項目運行起來並不可以當即看到效果,須要咱們進行手動編譯,
執行編譯快捷鍵是:
ctrl+shift+F9編譯單個類
ctrl+F9 編譯整個項目
若是咱們對於某個Java進行了編譯,熱部署,咱們看到的效果是,咱們須要在使用jrebel啓動咱們項目的時候: