1 |
> It looks pretty straightforward at a first glance, but I think it |
2 |
> would require |
3 |
> other components because you are not providing any information of |
4 |
> the direct dependencies of the java packages/artifacts, which |
5 |
> means it might have to consult other sources (probably a remote repo) |
6 |
> first, and then attempts to resolve to a local JAR from your |
7 |
> WorkspaceReader. |
8 |
|
9 |
Hm, not sure I understand your point. A WorkspaceReader provides the |
10 |
information about direct dependencies just like a Maven repository does, |
11 |
i.e., via POM artifacts (just like Maven resolves POM artifacts from a |
12 |
local/remote Maven repository, Maven would also resolve POM artifacts |
13 |
via a WorkspaceReader). |
14 |
|
15 |
> Have you tested this with --offline and the local maven cache (~/.m2) |
16 |
> cleared beforehand to see if your extension can actually work in a |
17 |
> sandboxed environment? |
18 |
|
19 |
I have tested it so far to see that both POM and JAR artifacts are |
20 |
resolved via the WorkspaceReader (also in combination with the --offline |
21 |
flag and the local maven cache cleared, yes). |
22 |
|
23 |
> It seems that having a local maven repository is the only |
24 |
> straightforward |
25 |
> and easy solution which doesn't involve much heavy patching of build |
26 |
> files or deep understanding of the infrastructure with a large amount |
27 |
> of effort in order to maintain the project. |
28 |
|
29 |
I guess it's also an option to first start with a local maven |
30 |
repository, and to extend it later - if needed - with a WorkspaceReader |
31 |
for Maven builds (using a WorkspaceReader to, e.g., configure |
32 |
ebuild-specifics for artifact resolution, and having the local maven |
33 |
repository as the default to which Maven would fall back if the |
34 |
WorkspaceReader does not provide any artifact for given Maven coordinates). |
35 |
|
36 |
-- Henning Sudbrock |
37 |
|
38 |
|
39 |
On 23.03.21 06:02, Kaibo Ma wrote: |
40 |
> >What do you think about this alternative idea? |
41 |
> |
42 |
> It looks pretty straightforward at a first glance, but I think it would |
43 |
> require |
44 |
> other components because you are not providing any information of |
45 |
> the direct dependencies of the java packages/artifacts, which |
46 |
> means it might have to consult other sources (probably a remote repo) |
47 |
> first, and then attempts to resolve to a local JAR from your |
48 |
> WorkspaceReader. |
49 |
> |
50 |
> Have you tested this with --offline and the local maven cache (~/.m2) |
51 |
> cleared beforehand to see if your extension can actually work in a |
52 |
> sandboxed environment? XMvn does make use of this but it does |
53 |
> more than just this, it generates full POMs which might be very hard |
54 |
> to tackle. |
55 |
> |
56 |
> Another thing is for gradle. It does not expose public API for custom |
57 |
> repositories. It does have the API for it, but it is not documented and |
58 |
> it is subject to change. XMvn has a gradle connector, but it is already |
59 |
> outdated and would only work for older gradle versions. I have tried |
60 |
> to create a gradle plugin with a custom repository, but the internal API |
61 |
> was very confusing, and it wasn't clear what I should do. |
62 |
> |
63 |
> It seems that having a local maven repository is the only straightforward |
64 |
> and easy solution which doesn't involve much heavy patching of build |
65 |
> files or deep understanding of the infrastructure with a large amount of |
66 |
> effort in order to maintain the project. |
67 |
> |
68 |
> Kaibo Ma |
69 |
> |