用myeclipes 2018 的时候 创建WEB项目
pom.xml会直接报错,网上查就是MAVEN问题。(自己也试过删除maven仓库没用)
然后用了idea 用maven方式创建项目,输入坐标后还是会报错如下:
Could not find artifact org.mybatis:mybatis:pom:x.x.x in central
现在连创建项目都是问题 。。求大神帮忙解决
是不是配置的setting.xml文件有问题
看问题应该是在仓库或者镜像中没有找到你需要的这个jar包。
那么问题应该是一下两者之一:
1.仓库或者镜像不对,不过这个错误我记得不是这样提示的。
2.这个仓库或者镜像里确实不存在这个jar
你可以尝试最最下面这个setting.xml文件,使用的是aliyun参考。至于mybatis的jar包可以在pom.xml文件中配置:
(官方最新版本是3.5.4,版本无所谓,maven配置方法都是一样)
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.1</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> -->
<localRepository>D:/mvnrepository</localRepository>
<pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> </pluginGroups>
<proxies></proxies>
<servers></servers>
<mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. |-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles> -->
</settings>