project-parent
|
+-- Module1 (JAR)
| |
| +-- src
| |
| +-- main
| |
| +-- java
| +-- resources
|
+-- Module2 (JAR)
| |
| ...
|
+-- Web Module (WAR)
|
...
project-parent是父工程,主要是配置类
Web Module 依赖其他module
装了jetty插件但是无法直接用在project-parent上,找不到web类路径和web.xml(因为parent不是web模块)
现在只能先install 其他模块,再在web-module上用jetty:run。有没有办法不install,直接在parent上执行
jetty:run就可以,不知道怎么更改jetty插件配置就能直接找到class和web.xml
1 个解决方案
#1
<!-- 插件配置 -->
<build>
<finalName>rop-sample</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<webApp>
<contextPath>/duidui</contextPath>
<!-- 设置其他项目extraClasspath,多个用";"隔开 -->
<extraClasspath>
../duidui-dao/target/classes;
../duidui-service/target/classes;
../duidui-model/target/classes;
../duidui-util/target/classes;
../duidui-web/target/classes;
</extraClasspath>
</webApp>
<!-- 设置监听目录 -->
<scanTargets>
<scanTarget>../duidui-dao/target/classes</scanTarget>
<scanTarget>../duidui-service/target/classes</scanTarget>
<scanTarget>../duidui-model/target/classes</scanTarget>
<scanTarget>../duidui-util/target/classes</scanTarget>
<scanTarget>../duidui-web/target/classes</scanTarget>
</scanTargets>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
<build>
<finalName>rop-sample</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<webApp>
<contextPath>/duidui</contextPath>
<!-- 设置其他项目extraClasspath,多个用";"隔开 -->
<extraClasspath>
../duidui-dao/target/classes;
../duidui-service/target/classes;
../duidui-model/target/classes;
../duidui-util/target/classes;
../duidui-web/target/classes;
</extraClasspath>
</webApp>
<!-- 设置监听目录 -->
<scanTargets>
<scanTarget>../duidui-dao/target/classes</scanTarget>
<scanTarget>../duidui-service/target/classes</scanTarget>
<scanTarget>../duidui-model/target/classes</scanTarget>
<scanTarget>../duidui-util/target/classes</scanTarget>
<scanTarget>../duidui-web/target/classes</scanTarget>
</scanTargets>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
#1
<!-- 插件配置 -->
<build>
<finalName>rop-sample</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<webApp>
<contextPath>/duidui</contextPath>
<!-- 设置其他项目extraClasspath,多个用";"隔开 -->
<extraClasspath>
../duidui-dao/target/classes;
../duidui-service/target/classes;
../duidui-model/target/classes;
../duidui-util/target/classes;
../duidui-web/target/classes;
</extraClasspath>
</webApp>
<!-- 设置监听目录 -->
<scanTargets>
<scanTarget>../duidui-dao/target/classes</scanTarget>
<scanTarget>../duidui-service/target/classes</scanTarget>
<scanTarget>../duidui-model/target/classes</scanTarget>
<scanTarget>../duidui-util/target/classes</scanTarget>
<scanTarget>../duidui-web/target/classes</scanTarget>
</scanTargets>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>
<build>
<finalName>rop-sample</finalName>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<webApp>
<contextPath>/duidui</contextPath>
<!-- 设置其他项目extraClasspath,多个用";"隔开 -->
<extraClasspath>
../duidui-dao/target/classes;
../duidui-service/target/classes;
../duidui-model/target/classes;
../duidui-util/target/classes;
../duidui-web/target/classes;
</extraClasspath>
</webApp>
<!-- 设置监听目录 -->
<scanTargets>
<scanTarget>../duidui-dao/target/classes</scanTarget>
<scanTarget>../duidui-service/target/classes</scanTarget>
<scanTarget>../duidui-model/target/classes</scanTarget>
<scanTarget>../duidui-util/target/classes</scanTarget>
<scanTarget>../duidui-web/target/classes</scanTarget>
</scanTargets>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
</plugins>
</build>