Maven Build不会读取webinf / lib文件夹中的文件

时间:2017-06-01 03:20:41

标签: eclipse maven

我在Web-INF / lib文件夹中有一个jar。

当我在Eclipse中进行Maven构建时,它会失败,因为Maven没有读取该jar文件。

这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>MerchantWallet</groupId>
  <artifactId>StellarReceive</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>StellarReceive Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <properties>
    <spring.version>4.3.8.RELEASE</spring.version>
    <jdk.version>1.8</jdk.version>
</properties>

<dependencies>

      <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>${spring.version}</version>
</dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
<!-- hello -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

    <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.6</version>
</dependency>


</dependencies>

<build>
    <finalName>StellarReceive</finalName>
    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <source>${jdk.version}</source>
                <target>${jdk.version}</target>
            </configuration>
        </plugin>


    </plugins>
</build>

</project>

这是我的文件夹结构:enter image description here

有人可以帮忙吗

1 个答案:

答案 0 :(得分:2)

Maven希望负责用jar填充WEB-INF / lib目录。

您需要从其当前位置删除该jar,并使用mvn install:install-file将其安装到本地存储库中,或者,如果您使用的是存储库管理器(更可取),请使用它将其部署到该存储库中无论是用户界面还是使用mvn deploy:deploy-file