gpt4 book ai didi

java - Maven : Packaging Jar on local filesystem, 但不在 WAR 文件中。

转载 作者:行者123 更新时间:2023-11-28 22:11:19 24 4
gpt4 key购买 nike

我们正在开发一个 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>

最佳答案

您是否尝试过 provided 范围 - 它应该被排除在 war 之外。

文档 project object model

关于java - Maven : Packaging Jar on local filesystem, 但不在 WAR 文件中。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42482655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com