【问题标题】:Error running Maven classworlds-1.1.pom.lastUpdated corrupted错误运行 Maven classworlds-1.1.pom.lastUpdated 已损坏
【发布时间】:2015-07-08 08:56:55
【问题描述】:

我是法国人,所以我会努力写出一个好的正字法,

当我运行我的项目 Maven 时,我遇到了这个错误(我没有找到如何做换行符):

 [WARNING] Failed to canonicalize path
 C:\Users\Administrator\.m2\repository\classworlds\classworlds\1.1\classworlds-1.1.pom.lastUpdated:
 The file or directory is corrupted and unreadable 
[WARNING] Failed to
 canonicalize path
 C:\Users\Administrator\.m2\repository\classworlds\classworlds\1.1\classworlds-1.1.pom.lastUpdated:
 The file or directory is corrupted and unreadable [WARNING] Failed to
 write tracking file
 C:\Users\Administrator\.m2\repository\classworlds\classworlds\1.1\classworlds-1.1.pom.lastUpdated
 java.io.FileNotFoundException:
 C:\Users\Administrator\.m2\repository\classworlds\classworlds\1.1\classworlds-1.1.pom.lastUpdated
 (The file or directory is corrupted and unreadable)
BUILD FAILURE

我尝试使用 Eclipse 和 Netbeans,但我删除了目录类世界,除非结果

在 SpringGardenApplication.java 文件中:

 package org.yannart.springgarden;

 import
 org.springframework.context.support.ClassPathXmlApplicationContext;

 /**  * Classe qui initialise l'application SpringGarden.  */ public
 class SpringGardenApplication {

    /**      * Methode main ou commence le flux de l'application.    */
    public static void main(String[] args) {

        // Demarre le contexte de Spring        new
 ClassPathXmlApplicationContext("applicationContext.xml",
                SpringGardenApplication.class);     } }

在 web.xml 文件中:

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>   <display-name>Archetype Created Web
Application</display-name> </web-app>

在 applicationContext.xml 文件中:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <!-- ANNOTATIONS POUR L'INJECTION DE DEPENDANCES -->
    <context:annotation-config />

    <!-- ANNOTATIONS POUR LA CREATION DE BEANS -->
    <context:component-scan base-package="org.yannart.springgarden" />

    <!-- ANNOTATIONS POUR AOP -->
    <aop:aspectj-autoproxy />

        <!-- JARDINIER -->
    <bean id="jardinier" class="org.yannart.springgarden.Jardinier" p:nom="Dupond" />

        <!--PLANTES -->
    <bean id="tomate" parent="plante" scope="prototype" p:nomPlante="Tomate" />
    <bean id="patate" parent="plante" scope="prototype" p:nomPlante="Patate" />
    <bean id="choux" parent="plante" scope="prototype" p:nomPlante="Choux" />
    <bean id="pomme" parent="plante" scope="prototype" p:nomPlante="Pomme" />
    <bean id="poire" parent="plante" scope="prototype" p:nomPlante="Poire" />
    <bean id="poireMalade" parent="plante" scope="prototype" p:nomPlante="PoireMalade" />
    <bean id="patateMalade" parent="plante" scope="prototype" p:nomPlante="PatateMalade" />

        <!-- POTAGER -->
    <bean id="potager" class="org.yannart.springgarden.Parcelle"
        init-method="melanger">
        <property name="nom" value="Potager" />
        <property name="plantes">
            <list>
                <ref bean="tomate" />
                <ref bean="patate" />
                <ref bean="patateMalade" />
                <ref bean="choux" />
                <ref bean="choux" />
            </list>
        </property>
    </bean>

    <!-- VERGER -->
    <bean id="verger" class="org.yannart.springgarden.Parcelle"
        init-method="melanger">
        <property name="nom" value="Verger" />
        <property name="plantes">
            <list>
                <ref bean="pomme" />
                <ref bean="poireMalade" />
                <ref bean="poire" />
            </list>
        </property>
    </bean>

            <!-- JARDIN -->
    <bean id="jardin" class="org.yannart.springgarden.Jardin" init-method="jardiner">
        <property name="jardinier" ref="jardinier" />
        <property name="parcelles">
            <list>
                <ref bean="potager" />
                <ref bean="verger" />
            </list>
        </property>
        <!-- Les doses sont aléatoires -->
        <property name="doseEau" value="#{ T(java.lang.Math).random() * 100 }" />
        <property name="doseEngrais" value="#{ T(java.lang.Math).random() * 50 }" />
    </bean>

此外,当我删除目录“.m2”中的目录“存储库”时,目录“1.1”总是在这里并且显然已损坏

你有什么想法吗? 谢谢

【问题讨论】:

  • 你的项目是什么?您需要发布一些代码让我们看到,然后我们才能提供帮助。
  • 感谢您的回复,代码的哪些部分会很有趣?我有一个文件 application.xml、pom.xml 和一些类和接口,我遵循了这个教程:yannart.developpez.com/java/spring/tutoriel

标签: eclipse maven netbeans


【解决方案1】:

也许问题来自缓存。您是否尝试过删除 .m2/repository/ 的全部内容?

在删除之前尝试停止服务器和 maven。 如果您使用 Netbeans,您可以看到服务器:

如果有某个进程被锁定,你可以直接杀死它或重启你的电脑。

【讨论】:

  • 您好,我重新启动计算机但无法删除 .m2/repository/ 因为目录 m2/repository/classworlds/classworlds/1.1
  • 也许一个解决方案是指向其他剧目 maven,但我不知道如何处理 Netbeans
  • 是的,不要认为你可以用 Netbeans 来做,因为它是关于 maven 安装的。但我认为最好删除损坏的存储库。您是否尝试过以安全模式启动(模式 sans echec)?
  • 是的,我试过安全模式(不可能是这种模式……我的电脑肯定有很多病毒……)
  • 我会在另一台电脑上试试
猜你喜欢
  • 1970-01-01
  • 2013-04-14
  • 2019-08-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-01-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多