Maven。资源文件夹的目的是什么? [英] Maven. What is the purpose for the resource folder?

查看:609
本文介绍了Maven。资源文件夹的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在任何人说明之前阅读xyz这里的情况。刚刚搬到一个旧项目。所有的系统知识都丢失了,因为没有人在项目上或在建立它的公司。我不知道Maven和它如何工作。截止日期是星期一。



使用先前在项目中被另一个开发人员使用的eclipse ide。大多数事情被标记为红色和破碎。查看
中的文件src / main / java / ...
和在
中的相同的完整文件java resources / src / main / java ...



对于什么是什么,什么是temp,保存到垃圾桶或如何修复项目环境感到困惑。



这或者我只是告诉mgmt。我会在几个星期后找到如何让Maven工作回来。

解决方案

$ <$> $ <$> $ <$> > src / main / resources 通常是将非Java工件放入标准包层次结构中,例如作为classpath资源加载的XML配置文件。



除了说检查你的Maven文件以查看是否真的引用了这些文件,特别是如果有什么东西生成文件到那里,或者把它们作为程序集的一部分移动到那里,这是不可能的。过程,但是,这将是非标准的Maven使用。


Before anyone says go read xyz here is the situation. Just got moved onto an old project. All knowledge of the system is lost as nobody is on the project or at the company that had built it. I am unaware of Maven and how it works. Deadline to get something is Monday.

Using The eclipse ide that was being used prior on the project by another developer. Most things are flagged as red and broken. Seeing files in src/main/java/... and the same exact files over in java resources/src/main/java...

Just confused over what is what, what is temp, what to keep to trash or how to fix the project environment.

Any easy fix to this or do I just tell mgmt. hey i'll get back to you in a few weeks once I figure out how to get Maven to work?

解决方案

There's no standard for anything at the root level called resources.

src/main/resources is normally where you put non-Java artifacts that should be moved into the normal package hierarchy, like XML config files loaded as classpath resources.

It's impossible to help much beyond that, other than to say "check your Maven file to see if anything actually references those files", particularly if anything generates files to there, or moves them there as part of an assembly process, but again, that would be non-standard Maven usage.

这篇关于Maven。资源文件夹的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆