idea构建maven项目报错,没有src目录

努力的欢欢 2019-09-22 02:57:15



用idea构建maven项目报错,按照网上该设置也设置了,也是没有效果,我真的很着急,在电脑面前呆了两天,都没解决,好心酸!
报错信息:
[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Failed to resolve version for org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-metadata.xml in local (E:\repository) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[ERROR] Maven execution terminated abnormally (exit code 1)

网上说的另外一种解决方案另外一种:把archetype-catalog.xml先下载下来,放在maven已修改本地的本地仓库位置下的org.apche.maven,archetype.archetype-catalog下,但是我没有这个目录archetype.archetype-catalog




...全文
334 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
oh_Maxy 2019-09-23
  • 打赏
  • 举报
回复
感觉还是maven仓库配置的问题。
你的网络直接访问aliyun仓库,可以访问吗?
再检查下.m2文件夹下的配置文件。

实在不行,重新下载个maven,从头到尾,按照正确的配置步骤,重新处理一下试试看呢。
努力的欢欢 2019-09-23
  • 打赏
  • 举报
回复
引用 9 楼 oh_Maxy 的回复:
网络的问题,那就比较复杂了。。
可以不纠结了。。


好的,非常感谢,另外上面还有一个问题,你能跟我说说吗
oh_Maxy 2019-09-23
  • 打赏
  • 举报
回复
网络的问题,那就比较复杂了。。
可以不纠结了。。
努力的欢欢 2019-09-23
  • 打赏
  • 举报
回复
[quote=引用 6 楼 ninuxGithub 的回复:]

你说的这些我明白,是按照你说的这样配的,我已经找到问题了,问题让我很费解,就是我不能用阿里云镜像,但是别人可以用,我不知道为什么,我换了个下载地址:http://repo.maven.apache.org/maven2,居然可以了


努力的欢欢 2019-09-23
  • 打赏
  • 举报
回复
[quote=引用 5 楼 oh_Maxy 的回复:]

网络直接访问阿里云仓库,404,写的是不影响构建使用,然后我还是换了一个地址:http://repo.maven.apache.org/maven2,居然可以了,为啥我电脑就用不了阿里云的镜像........,但是别人可以用阿里云镜像,我看网上都说用阿里云镜像,然后就没注意这个问题。


另外:我现在已经可以成功构建maven项目,我的结构是这样的:parent:commom pojo interface manager , 然后manager是个聚合工程,下面有:dao web service.
我就想问一下在我创建commom pojo interface manager这个几个工程的时候,因为我要把他们处于平行的,而不是像dao web
servcie 这些模块在manager下处于树状显示,所以图面下的位置要不要选,还是说改成none,



ninuxGithub 2019-09-23
  • 打赏
  • 举报
回复
个人感觉你好像是太理解maven的配置 首先我们系统里面需要一个maven 下载好后 配置到path里面去 : mvn --version查看版本, 出现版本为成功 第二部:编写自己的setting文件

<?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">
	<!--保存jar的仓库目录-->
	<localRepository>D:/apache-maven-repository</localRepository>
	<pluginGroups></pluginGroups>

	<proxies></proxies>
	<servers>
		<server>
			<id>nexus</id>			
		</server>
	</servers>
	<mirrors>			
		<mirror>
			<id>nexus</id>
			<mirrorOf>central</mirrorOf>
			<name>Nexus aliyun</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
		</mirror> 
	</mirrors>

	<profiles>
		<profile>
			<id>nexus</id>
			<!--Enable snapshots for the built in central repo to direct -->
			<!--all requests to nexus via the mirror -->
			<repositories>
				<repository>
					<id>central</id>
					<url>http://central</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>central</id>
					<url>http://central</url>
					<releases>
						<enabled>true</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
		<profile>
			<id>jdk-1.8</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<jdk>1.8</jdk>
			</activation>
			<properties>
				<maven.compiler.source>1.8</maven.compiler.source>
				<maven.compiler.target>1.8</maven.compiler.target>
				<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
				<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
			</properties>
		</profile>
	</profiles>

	<activeProfiles>
		<!--make the profile active all the time -->
		<activeProfile>nexus</activeProfile>
	</activeProfiles>
</settings>
第三部: 配置到IDE的环境里面去 我的jdk版本是1.8 , maven 3.5.0;
努力的欢欢 2019-09-22
  • 打赏
  • 举报
回复
引用 3 楼 oh_Maxy 的回复:
https://blog.csdn.net/fn0723/article/details/81160344
参考看看呢





我单配置到项目下,把settings里面(注掉和不住掉都试过了),一样不行
数字1:单独在项目里配置的镜像
数字2:本地仓库中的jar不能用了
数字3:去阿里云镜像下载也下载不了
oh_Maxy 2019-09-22
  • 打赏
  • 举报
回复
https://blog.csdn.net/fn0723/article/details/81160344
参考看看呢
努力的欢欢 2019-09-22
  • 打赏
  • 举报
回复
引用 1 楼 oh_Maxy 的回复:
是突然不行了,还是一直都不行?


一直不行,但是我不使用maven内置的的骨架可以正常创建。

然后我这两天一直在找问题,我觉得最有可能的问题就是我的maven,因为我只要在maven 里面的stttings配置文件添加阿里云镜像依赖
以后,根本不去中央仓库下载jar包并且本地仓库的jar包都依赖不进来,然后我去官网又下载了一个maven,然后再stttings配置文件添加阿里云镜像,还是出现同样的问题,这是为什么?

<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central</url>
</mirror>
oh_Maxy 2019-09-22
  • 打赏
  • 举报
回复
是突然不行了,还是一直都不行?

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧