Skip to content

Commit 8c743fb

Browse files
Restructure and reformat content
1 parent aaf08bf commit 8c743fb

File tree

2 files changed

+52
-42
lines changed

2 files changed

+52
-42
lines changed

content/en/docs/refguide/java-programming/managed-dependencies/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Platform-supported Marketplace modules created by Mendix have been updated with
7878

7979
## Custom Repositories{#custom-repos}
8080

81-
By default, dependencies are downloaded from the [Maven Central](https://central.sonatype.com/) repository. In some scenarios, you may want to specify a custom location. For example, if your organization has its own repository to cache downloads or as an alternative if internet access is restricted in an air-gapped setup.
81+
By default, dependencies are downloaded from the [Maven Central](https://central.sonatype.com/) repository. In some scenarios, you may want to specify a custom location. For example, if your organization has its own repository to cache downloads or as an alternative if internet access is restricted in an air-gapped setup. More details on how to setup custom repositories can be found [here](/refguide/managed-dependencies/custom-repositories)
8282

8383
Custom repositories are configured in the **Repositories** setting of the **Deployment** tab in the [Preferences](/refguide/preferences-dialog/) dialog box. This setting uses the same syntax as Gradle. To configure a custom repository server that is accessible via URL, use the following configuration (credentials are optional):
8484

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,53 @@
11
---
2-
title: "Custom Repositories"
2+
title: "How to setup Custom Repositories"
33
url: /refguide/managed-dependencies/custom-repositories
44
weight: 2
55
description: "Describes how to setup a custom repository locally"
66
---
77

8+
{{% alert color="info" %}}
9+
This document is relevant to developers who want to use Managed Dependencies and an internet-restricted or air-gapped setup
10+
{{% /alert %}}
11+
812
# Introduction
913

10-
This document will guide you on how you can setup a custom repository like JFrog locally and configure Studio Pro to use it to resolve the Mendix project dependencies. We'll also cover how to use a simple flat file folder to store your `.jar` files. This will allow you to manage your project's dependencies more efficiently, especially for internal libraries or when internet access is limited.
14+
If your development environment has restricted or no access(air-gapped) to the internet, the background job that automatically resolves your project dependencies will fail. Due to this, you'll not be able to build and run your Mendix project. For such cases, we would recommend you to setup a custom repository so that Studio Pro can resolve the required dependencies.
15+
This document will guide you on how you can set up a local repository or a remote artifactory like JFrog and configure Studio Pro to use it to resolve the project dependencies. We'll also cover how to use a simple flat file folder to store your `.jar` files. This will allow you to manage your project's dependencies more efficiently, especially for internal libraries or when internet access is limited.
1116

12-
## 1. Understanding Custom Repositories
17+
# Understanding Custom Repositories
1318

14-
Think of a custom repository as your own personal library for software components (like `.jar` files). Instead of downloading everything from the public internet (like Maven Central), you can store frequently used or private components in your own repository. This can make your builds faster and more reliable.
19+
Think of custom repositories as your own personal library for software components (like `.jar` files). Instead of downloading everything from the public internet (like Maven Central), you can store frequently used or private components in your own repository. This can make your builds faster and more reliable.
20+
This is also the recommended setup when there is limited or no access to the internet.
1521

1622
* **JFrog Artifactory** and **Sonatype Nexus** are popular tools that act as these "personal libraries." They can store your own libraries, and also "proxy" public repositories, meaning they download from the internet once and then serve it to everyone in your team from their local cache.
17-
* **Flat Directory:** This is the simplest option. You just put your `.jar` files into a regular folder on your computer and Studio Pro can read them directly from there.
23+
* **Local repository:** This is a folder on your network which potentially contains your project dependencies. The folder can either follow the maven-style layout or can be a simple folder containing your dependencies.
1824

19-
## 2. Using custom repositories with Studio Pro
25+
# How to set up a Remote Repository
2026

21-
### 2.1 Setting up to a Remote repository
27+
## 1. Prerequisites
2228

23-
In this example, we have made use of JFrog. You can opt for any tool of your choice. Most of the repositories in the market have very similar capabilities.
29+
In this example, we have made use of JFrog. You can opt for any tool of your choice. Most of the repositories in the market have very similar capabilities. You can install this on your local machine or host it on a local network.
2430

25-
#### Installing JFrog
31+
### Installing JFrog
2632

27-
Follow the installation steps from the [official documentation page](https://jfrog.com/help/r/jfrog-installation-setup-documentation/installation-steps) of JFrog to install it on your local system. If you don't have permissions to install software on your system, you can request your IT department to create a remote instance for you and provide credentials to access it.
33+
Follow the installation steps from the [official documentation page](https://jfrog.com/help/r/jfrog-installation-setup-documentation/installation-steps) of JFrog to install it on your local system. If you don't have permissions to install software on your system or local network, you can request your IT department to create a remote instance for you and provide credentials to access it.
2834

29-
#### Important Configuration for JFrog/Nexus
35+
## 2. Configuring the repository
3036

31-
When setting up your custom repository (JFrog), it's crucial to ensure it can access public repositories like Maven Central and Gradle Plugin Portal. If your repository doesn't have these configured as "proxy" sources, you might encounter errors when Studio Pro tries to sync the required dependencies. Following are the two public repositories you will have to configure.
37+
When setting up your remote repository (JFrog), it's crucial to ensure it can access public repositories like Maven Central and Gradle Plugin Portal. If your repository doesn't have these configured as "proxy" sources, you might encounter errors when Studio Pro tries to sync the required dependencies. Following are the two public repositories you will have to configure.
3238

3339
* **Maven Central URL:** `https://repo1.maven.org/maven2/`
3440
* **Gradle Plugins Repository URL:** `https://plugins.gradle.org/m2/`
3541

3642
{{< figure src="/attachments/refguide/java-programming/managed-dependencies/jfrog-remote-repositories.png" class="no-border" >}}
3743

38-
### 2.2 Setting up a directory with required dependencies
39-
40-
For some scenarios, you may want to keep your setup simple and minimal. For such cases, you can create folders on your system and store the dependencies in it.
41-
42-
We make use of the CycloneDx Gradle Plugin to generate the `vendorlib-sbom.json` file. You will have to create a `m2` (Maven) style directory which will contain this plugin. You can download it from the [Mendix GitHub repo](broken-link)
43-
44-
For the project level dependencies, you can simply place them in the directory and point Studio Pro to it.
44+
## 3. Configuring Studio Pro to use remote repository
4545

46-
Insert image - folder containing cycloneDx
47-
Insert image - flat dir
48-
49-
### 2.3 Configuring Studio Pro to use the custom repository
50-
51-
Now that your local repository is set up, you need to tell Studio Pro where to find these dependencies.
46+
Once you have set up your remote repository, you need to add a few configuration settings in Studio Pro. This will enable Studio Pro to resolve dependencies from the remote repository.
5247

5348
- Go to `Edit -> Preferences -> Deployment -> Use custom repository`. Enable this option.
5449
- Input the following settings into the text area field that will appear once your enable the above option
5550
```gradle
56-
// Use this configuration to configure Studio Pro to fetch dependencies from an artifactory.
57-
5851
maven {
5952
url = uri("http://localhost:8046/artifactory/maven-remote/") // Make sure to use the correct url to your repository
6053
// If the repository requires authentication, then uncomment the following config
@@ -74,22 +67,39 @@ Now that your local repository is set up, you need to tell Studio Pro where to f
7467
//}
7568
}
7669
```
77-
```
78-
// Use this configuration if you dont prefer using a remote repository.
79-
80-
flatDir {
81-
dirs '../libs' // This is the path to the project level dependencies. It is recommended to use absolute paths. But relative path can also be used.
82-
}
83-
84-
// This is for the CycloneDx Gradle plugin
85-
maven {
86-
url = uri("C:/Users/user/Documents/gradle-remote") // Replace with your local m2 repo path
87-
}
88-
```
89-
9070
- Press Ok and Studio Pro will start syncing the dependencies for the project.
9171
- If everything goes well, you'll be able to see your `vendorlib` directory populated with the required project dependencies and `vendorlib-sbom.json` file.
9272
- Then you can run the app to verify if it works.
9373
94-
## Troubleshooting
74+
# How to set up a local Repository
9575
76+
## 1. Prerequisites
77+
78+
For scenarios where you have absolutely no access to the internet(air-gapped), you can create a folder on your local system which will contain all the project dependencies. Then you can configure Studio Pro to resolve dependencies from this folder.
79+
80+
### Downloading M2 repository
81+
We use [CycloneDx Gradle Plugin](https://github.com/CycloneDX/cyclonedx-gradle-plugin) to generate the `vendorlib-sbom.json` file. This is for Compliance and Security requirements. You will have to create a `m2` (Maven) style directory which will contain this plugin. You can download it from the [Mendix GitHub repo](broken-link)
82+
83+
## 2. Configuring the repository
84+
85+
Create a folder containing a flattened list of all the project dependencies. Make sure you store this on your local system where Studio Pro has read/write access to it.
86+
87+
## 3. Configuring Studio Pro to use local repository
88+
89+
Once you have set up your local repository, you need to add a few configuration settings in Studio Pro. This will enable Studio Pro to resolve dependencies from the local repository.
90+
91+
- Go to `Edit -> Preferences -> Deployment -> Use custom repository`. Enable this option.
92+
- Input the following settings into the text area field that will appear once your enable the above option
93+
```gradle
94+
flatDir {
95+
dirs '../libs' // This is the path to the project level dependencies. It is recommended to use absolute paths. But relative path can also be used.
96+
}
97+
98+
// This is for the CycloneDx Gradle plugin
99+
maven {
100+
url = uri("C:/Users/user/Documents/gradle-remote") // Replace with your local m2 repo path
101+
}
102+
```
103+
- Press Ok and Studio Pro will start syncing the dependencies for the project.
104+
- If everything goes well, you'll be able to see your `vendorlib` directory populated with the required project dependencies and `vendorlib-sbom.json` file.
105+
- Then you can run the app to verify if it works.

0 commit comments

Comments
 (0)