2017-02-27 70 views
1

我们正在开发一个Spring-MVC项目,其中我们使用Maven作为依赖管理工具,部署在Apache Tomcat上。目前,我们还集成了Stanford解析器,并且添加模型库将WAR文件的大小从192Mb增加到600Mb。Maven:在本地文件系统上打包Jar,但不在WAR文件中。

这给我们带来一个问题,因为我们仍在开发中,而且我们更频繁地在我们的测试系统上进行部署,并希望减少上传文件所需的延迟时间。

有没有什么办法,我们可以将这些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> 

回答

1

你可以在Tomcat的lib文件夹中移动这些大库,不指定它们作为Maven的规定为他们提供在打包的战争。

相关问题