Commit Graph

182 Commits

Author SHA1 Message Date
Tamas Cservenak 10e2fba0fb
[MNG-8177] Add contextual info for model warnings (#1636)
As they really can come from anywhere. In case of this issue even from some eliminated POM that was read while collecting dirty tree, and was later eliminated. So confusing for users.

---

https://issues.apache.org/jira/browse/MNG-8177
2024-08-12 13:51:34 +02:00
Tamas Cservenak ad04d2c1fc
[MNG-8180] Back out from failing the build (#1645)
Just warn the user for now.

Port of accepted change from 3.9.x: https://github.com/apache/maven/pull/1642

---

https://issues.apache.org/jira/browse/MNG-8180
2024-08-12 13:06:59 +02:00
Tamas Cservenak da7c2110e4
[MNG-8180] Handle NPE due non-existent tags (#1639)
There was an NPE possibility when plugin.xml had no expected tags present.

Also: maven-compat has plugin.xml (!) w/o "name" tag, it NPEd and failed build. This was NOT picked up by CI as "rebuild itself" step does not install (just verify).

---

https://issues.apache.org/jira/browse/MNG-8180
2024-08-11 18:56:11 +02:00
Tamas Cservenak c0012c08aa
[MNG-8180] Fail install/deploy if rogue Maven Plugin metadata found (#1612)
Resolver handles transparently the repository metadata, and in case of plugins it peeks into META-INF/maven/plugin.xml of given artifact JAR to figure out needed metadata bits (prefix, name, etc).

But, this was done "blindly", while it is expected that GA of JAR artifact without classifier (requirement for maven plugins) and GA in embedded plugin metadata must be same.

Decision here is to fail hard, prevent this being installed and deployed, as this is most probably wrong (unsure what maven-indexer or even Sonatype search would do in this case).

---

https://issues.apache.org/jira/browse/MNG-8180
2024-07-11 18:47:20 +02:00
Slawomir Jaranowski d35864e348 [MNG-8179] Upgrade Parent to 43 2024-07-10 22:52:34 +02:00
Guillaume Nodet 6e9889b1ad [maven-release-plugin] prepare for next development iteration 2024-05-22 16:07:09 +02:00
Guillaume Nodet e92f645c27 [maven-release-plugin] prepare release maven-4.0.0-beta-3 2024-05-22 16:06:59 +02:00
Martin Desruisseaux 39696f2fab
[MNG-8084] Change six remaining imports of `ModelVersionParser`. (#1527)
This commit aims to complete d075fe7e85, which moved `ModelVersionParser`
interface from the `org.apache.maven.model.version` package to `org.apache.maven.api.services.model`.
Completing this change is necessary for building `maven-plugin-tools` or `maven-plugin-testing`.

This commit deletes the old interface for making sure that there is no accidental use.
The old and new interfaces were identical except for the package names and the imports.
As a result of this change, the following implementation classes are identical except
for package names and imports:

* `maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelVersionParser.java`
* `maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultModelVersionParser.java`
2024-05-21 11:54:32 +02:00
Guillaume Nodet 9acbed7d4f [maven-release-plugin] prepare for next development iteration 2024-05-13 18:36:30 +02:00
Guillaume Nodet 828faba819 [maven-release-plugin] prepare release maven-4.0.0-beta-2 2024-05-13 18:36:20 +02:00
Martin Desruisseaux 583667a869
[MNG-8015] Adjustments in new API related to PathType (#1501)
* Javadoc cleanup and replacement of some `System.getProperty("...")` by more specific standard methods.

* Add Type.PROCESSOR, MODULAR_PROCESSOR and CLASSPATH_PROCESSOR.

* Modification of the path type API:

* Add a `warningForFilenameBasedAutomodules()` method in `DependencyResolverResult`.
* Add relationships from `JavaPathType` to `javax.tool` location API.
* Modify the `PathType.option(Iterable<? extends Path>)` return type
  because the option and the value need to be two separated arguments.

* Fixes according some comments on the pull request.
2024-05-13 11:53:45 +02:00
Guillaume Nodet 64e9447926
Fix consumer pom builder (#1491) 2024-05-02 17:10:38 +02:00
Tamas Cservenak 8fbbbc978c
[MNG-8107] Update Resolver 2.0.0-alpha-11 (#1488)
Update to Resolver 2.0.0-alpha-11 and restore renamed class.

---

https://issues.apache.org/jira/browse/MNG-8107
2024-04-26 15:10:42 +02:00
Guillaume Nodet 6fddd97513
Use the new resolver provider (#1483) 2024-04-25 16:13:36 +02:00
Tamas Cservenak 854589b131
[MNG-8106] Fix metadata merge (#1481)
As currently if given metadata serves multiple roles (G, A or V level), data loss occurs.

---

https://issues.apache.org/jira/browse/MNG-8106
2024-04-25 12:10:21 +02:00
Tamas Cservenak 81e2b3c1ee
Make Maven 4.0.0 be beta-1 (#1484) 2024-04-25 10:48:58 +02:00
Guillaume Nodet 5d1cfd47f3 Cleanup dependencies 2024-04-25 07:46:50 +02:00
Hervé Boutemy 860310b692 [MNG-8043] document new default types, replacing artifact handlers 2024-04-23 08:12:44 +02:00
Guillaume Nodet d075fe7e85 [MNG-8084] New model builder and resolver provider 2024-04-12 12:50:18 +02:00
Tamas Cservenak 34863e6345
[MNG-8091] Update Resolver to 2.0.0-alpha-10 (#1460) 2024-04-04 11:51:19 +02:00
Tamas Cservenak c16f45d858
[MNG-8089] Introduce fat-JAR types (#1459)
These are dependency types to be used when dependency is "self contained", or is wanted be used as such: handle if like it has no dependencies, if any.

---

https://issues.apache.org/jira/browse/MNG-8089
2024-03-29 10:32:19 +01:00
Tamas Cservenak 2594047014
[MNG-8088] Using Resolver with MRESOLVER-512 (#1442)
This makes all the new scopes implemented out of the box, but MNG-8041 still stands (is unsolved).

Related PR https://github.com/apache/maven-resolver/pull/445

---

https://issues.apache.org/jira/browse/MRESOLVER-512
https://issues.apache.org/jira/browse/MNG-8088
2024-03-27 15:46:12 +01:00
Tamas Cservenak 33788fd7fc [maven-release-plugin] prepare for next development iteration 2024-03-06 20:57:04 +01:00
Tamas Cservenak 0a6a5617fe [maven-release-plugin] prepare release maven-4.0.0-alpha-13 2024-03-06 20:56:36 +01:00
Guillaume Nodet 9780ca1baf
[MNG-8015] Control the type of path where each dependency can be placed (#1401)
Co-authored-by: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
2024-03-01 18:18:13 +01:00
huazhongming 83949a7384
Use isEmpty instead of length (#1420)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2024-02-28 15:40:37 +08:00
Tamas Cservenak cf438ca624
[MNG-8059] Paths everywhere (#1413)
Make execution flow never invoke path.toFile, at least what model-builder and maven-resolver-provider matters. Using new methods from Resolver 2 alpha8 and also adding in relevant maven bits, as half of the work was already done.

---

https://issues.apache.org/jira/browse/MNG-8059
2024-02-26 18:04:44 +01:00
Hervé Boutemy 54c1b2f28a [MNG-8029] improve documentation about mirror settings 2024-02-17 19:40:11 +01:00
Tamas Cservenak 7b60c8d7dc
[MNG-8054] Ability to force build number (#1414)
For snapshot deploys

---

https://issues.apache.org/jira/browse/MNG-8054
2024-02-16 12:43:34 +01:00
Tamas Cservenak 76794c0237
[MNG-8043] Dependency properties should be provided by Maven (#1399)
Followup of MRESOLVER-484:
* move off deprecated resolver bits
* introduce non-deprecated replacements
* move existing to code to those new bits

---

https://issues.apache.org/jira/browse/MNG-8043
2024-02-07 10:51:56 +01:00
Tamas Cservenak 3f9fec2307
[MNG-8026] Maven drives regarding scopes (#1391)
Changes:
* new types for build path, path scope, dependency scope, language
* introduce "extensible enum" and provides registries, SPI providers, etc...
---------
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-02-05 10:42:51 +01:00
Tamas Cservenak 2452a6488a
[MNG-8035] Update to Resolver 2.0.0-alpha-7 (#1394)
Update to Resolver 2.0.0-alpha-7, sort out TODO.

This is also one simple change "sneaked in" for RAT, to ignore local `.mvn` that is unrelated to all this, but does not make any harm. In turn, it allows dev local checkout to have various stuff set without
decorating those with headers or fighing RAT plugin.

---

https://issues.apache.org/jira/browse/MNG-8035
2024-01-29 16:27:43 +01:00
Tamas Cservenak 20f7cfc361
[MNG-8026] Maven drives regarding scopes (#1392)
Maven should be fully in control regarding dependency scope definitions and their interpretations (and transformations). 
This PR makes following changes:
* no change in behaviour (all works as before), but
* maven codebase contains now all the code related to scopes
* no resolver code is in use that was deprecated (as it was wrong to have it in resolver), see issue [MRESOLVER-471](https://issues.apache.org/jira/browse/MRESOLVER-471)
* this also stops scope definitions duplication as well, they are now defined in one single project: Maven

---

https://issues.apache.org/jira/browse/MNG-8026
2024-01-25 14:58:24 +01:00
Guillaume Nodet b6a84fcac6
[MNG-8014] Fix multithreaded builder (#1386) 2024-01-22 18:27:48 +01:00
Guillaume Nodet 7f70467aa3
[MNG-8016] Simplify ModelCache (#1377)
The `ModelCache` is now bloated and can be simplified a lot.

---

https://issues.apache.org/jira/browse/MNG-8016
2024-01-13 14:02:40 +01:00
Guillaume Nodet 0d046da6f1 [maven-release-plugin] prepare for next development iteration 2024-01-12 10:41:50 +01:00
Guillaume Nodet e627879aed [maven-release-plugin] prepare release maven-4.0.0-alpha-12 2024-01-12 10:41:41 +01:00
Guillaume Nodet 8ce99bdbf2 [maven-release-plugin] prepare for next development iteration 2024-01-12 09:24:56 +01:00
Guillaume Nodet aa7994890b [maven-release-plugin] prepare release maven-4.0.0-alpha-11 2024-01-12 09:24:48 +01:00
Tamas Cservenak c4ccba7bf9
[MNG-7994] Update to Resolver 2.0.0-alpha-6 (#1373)
Update to alpha-6. Also, move off from deprecated default ctor of def repo session in tests.

---

https://issues.apache.org/jira/browse/MNG-7994
2024-01-11 13:16:51 +01:00
Tamas Cservenak 00d243a92e
[MNG-7978] Decouple maven-artifact from maven-resolver-provider (#1352)
As it is actually not needed. This also "pulls in" all of VersionParser into model version parser, so Core implementation now 100% just delegates over there.

---

https://issues.apache.org/jira/browse/MNG-7978
2023-12-20 14:03:35 +01:00
Tamas Cservenak a381970609
[MNG-7969][MNG-7981] Add missing information on Maven 4 version api to fix an exception (#1355)
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2023-12-19 20:08:55 +01:00
Guillaume Nodet fe71f7d8aa [maven-release-plugin] prepare for next development iteration 2023-12-18 17:27:24 +01:00
Guillaume Nodet 89d3c0321d [maven-release-plugin] prepare release maven-4.0.0-alpha-10 2023-12-18 17:27:16 +01:00
Tamas Cservenak ad5e085ebe
[MNG-7959] User controlled rewrite (#1351)
Extra handling if redirection happens within same GAV.

---

https://issues.apache.org/jira/browse/MNG-7959
2023-12-18 16:31:24 +01:00
Tamas Cservenak 9596255cbf
[MNG-7959] User controlled relocations Addendum (#1350)
Name the things.

---

https://issues.apache.org/jira/browse/MNG-7959
2023-12-18 13:26:49 +01:00
Tamas Cservenak 57effdd16e
[MNG-7959] User controlled relocations Addendum (#1349)
The "ban" was unfinished and wrong: what is actually needed is
to have exception with proper explanation instead.

---

https://issues.apache.org/jira/browse/MNG-7959
2023-12-18 13:01:04 +01:00
Tamas Cservenak a1fdd89745
[MNG-7974] Update Resolver 2.0.0-alpha-5 (#1337)
Update to Resolver alpha-5 and apply some cleanups.

Notable changes:
* update resolver to 2.0.0-alpha-5
* detach model-builder from maven-artifact (this is important)
* introduce model builder own VersionParser iface (implemented in resolver-provider)
* API VersionParser implementation reuses VersionParser from resolver-provider to implement the service
* various other cleanups, removal of old plexus, etc

---

https://issues.apache.org/jira/browse/MNG-7974
2023-12-18 12:03:17 +01:00
Tamas Cservenak e34afc897a
[MNG-7959] User controlled relocations (#1339)
With some improvements. It accepts user property with CSV entries for relocations.

To toy with it, use `-Dmaven.relocations.entries` user property, for example create `.mvn/maven.config` file with contents:
```
-Dmaven.relocations.entries=entry1,entry2,...
```
It accepts CSV (comma delimited) of entries, while entry form is as:
```
GAV>GAV
```
Where left GAV can contain `*` for any elem (so `*:*:*` would mean ALL, something you don't want). Right GAV is either fully specified, or also can contain `*`, then it behaves as "ordinary relocation": the coordinate is preserved from relocated artifact. Finally, if right hand GAV is absent (line looks like "GAV>"). the left hand matching GAV is banned fully (from resolving).

Note: the ">" means project level, while ">>" means global (whole session level, so even plugins will get relocated artifacts) relocation.

Examples:
```
-Dmaven.relocations.entries=org.foo:*:*>,org.here:*:*>org.there:*:*,javax.inject:javax.inject:1>>jakarta.inject:jakarta.inject:1.0.5
```

Meaning: 3 entries, ban `org.foo` group (exactly, so `org.foo.bar` is allowed), relocate `org.here` to `org.there` and finally **globally relocate** (see ">>") `javax.inject:javax.inject:1` to `jakarta.inject:jakarta.inject:1.0.5`

---

https://issues.apache.org/jira/browse/MNG-7959
2023-12-18 11:34:30 +01:00
Tamas Cservenak eee9514d3d
[MNG-7963] Clean up the build (#1340)
* [MNG-7963] Clean up the build

Changes:
* remove hamcrest 1.3 from scope
* set proc:none to prevent warnings (Sisu APT is on classpath),
  we do not use annotation processing, we produce Sisu index
  explicitly.
* remove some redundant elements from POMs
2023-12-13 23:19:20 +01:00