Skip to content

Commit

Permalink
Add some notes about repo ordering, as requested in #5312
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Nov 15, 2018
1 parent 83031f3 commit f2274bf
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion doc/sphinx-guides/source/developers/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,44 @@ This will however not help you with detecting possible version conflicts. For th
<https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html>`_. It might be considered in a future
version of Dataverse to make this a default step in the build lifecycle of Dataverse.

----
Repositories
------------

Maven receives all dependencies from *repositories*. Those can be public like `Maven Central <https://search.maven.org/>`_
and other, but you can also use a private repository on premises or in the cloud. Last but not least, you can use
local repositories, which can live next to your application code (see ``local_lib`` dir within Dataverse codebase).

Repositories are defined within the Dataverse POM like this:

.. code:: xml
<repositories>
<repository>
<id>central-repo</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
</repository>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>dvn.private</id>
<name>Local repository for hosting jars not available from network repositories.</name>
<url>file://${project.basedir}/local_lib</url>
</repository>
</repositories>
You can also add repositories to your local Maven settings, see `docs <https://maven.apache.org/ref/3.6.0/maven-settings/settings.html>`_.

Typically you will skip the addition of the central repository, but adding it to the POM has the benefit, that
dependencies are first looked up there (which in theory can speed up downloads). You should keep in mind, that repositories
are used in the order they appear.

----
.. [#ide] Modern IDEs import your Maven POM and offer import autocompletion for classes based on direct dependencies
in the model. You might end up using legacy or repackaged classes because of a wrong scope.
.. [#ide2] This is going to bite back in modern IDEs when importing classes from transitive dependencies by "autocompletion accident".
Expand Down

0 comments on commit f2274bf

Please sign in to comment.