我们正在开发一个Spring-MVC项目,其中我们使用Maven作为依赖项管理工具,部署在Apache Tomcat上。目前,我们还在集成Stanford解析器,添加模型库会将我们的WAR文件的大小从192Mb增加到600Mb。
这给我们带来了一个问题,因为我们还在开发中,我们更频繁地在测试系统上进行部署,并希望减少上传文件所需的延迟。
有没有办法,我们可以将这些JAR添加到我们的本地文件系统中,而不是包含在WAR文件中?谢谢。
POM.xml:
<parent>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>1.1.3.RELEASE</version>
<relativePath />
</parent>
<dependencies>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-parser</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.7.0</version>
<classifier>models</classifier>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.7.0</version>
<classifier>models-german</classifier>
</dependency>
// And other dependencies
<build>
<plugins>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.4</version>
// Plugin configuration
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>false</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>发布于 2017-02-27 18:01:41
你有没有尝试过作用域provided --它应该被排除在战争之外。
发布于 2017-02-27 18:02:54
您可以将这些大型库移动到Tomcat lib文件夹中,而不在打包的war中提供它们,方法是按照Maven中提供的方式指定它们。
https://stackoverflow.com/questions/42482655
复制相似问题