APPS-896 Update Maven setup instructions

This commit is contained in:
Cezar.Leahu
2021-04-02 16:15:18 +03:00
parent 6c7efded6f
commit 3dfb1cafed

View File

@@ -4,15 +4,74 @@
Please refer to our [How to contribute](/CONTRIBUTING.md) guide and our [Contributor Covenant Code of Conduct](/CODE_OF_CONDUCT.md).
## Configuring the ~/.m2/settings.xml file for local development
In order to be able to pull all the necessary project dependencies, the alfresco Maven
repositories should be configured in your local `~/.m2/settings.xml` file on your workstation.
In order to be able to pull all the necessary project dependencies, the alfresco Nexus
repositories should be added in your local Maven configuration on your workstation.
The necessary `<repository/>` and `<pluginRepository/>` configuration is available in the
[.travis.settings.xml](.travis.settings.xml) file (_alfresco-internal_ profile),
which is used by the project 's CI pipeline.
Just copy the **alfresco-internal** profile into your own `~/m2/repository.xml`.
You will also need to define an `alfresco-internal` server, but with your own Alfresco Nexus
credentials.
Update your `~/.m2/settings.xml` file with the _repositories_, _pluginRepositories_ and, optionally,
the _servers_ defined in the following snippet:
```xml
<settings>
<profiles>
<profile>
<id>alfresco-internal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>alfresco-internal</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<name>Alfresco Internal Repository</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>alfresco-internal</id>
<name>Alfresco Internal Repository</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<servers>
<server>
<id>alfresco-internal</id>
<username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>
```
The `alfresco-internal` server definition is required by the Alfresco _internal_ repository
group, and it should use your own Alfresco Nexus credentials. If only the _public_ repository
group is used (e.g., for the Community build) this server definition can be skipped.
Optionally, you can also re-define the Maven Central repository, to increase the dependency download
speed (look up dependencies first in Maven Central, then in Alfresco Nexus). Define the
_Central Repository_ in both the `<repositories/>` and `<pluginRepositories/>` sections before
the _alfresco-internal_ repository:
```xml
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
```
For additional instructions you can check the official Maven documentation:
* [setting up repositories](https://maven.apache.org/guides/mini/guide-multiple-repositories.html)