Eclipse 运行Maven classworlds-1.1.pom.lastUpdated时出错
我是法国人,所以我会尽量掌握好正字法 当我运行我的project Maven时,我有一个错误(我不知道如何换行): 我尝试了Eclipse和Netbeans,并删除了保留的类世界,除非有结果 在SpringGardenApplication.java文件中:Eclipse 运行Maven classworlds-1.1.pom.lastUpdated时出错,eclipse,maven,netbeans,Eclipse,Maven,Netbeans,我是法国人,所以我会尽量掌握好正字法 当我运行我的project Maven时,我有一个错误(我不知道如何换行): 我尝试了Eclipse和Netbeans,并删除了保留的类世界,除非有结果 在SpringGardenApplication.java文件中: package org.yannart.springgarden; import org.springframework.context.support.ClassPathXmlApplicationContext; /**
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>
<?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>
网站创建的原型
应用
在applicationContext.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>
<?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>
此外,当我在repertory.m2中删除repertory“repository”时,repertory“1.1”总是在这里,并且显然已损坏
你有什么想法吗?
谢谢问题可能来自缓存。您是否尝试删除.m2/repository/的全部内容 尝试在删除之前停止服务器和maven。 如果使用Netbeans,您可以看到服务器:
如果某个进程被锁定,您可以直接将其关闭或重新启动电脑。您的项目是什么?在我们提供帮助之前,您需要发布一些代码让我们查看。感谢您的回复,代码的哪一部分会很有趣?我有一个文件application.xml、pom.xml和一些类和接口,我遵循了本教程:您好,我重新启动了计算机,但无法删除。m2/repository/因为repository m2/repository/classworlds/classworlds/1.1可能是一个解决方案,指向另一个repository maven,但我不知道如何使用netbeansys,不要认为你可以用Netbeans来做,因为这是关于maven安装的。但我认为最好删除已损坏的存储库。你试过用安全模式(无echec模式)启动吗?是的,我试过安全模式(不可能在这种模式下…我的电脑肯定有很多病毒…),我会在另一台电脑上尝试