【发布时间】:2015-02-23 03:41:49
【问题描述】:
对于开发,我通过 maven (jetty-maven-plugin) 使用码头运行应用程序,对于所有其他部署,我使用 tomcat, 如果我使用jetty maven插件运行我的应用程序,我希望将jetty web-socket(javax-websocket-server-impl)库添加到类路径中,在tomcat中这些是内置的,所以我不需要告诉maven去获取这些库。
所以为了限制这些库只用于码头 maven 插件,我在里面添加了这些库 jetty-maven-plugin
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppConfig>
<contextPath>/myproject</contextPath>
</webAppConfig>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
<version>9.1.0.v20131115</version>
</dependency>
</dependencies>
</plugin>
仅当我运行插件时,这应该将码头 websocket 库添加到类路径中,但它不是,并且我一直找不到类,如果我将它添加到 pom 中的主要依赖项中它可以工作,但我不能这样做这是因为我在部署到 tomcat 时不希望部署文件中包含码头库,请纠正我,告诉我如何将这些库限制为仅执行此插件。
【问题讨论】:
标签: maven maven-plugin