【问题标题】:Maven and manifestMaven 和清单
【发布时间】:2016-10-27 20:59:45
【问题描述】:

一切正常,但是在我向我的 Eclipse 动态 Web 项目添加一个类之后,Maven 启动:

\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF(未找到文件)

我不再做 - 如何治愈它 - 告诉我 PLZ。当然,我清理了我的 Maven 项目并重新安装它,但没有任何改变。这是我的pom

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TrendSoft</groupId>
<artifactId>TrendSoft</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
  <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
      <warSourceDirectory>WebContent</warSourceDirectory>
      <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
    </configuration>
  </plugin>
</plugins>
</build>
<dependencies>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    <version>5.2.0.Final</version>
</dependency>
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4.1208</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>
<dependency>
    <groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>1.1.3</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>4.3.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>
</dependencies>

【问题讨论】:

  • 为什么要更改默认值?使用&lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;的原因是什么?

标签: java spring maven


【解决方案1】:

转到项目的根目录。无论 pom 位于何处,然后尝试做一个

mvn eclipse:clean 

然后

mvn eclipse:eclipse

更多信息,您可以阅读本教程:m2e-wtp error: <path>/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF (No such file or directory)

【讨论】:

    【解决方案2】:

    我认为这是一个 Eclipse 错误。在我 Run as 使用命令 clean install 构建 Maven 之前。 现在我只是以 Maven Clean 身份运行,然后运行 ​​Maven 安装,问题就消失了。

    感谢大家的意见。

    【讨论】:

      猜你喜欢
      • 2013-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-04
      • 2018-03-12
      • 2019-09-20
      • 2019-07-19
      • 2014-09-25
      相关资源
      最近更新 更多