0

我必须构建一个 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 文件(它们在 p.1 期间重新创建)替换为从 XStream 网站下载的文件。

两者都无济于事。我是 Java 世界的新手,不知道下一步该做什么。

顺便说一句,IDEA 看到了 XStream 类并让我们浏览它们。

问候,

4

1 回答 1

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 中

于 2012-10-07T15:48:48.510 回答