In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use project, module and artifact in idea. I hope you will get something after reading this article. Let's discuss it together.
There is no concept of workspace in idea, and every project is a workspace, so when we open a new project, we often have to configure jdk, compiled version, compiled output path, maven packaging settings, and so on. There is a concept of module under project, which is similar to project in eclipse. If a project is an aggregation project, it can configure multiple module. Module mainly configures the code structure of this module, compilation output path, dependency management and so on.
Because all the dependencies (Tomcat, etc.) are included in this module, the jar package project can be run directly as long as it is compiled. But if it is a war package project, it needs to be deployed in a container such as Tomcat, so you need to have an artifact.
About the role of artifact, one blogger in CSDN said:
Artifact is a solution for loading project assets for testing, deployment, or distributed software. For example, centrally compiling class, archiving java application packages, web programs as directory structures, or web program archives, etc.
1. Project [Engineering]
Here is mainly for the global configuration, but the current projects are generally multi-module, the specific requirements of each module are not the same, so most of the configurations here will be covered by module configuration.
2. Modules [module, a poject can contain multiple]
Configure for each module, and most of the configurations that we have taken effect are here.
The method of creating a new module
After deleting the parent destination src, right-click the new of the parent project
III. Libraries
Pom depends on import, which is fine, so you don't need to set it up here, right?
4. Facets [set the web.xml configuration file and Web resource directory read by Tomcat]
Facets (noun: aspect)
5. Artifacts [the package and deployment settings of the project, which is the key part of the project configuration]
Artifact can be used as an archive file or as a directory structure that contains the following structural elements:
One or more compiled modules, class libraries on which modules depend, Resources collections, other artifacts, separate file directories or archives
To put it more bluntly, that is to say, how does a certain module pack?
Such as war exploded, war, jar, ear and so on.
A module with Artifacts can be deployed to the application server.
Jar:Java ARchive, which is usually used to aggregate a large number of Java class files, related metadata and resource (text, pictures, etc.) files into one file for distribution of Java platform applications or libraries
War:Web application ARchive, a JAR file that contains JSP, Java Servlet, Java classes, XML files, tag libraries, static web pages (HTML and related files) for distribution, and other resources that make up Web applications
Exploded: here you can understand the meaning of unfolding, not compressing. That is, the directory structure before war, jar and so on are not compressed. It is recommended to use this mode during development, so that the effect of modifying the file can be shown immediately.
By default, IDEA's Modules and Artifacts's output directories have been set up and do not need to be changed. Classes will be automatically generated in the WEB-INF directory when it is packed into a war package, and then the compiled files will be put in.
Specific operations:
Web Application: Exploded,Web Application: Archive
The two packaged things are the same, except that the Archive type is compressed, and the Exploded type is generally chosen for development.
After reading this article, I believe you have a certain understanding of "how to use project, module and artifact in idea". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.