【发布时间】: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