What is an artifact and why does Maven need it?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Maven organizes its build in projects.
An
artifact
in maven is a resource generated by a maven project. Each maven project can have exactly oneartifact
like ajar, war, ear
, etc.The project's configuration file
"pom.xml"
describes how the artifact is build, how unit tests are run, etc. Commonly a software project build with maven consists of many maven-projects that build artifacts (e.g. jars) that constitute the product.E.g.
Maven artifacts are not limited to java resources. You can generate whatever resource you need. E.g. documentation, project-site, zip-archives, native-libraries, etc.
Each maven project has a unique identifier consiting of
[groupId, artifactId, version]
. When a maven project requires resources of another project a dependency is configured in it'spom.xml
using the above-mentioned identifier. Maven then automatically resolves the dependencies when a build is triggered. The artifacts of the required projects are then loaded either from the localrepository
, which is a simple directory in your user's home, or from other (remote) repositories specified in youpom.xml
.An artifact is a file, usually a JAR, that gets deployed to a Maven repository.
A Maven build produces one or more artifacts, such as a compiled JAR and a "sources" JAR.
Each artifact has a group ID (usually a reversed domain name, like com.example.foo), an artifact ID (just a name), and a version string. The three together uniquely identify the artifact.
A project's dependencies are specified as artifacts.
Q. What is Artifact in maven?
ANS: ARTIFACT is a JAR,(WAR or EAR), but it could be also something else. Each artifact has,
The three together uniquely identify the artifact.
Q.Why Maven need them.
Ans: Maven is used to make them available for our applications.
Simple answer to a simple question :)
usually we talking Maven Terminology about Group Id , Artifact Id and Snapshot Version
Group Id:identity of the group of the project Artifact Id:identity of the project Snapshot version:the version used by the project.
Artifact is nothing but some resulting file like Jar, War, Ear....
simply says Artifacts are nothing but packages.
An artifact is a JAR or something that you store in a repository. Maven gets them out and builds your code.
In general software terms, an "artifact" is something produced by the software development process, whether it be software related documentation or an executable file.
In Maven terminology, the artifact is the resulting output of the maven build, generally a
jar
orwar
or other executable file. Artifacts in maven are identified by a coordinate system of groupId, artifactId, and version. Maven uses thegroupId
,artifactId
, andversion
to identify dependencies (usually other jar files) needed to build and run your code.