1 |
On 15.03.21 14:02, Kaibo Ma wrote: |
2 |
> 3. ERRATA |
3 |
> |
4 |
> The local maven repository would not be a good fit since it is on a |
5 |
> per-user basis (~/.m2). The correct way would be to define a path for |
6 |
> installing (such as /usr/share/.m2), and pass that to build tools as a |
7 |
> URL (file:///usr/share/.m2). |
8 |
|
9 |
Correct, the user-local maven repository is not suitable. |
10 |
|
11 |
I have been thinking about how to support "modern" Java-ish applications |
12 |
for a long time. One requirement is a system-wide maven repository. But |
13 |
you also need support from the build system, e.g. Gradle or Maven: |
14 |
|
15 |
|
16 |
1. We need to be able to tell the build system that it should only |
17 |
lookup artifacts from a particular repository, the system wide one. For |
18 |
example |
19 |
|
20 |
gradle --exlusive-maven-repository "${SYSTEM_WIDE_MAVEN_REPO}" |
21 |
|
22 |
2. We need to be able to tell the build system to install it's artifacts |
23 |
in a particular local repository, nowhere else. For example |
24 |
|
25 |
gradle publishToMavenLocal --into <directory> |
26 |
|
27 |
|
28 |
Given a Maven repositories structure, especially considering a Maven |
29 |
repositories metadata, I believe this needs some effort if <directory> |
30 |
is somewhere under ${D}. But nothing that is impossible to solve. |
31 |
|
32 |
And, I think it is clear that this *requires* support from the build |
33 |
systems. That is, any approach that is based on patching build system |
34 |
configuration to achieve similar results in fragile and hence not |
35 |
sustainable. |
36 |
|
37 |
I think it would be beneficial to team-up with other distrbutions. Even |
38 |
non source-based ones, like Debian, would benefit from an established |
39 |
and standardized system-wide Maven repository. |
40 |
|
41 |
But in summary, this is not a trivial task and it requires cooperation |
42 |
from and coordination with from the build systems. But if we want to |
43 |
continue packaging source-based Java-ish applications, that are not |
44 |
simply fat Jars, then we would need something like this. Hence I'd |
45 |
really like to see it one day. |
46 |
|
47 |
- Florian |