Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Apache Maven
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Dependencies === A central feature in Maven is [[Dependency (project management)|dependency management]]. Maven's dependency-handling mechanism is organized around a coordinate system identifying individual artifacts such as software libraries or modules. The POM example above references the JUnit coordinates as a direct dependency of the project. A project that needs, say, the [[Hibernate (Java)|Hibernate]] library simply has to declare Hibernate's project coordinates in its POM. Maven will automatically download the dependency and the dependencies that Hibernate itself needs (called [[Transitive dependency|transitive dependencies]]) and store them in the user's local repository. Maven 2 [https://search.maven.org/ Central Repository]<ref name="maven2repo"/> is used by default to search for libraries, but one can configure the repositories to be used (e.g., company-private repositories) within the POM. The fundamental difference between Maven and Ant is that Maven's design regards all projects as having a certain structure and a set of supported task work-flows (e.g., getting resources from source control, compiling the project, unit testing, etc.). While most software projects in effect support these operations and actually do have a well-defined structure, Maven requires that this structure and the operation implementation details be defined in the POM file. Thus, Maven [[Convention over configuration|relies on a convention]] on how to define projects and on the list of work-flows that are generally supported in all projects.<ref>{{cite web|title=Maven: The Complete Reference |url=http://www.sonatype.com/books/mvnref-book/reference/installation-sect-compare-ant-maven.html |publisher=Sonatype |access-date=11 April 2013 |url-status=dead |archive-url=https://web.archive.org/web/20130421060027/http://www.sonatype.com/books/mvnref-book/reference/installation-sect-compare-ant-maven.html |archive-date=21 April 2013 }}</ref> There are search engines such as The Central Repository Search Engine,<ref>[https://search.maven.org/ The Central Repository Search Engine]</ref> which can be used to find out coordinates for different open-source libraries and frameworks. Projects developed on a single machine can depend on each other through the local repository. The local repository is a simple folder structure that acts both as a cache for downloaded dependencies and as a centralized storage place for locally built artifacts. The Maven command <code>mvn install</code> builds a project and places its binaries in the local repository. Then, other projects can utilize this project by specifying its coordinates in their POMs.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)