简体   繁体   English

使用 /src/resources 作为新 package 的源目录

[英]Use /src/resources as source directory for a new package

I would like to create a new package in Inteliji IDEA (Community Edition) where the source directory is /src/main/resources.我想在 Inteliji IDEA(社区版)中创建一个新的 package,其中源目录是 /src/main/resources。 I am trying to create a simple forge mod, and need to create several packages in resources for handling textures and other assets.我正在尝试创建一个简单的锻造模组,并且需要在资源中创建几个包来处理纹理和其他资产。 My file structure looks like this:我的文件结构如下所示:

Main
>Java
 >com.mycompany.project
  >Package1
  >Package2
  >Main.java
Resources
 >mcmod.info
 >pack.mcmeta

Is there any way to create a package in /src/main/resources?有什么方法可以在 /src/main/resources 中创建 package 吗? I have seen examples of this being done in Eclipse, but I would prefer to not have to use two IDEs.我在 Eclipse 中看到了这样的例子,但我宁愿不必使用两个 IDE。

Please refer to the documentation .请参阅文档

I believe you can do it by right clicking on Resources folder, then New -> Directory and then specify the package com.mycompany.project .我相信你可以通过右键单击Resources文件夹,然后New -> Directory然后指定 package com.mycompany.project来做到这一点。 Intellij will create the hierarchical package structure. Intellij 将创建分层 package 结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 src/test/resources 作为 gradle java 的目录 - Use src/test/resources as directory with gradle java 让 Eclipse 使用 src/test/resources 而不是 src/main/resources - Make Eclipse use src/test/resources instead of src/main/resources 如何创建 src/main/resources 目录? - How to create a src/main/resources directory? 如何使用@ImportResource导入src / main / resources / static中的配置文件的整个目录? - How can I use @ImportResource to import an entire directory of config files in src/main/resources/static? 从源代码动态访问src / main / resources / - Access src/main/resources/ dynamically from source code 如何以编程方式在Java资源src目录中创建Java文件 - How to make java file in java resources src directory programmatically 如何在 JUnit 中获取 src/test/resources 目录的路径? - How to get the path of src/test/resources directory in JUnit? src\main\resources\db.properties(没有这样的文件或目录) - src\main\resources\db.properties (No such file or directory) Maven编译找不到src / main / resources目录 - Maven Compile cant find src/main/resources directory 如何让SpringBoot在src/main/resources目录下找到我的文件 - How to get SpringBoot to find my file in the src/main/resources directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM