包com.thoughtworks.xstream.annotations不存在

时间:2012-10-07 11:03:15

标签: java maven intellij-idea xstream

我必须构建一个Java Web项目来在本地运行它并调整一些HTML。不幸的是,在从SVN服务器进行另一次更新后,项目停止了可构建。

以下是IntelliJ IDEA的日志:

"C:\Program Files\Java\jdk1.7.0_07\bin\java" -Xms256m -Xmx512m
"-Dclassworlds.conf=C:\Program Files (x86)\Apache Software Foundation\apache-maven-2.2.1\bin\m2.conf"
"-Dmaven.home=C:\Program Files (x86)\Apache Software Foundation\apache-maven-2.2.1"
-Didea.launcher.port=7532
"-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.3\bin"
-Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\Apache Software Foundation\apache-maven-2.2.1\boot\classworlds-1.1.jar;
C:\Program Files (x86)\JetBrains\IntelliJ IDEA 11.1.3\lib\idea_rt.jar"
com.intellij.rt.execution.application.AppMain
org.codehaus.classworlds.Launcher --no-plugin-registry --fail-fast
--strict-checksums --update-snapshots
-f C:\Users\Kat\IdeaProjects\MYROOT\MYPROJECT\pom.xml install
+ Enabling strict checksum verification on all artifact downloads.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building MYPROJECT Project
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 20 source files to C:\Users\Kat\IdeaProjects\MYROOT\MYPROJECT\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\Users\Kat\IdeaProjects\MYROOT\MYPROJECT\src\main\java\MYPROJECT\dto\BillDto.java:
10,43] error: package com.thoughtworks.xstream.annotations does not exist

我尝试过:

  1. 删除了IDEA中的XStream库的引用('Project Structure' - >'Libraries'),脱机/联机,让Maven更新丢失的XStream。
  2. 直接替换了Maven存储库中的.jar和.pom文件(它们在第1页中重新创建),并从XStream网站下载了这些文件。
  3. 两者都无济于事。我是Java世界的新手,并且不知道下一步该做什么。

    顺便说一下,IDEA看到了XStream类,并让它们通过它们进行导航。

    此致

1 个答案:

答案 0 :(得分:0)

如果您在IntelliJ中使用Maven集成,那么您不应该使用“项目结构” - > “图书馆”对话框。 IntelliJ将通过读取模块的pom.xml文件自动配置这些库。

请参阅:http://www.jetbrains.com/idea/webhelp/maven-projects-tool-window.html

http://www.jetbrains.com/idea/webhelp/maven-importing.html

您还应验证XStream依赖项是否仍在pom.xml中