pom文件提示错误,信息如下
Description Resource Path Location Type
Failure to transfer com.thoughtworks.xstream:xstream:jar:1.4.3 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.thoughtworks.xstream:xstream:jar:1.4.3 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 pom.xml /testweb line 1 Maven Configuration Problem
或者
Failure to transfer org.apache.maven.plugins:maven-surefire-plugin
网上搜到的方案 如下
1 删除m2\repository 所有 .lastUpdated为扩展名的文件
2 打开cmd 在 工程目录执行 mvn clean install -U ,注意U 大写
这两个方案我本地都不好使。。。
最后用最笨的方法,把另一台电脑的 respository目录直接拷贝覆盖本地的,
问题解决
总结
这个问题一般发生在 新建工程时
现象是 Pom 文件第一行提示出错,各种找不到jar
这个问题是由于 .lastUpdated 文件引起的
相关推荐
Maven坐标:com.thoughtworks.xstream:xstream:1.4.11; 标签:thoughtworks、xstream、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,...
Maven坐标:com.thoughtworks.xstream:xstream:1.4.7; 标签:thoughtworks、xstream、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,...
Maven坐标:com.thoughtworks.xstream:xstream:1.4.7; 标签:thoughtworks、xstream、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化...
Maven坐标:com.thoughtworks.xstream:xstream:1.4.11; 标签:thoughtworks、xstream、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化...
赠送jar包:mail-1.4.7.jar; 赠送原API文档:mail-1.4.7-javadoc.jar; 赠送源代码:mail-1.4.7-sources.jar; 包含翻译后的API文档:mail-1.4.7-javadoc-API文档-中文(简体)-英语-对照版.zip 对应Maven信息:...
import com.thoughtworks.xstream.XStream; public class Person { private String name; private int age; // getters and setters } XStream xstream = new XStream(); String xml = xstream.toXML(new...
import com.thoughtworks.xstream.XStream; public class XStreamDemo { public static void main(String[] args) { // 初始化 XStream XStream xstream = new XStream(); // 定义 Java 对象 Person person =...
import com.thoughtworks.xstream.converters.UnmarshallingContext; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; public class...
import com.thoughtworks.xstream.XStream; // 创建XStream实例 XStream xstream = new XStream(); // 序列化对象到XML字符串 String xml = xstream.toXML(yourObject); // 反序列化XML字符串到对象 YourObject ...
通过实现`com.thoughtworks.xstream.converters.Converter`接口并注册到XStream实例中,你可以控制XML的生成和解析过程。 **安全模式** 为了防止XSS攻击,XStream提供了安全模式,可以限制哪些类可以被序列化或反...
import com.thoughtworks.xstream.XStream; public class Main { public static void main(String[] args) { Person person = new Person("John Doe", 30); XStream xstream = new XStream(); String xml = ...
import com.thoughtworks.xstream.XStream; public class XStreamDemo { public static void main(String[] args) { // 创建一个XStream实例 XStream xstream = new XStream(); // 定义一个对象 Person ...
import com.thoughtworks.xstream.XStream; public class User { private String name; private int age; // 构造器、getter和setter省略 public static void main(String[] args) { XStream xstream = new ...
String xml = xstream.toXML(person); ``` 5. **反序列化**:从XML字符串恢复Java对象。 ```java Person deserializedPerson = (Person) xstream.fromXML(xml); ``` 6. **自定义映射**:xStream允许你自定义...
import com.thoughtworks.xstream.XStream; XStream xstream = new XStream(); xstream.alias("person", Person.class); ``` 这里我们为`Person`类设置了别名"person",在生成的XML中将使用这个别名。 4. 将...
import com.thoughtworks.xstream.annotations.XStreamAlias; @XStreamAlias("person") class Person { private String firstName; private String lastName; // 构造函数、getter和setter省略... } // 在主...
String jsonString = xstream.toXML(person); // Now it will generate JSON ``` #### 3.2 JSON反序列化为Java对象 将JSON字符串转换回`Person`对象: ```java xstream.setMode(XStream.NO_REFERENCES); xstream....
配置完成后,可以通过`com.thoughtworks.xstream.XStream`类实例化对象,开始进行对象到XML或XML到对象的转换。 三、XStream的基本用法 1. 对象转XML: XStream的`toXML()`方法可以将Java对象转换为XML字符串。例如...
import com.thoughtworks.xstream.io.xml.DomDriver; ``` 接下来,定义一个Java类,例如`Person`,它代表我们将要转换的对象: ```java public class Person { private String name; private int age; // ...
import com.thoughtworks.xstream.XStream; public class Main { public static void main(String[] args) { XStream xstream = new XStream(); Person person = new Person("张三", 30); String xml = xstream...