pom.xml 內容:html
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> </dependency>
報錯誤:Missing artifact net.sf.json-lib:json-lib:jar:2.4:compilejava
緣由:json-lib是須要區分jdk版本的,pom.xml中的配置應加上標籤classifier指定jdk版本,如用jdk15json
修改成:maven
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier><!--指定jdk版本--> </dependency>
相似問題:hibernate
maven javax.transaction:jta:jar:1.0.1B:compile錯誤提示:code
解決辦法:xml
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.1.ga</version> <optional>false</optional> <exclusions> <exclusion> <artifactId>jta</artifactId> <groupId>javax.transaction</groupId> </exclusion> </exclusions> </dependency>
log4j.jar引發的missing artifact javax jms jms jar 1.1問題:htm
解決辦法:緣由是log4j在1.2.15及以上版本更換了協議,與jms衝突,因此用log4j的1.2.14版本就能夠啦io
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency>