【Error】Could not find artifact lifecycle-mapping:lifecycle-mapping:jar:sources:1.0.0

在使用Mybatis Generator时遇到错误:'Could not find artifact lifecycle-mapping:lifecycle-mapping:jar:sources:1.0.0'。问题可能出在mybatis-generator.xml配置的路径错误,数据库驱动版本不匹配,或者lifecycle-mapping未正确引入本地Maven仓库。解决方法包括检查配置,统一驱动版本,并手动将lifecycle-mapping引入本地仓库。

使用mybatis-generator快捷创建文件,Idea运行run mybatis-generator时报错。

java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact lifecycle-mapping:lifecycle-mapping:jar:sources:1.0.0 in alimaven (http://maven.aliyun.com/nexus/content/groups/public/)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:423)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:225)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:202)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:257)
	at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.resolve(Maven3XServerEmbedder.java:1245)
	at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.doResolve(Maven3XServerEmbedder.java:1195)
	at org.jetbrains.idea.maven.server.Maven3XServerEmbed
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.sina.data.game</groupId> <artifactId>TelevisionProgramGame</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>TelevisionProgramGame</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.9</version> </dependency> <dependency> <groupId>org.apache.htrace</groupId> <artifactId>htrace-core</artifactId> <version>3.1.0</version> <classifier>incubating</classifier> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-client</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-common</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-protocol</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-server</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-hadoop-compat</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> <version>1.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1-rc1</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.0.24.Final</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-auth</artifactId> <version>2.2.0</version> </dependency> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.3</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>net.sf.ezmorph</groupId> <artifactId>ezmorph</artifactId> <version>1.0.6</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>20030211.134440</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging-api</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>hadoop-lzo</groupId> <artifactId>hadoop-lzo-cdh4</artifactId> <version>0.4.15</version> <classifier>gplextras</classifier> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-client</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-common</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-hs</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-hs-plugins</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-jobclient</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-shuffle</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-examples</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-nfs</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>com.sina.Armyknife</groupId> <artifactId>sina</artifactId> <version>0.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.sina.hivexec</groupId> <artifactId>hive-exec</artifactId> <version>0.13.0</version> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.7.3</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>RELEASE</version> </dependency> </dependencies> <repositories> <repository> <id>thirdparty</id> <name>3rd party</name> <url> http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/thirdparty </url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>cdh.repo</id> <name>Cloudera Repositories</name> <url> http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/cdh.repo/ </url> </repository> <repository> <id>central</id> <name>Central</name> <url> http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central </url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> <id>public</id> <name>Public Repositories</name> <url>http://repo.hadoop.data.sina.com.cn:8081/nexus/content/groups/public/</url> </pluginRepository> <pluginRepository> <id>central</id> <name>Public Repositories</name> <url>http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central</url> </pluginRepository> </pluginRepositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.11.0</version> <configuration> <compilerArgs> <arg>--add-modules=jdk.compiler</arg> <!-- 替代旧版tools.jar --> </compilerArgs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <configuration> <descriptors> <descriptor> src/main/assembly/assembly.xml </descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.10</version> <configuration> <parallel>false</parallel> </configuration> </plugin> <!-- add extra plugins here --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> </manifest> </archive> </configuration> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <versionRange>[1.0.0,)</versionRange> <goals> <goal>copy-dependencies</goal> </goals> </pluginExecutionFilter> <action> <ignore/> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </pluginManagement> </build> </project> pom文件如上,打包报错[ERROR] Failed to execute goal on project TelevisionProgramGame: Could not collect dependencies for project com.sina.data.game:TelevisionProgramGame:jar:1.0-SNAPSHOT [ERROR] Failed to read artifact descriptor for org.apache.htrace:htrace-core:jar:incubating:3.1.0 [ERROR] Caused by: The following artifacts could not be resolved: org.apache.htrace:htrace-core:pom:3.1.0 (absent): Could not transfer artifact org.apache.htrace:htrace-core:pom:3.1.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [thirdparty (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/thirdparty, default, releases), cdh.repo (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/cdh.repo/, default, releases+snapshots), central (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central, default, releases)] [ERROR] Failed to read artifact descriptor for hadoop-lzo:hadoop-lzo-cdh4:jar:gplextras:0.4.15 [ERROR] Caused by: The following artifacts could not be resolved: hadoop-lzo:hadoop-lzo-cdh4:pom:0.4.15 (absent): Could not transfer artifact hadoop-lzo:hadoop-lzo-cdh4:pom:0.4.15 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [thirdparty (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/thirdparty, default, releases), cdh.repo (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/cdh.repo/, default, releases+snapshots), central (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central, default, releases)] [ERROR] Failed to read artifact descriptor for com.sina.Armyknife:sina:jar:0.5 [ERROR] Caused by: The following artifacts could not be resolved: com.sina.Armyknife:sina:pom:0.5 (absent): Could not transfer artifact com.sina.Armyknife:sina:pom:0.5 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [thirdparty (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/thirdparty, default, releases), cdh.repo (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/cdh.repo/, default, releases+snapshots), central (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central, default, releases)] [ERROR] Failed to read artifact descriptor for com.sina.hivexec:hive-exec:jar:0.13.0 [ERROR] Caused by: The following artifacts could not be resolved: com.sina.hivexec:hive-exec:pom:0.13.0 (absent): Could not transfer artifact com.sina.hivexec:hive-exec:pom:0.13.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [thirdparty (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/thirdparty, default, releases), cdh.repo (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/cdh.repo/, default, releases+snapshots), central (http://repo.hadoop.data.sina.com.cn:8081/nexus/content/repositories/central, default, releases)] [ERROR]
最新发布
09-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值