Commit Graph

794 Commits

Author SHA1 Message Date
Guillaume Nodet 8c116306b6 [maven-release-plugin] prepare release maven-4.0.0-alpha-9 2023-12-08 16:04:57 +01:00
Guillaume Nodet 23bca281fc
[MNG-7947] Plugin API (#1309)
* Add an InternalSession interface to avoid casting to the implementation in various places
* Upgrade to Guice 6.0.0 and add support for jakarta.inject annotations
* Maven 4 Plugin API
2023-12-05 09:11:33 +01:00
Guillaume Nodet 69bc993b80
[MNG-7945] Fix profile settings being injected into consumer POM (#1323) 2023-11-28 18:17:10 +01:00
Guillaume Nodet d62113772e
Clean up dependencies versions (#1300) 2023-11-17 16:31:11 +01:00
Guillaume Nodet 7fcdd32e87 [MNG-7615] Multithreaded project builder 2023-11-07 09:20:52 +01:00
Guillaume Nodet 2f6ec159fe [MNG-7615] Add a cycle detection to the transformer context 2023-11-07 09:20:52 +01:00
Guillaume Nodet 53ff1690de [MNG-7615] Add some methods for supporting Maven 4 api to ProfileInjector / ProfileSelector 2023-11-07 09:20:52 +01:00
Guillaume Nodet 54ca01c779 [MNG-7615] Use lambas to access ModelCache 2023-11-07 09:20:52 +01:00
Guillaume Nodet 3fc399318e [maven-release-plugin] prepare for next development iteration 2023-10-20 21:20:23 +02:00
Guillaume Nodet a2cbf4873a [maven-release-plugin] prepare release maven-4.0.0-alpha-8 2023-10-20 21:20:23 +02:00
Guillaume Nodet 4251e3f9c2
[MNG-7915] Use MavenStaxReader/Writer in MavenXpp3Reader/Writer (#1293)
This removes the generated v4 model reader/writer based on Xpp3 api and deprecates the v3 Xpp3 reader/writer.
2023-10-20 09:14:01 +02:00
Guillaume Nodet 251a316962
[MNG-7893] Fix exception loading superpom with invalid modelVersion (#1290)
Even though this should not be supported, Maven 3.x is always using the 4.0.0 superpom.  So if the version is not a supported model version, simply use 4.0.0.  Any invalid value will be later verified by the model validator and eventually throw a meaninful exception.
2023-10-18 15:31:36 +02:00
Guillaume Nodet 92a82dcefd
[MNG-6437] Better support for path and uri in property interpolation (#812) 2023-10-17 19:55:08 +02:00
Tamas Cservenak bd608d8cc9
[MNG-7910] DefaultProfileSelector empty ctor uses immutable list (#1283)
It uses immutable list and while it suggests it allows this below, it actually fails on constructs like this (runtime ONLY):
{noformat}
new DefaultProfileSelector()
                .addProfileActivator(new JdkVersionProfileActivator())
                .addProfileActivator(new PropertyProfileActivator())
{noformat}

As default ctor creates immutable list, but API kinda suggests this is ok.

---

https://issues.apache.org/jira/browse/MNG-7910
2023-10-16 13:26:42 +02:00
Guillaume Nodet 07db6ec76a
[MNG-7911] Require JDK 11 and support JDK 21 at build time (#1278) 2023-10-16 13:25:27 +02:00
Slawomir Jaranowski 5c2e671a06 [MNG-7895] Support ${project.basedir} in file profile activation 2023-09-26 19:50:21 +02:00
Guillaume Nodet 10fa5c713a
[MNG-7893] Allow versioning the superpom according to the model version (#1253) 2023-09-26 07:17:52 +02:00
Guillaume Nodet 35022a3616
Fix newlines and indentation in ModelBuildingException message (#1257) 2023-09-22 12:54:27 +02:00
Guillaume Nodet 10487d7b5d
[MNG-7820] Get rid of plexus-utils (#1255) 2023-09-22 10:59:31 +02:00
Guillaume Nodet f24266eb64
[MNG-7836] Support alternative syntaxes for POMs (#1197)
The IT associated with this PR is using the Maven model to generate a hocon POM parser.  This requires the maven-api-model module to attach the POM as an artifact, and the maven.yml change so that the model is present in the local repository.
2023-09-22 09:25:10 +02:00
Guillaume Nodet 89d3ac90d1 Make DefaultInheritanceAssembler#merger field final and reorder fields correctly 2023-09-22 08:34:51 +02:00
Guillaume Nodet 0c37cff681
[MNG-7820] Get rid of plexus-utils Os class (#1249) 2023-09-22 08:01:36 +02:00
Guillaume Nodet 1eae6684e3
[MNG-7881] Expose the rootDirectory for model processing (#1245) 2023-09-19 16:31:35 +02:00
Guillaume Nodet 34b0591f03
[MNG-7820] Remove dependency on plexus-utils StringUtils / FileUtils (#1243)
Co-authored-by: crazyhzm <crazyhzm@apache.org>
2023-09-14 13:48:15 +02:00
Guillaume Nodet c6380108b1
[MNG-7877] Attach the build POM and simplify build/consumer implementation (#1240)
.. at the cost of loosing xml formatting in the consumer POMs
2023-09-13 13:39:50 +02:00
Guillaume Nodet 45075233c7
[MNG-7876] Add model version analysis and downgrade (#1235) 2023-09-11 18:17:26 +02:00
Guillaume Nodet 46fd5e9586
Add ModelLocator#locateExistingPom to abstract a bit more (#1237) 2023-09-11 18:15:00 +02:00
Guillaume Nodet 7d6f90e8d0
Move Features to api (#1232) 2023-09-11 00:42:53 +02:00
Guillaume Nodet 0b3246381d
Remove useless @author tags (#1226)
This information is usually more accurately given by the GIT history
2023-09-06 10:39:32 +02:00
Guillaume Nodet 06938249a7
[MNG-7792] Use a standalone asm version (#1126) 2023-09-05 23:09:03 +02:00
Guillaume Nodet 64b32c0bb4
[MNG-7871] Fix location tracking (#1222) 2023-09-05 18:06:44 +02:00
Guillaume Nodet b0170a612b
[MNG-7851] Improve error message when modelVersion is 4.0 (#1219)
Improve DefaultModelValidator.compareModelVersions to be able to compare
versions which different numbers of segments, allowing it to compare
"4", "4.0", and "4.0.0" to each other for example.

Signed-off-by: Craig Andrews <candrews@integralblue.com>

# Conflicts:
#	maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java

Co-authored-by: Craig Andrews <candrews@integralblue.com>
2023-08-29 13:33:17 +02:00
Guillaume Nodet f2593b97ef
[MNG-7862] The ModelLocator should always be used when locating pom.xml (#1217) 2023-08-23 21:25:14 +02:00
Elliotte Rusty Harold 1a714351ef
remove pointless string concatenation (#1201) 2023-07-15 13:58:20 -04:00
Guillaume Nodet e39142b77a
[MNG-7830] Switch from plexus-xml to stax / woodstox (#1185) 2023-06-29 12:03:50 +02:00
Guillaume Nodet 5b540821f2 [maven-release-plugin] prepare for next development iteration 2023-06-24 10:52:55 +02:00
Guillaume Nodet bf699a388c [maven-release-plugin] prepare release maven-4.0.0-alpha-7 2023-06-24 10:52:47 +02:00
Guillaume Nodet dbfcfd5eb3
[MNG-7228] MavenProject.getOriginalModel returns interpolated parts (#1183) 2023-06-24 10:51:08 +02:00
Guillaume Nodet a279289bc3 [maven-release-plugin] prepare for next development iteration 2023-06-23 15:08:35 +02:00
Guillaume Nodet a3f0f12fab [maven-release-plugin] prepare release maven-4.0.0-alpha-6 2023-06-23 15:08:27 +02:00
Guillaume Nodet 229b31b626
[MNG-4645] Move Central repo definition out of Maven's core so it can be more easily changed (#1139)
Co-authored-by: Christian Schulte <schulte@apache.org>
2023-06-19 17:04:04 +02:00
Guillaume Nodet 8b0bf378b8
[MNG-5600] Dependency management import should support exclusions. (#1155)
The original patch is made by: Christian Schulte <schulte@apache.org>
Co-authored-by: Alex Szakaly <alex.szakaly@gmail.com>
2023-06-15 17:29:05 +02:00
Guillaume Nodet ea1a280714
[MNG-7604] Removal of pom.* interpolation makes some older plugins defunct (#1137)
This partially reverts commit b2a21f12f8.

Co-authored-by: Maarten Mulders <mthmulders@users.noreply.github.com>
2023-06-05 10:44:46 +02:00
Guillaume Nodet e08c95a673
[MNG-7655] Switch to plexus-utils / plexus-xml 4 (#1093) 2023-06-04 21:03:41 +02:00
Guillaume Nodet 26ee15a47e Fix possible NPE 2023-05-31 15:52:05 +02:00
Guillaume Nodet d826b575ac
[MNG-7784] Fix compatibility for SuperPomProvider (#1109) 2023-05-17 07:19:19 +02:00
Guillaume Nodet 7fe9499361
[MNG-7783] Profile source point to file instead of to module (#1110) 2023-05-17 07:15:44 +02:00
Tim te Beek a8319821a9
[MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String) (#1104)
* [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu

Co-authored-by: Moderne <team@moderne.io>

* Apply Spotless

---------

Co-authored-by: Moderne <team@moderne.io>
2023-05-09 19:46:02 -04:00
Guillaume Nodet 2db7c85b64
[MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061)
This commit introduces three properties:

 * project.rootDirectory: the project's directory or parent directory containing a .mvn subdirectory or a pom.xml flagged with the root="true" attribute. If no such directory can be found, accessing the rootDirectory property will throw an IllegalStateException.

 * session.topDirectory : the directory of the topmost project being built, usually the current directory or the directory pointed at by the -f/--file command line argument. The topDirectory is similar to the executionRootDirectory property available on the session, but renamed to make it coherent with the new rootDirectory and to avoid using root in its name. The topDirectory property is computed by the CLI as the directory pointed at by the -f/--file command line argument, or the current directory if there's no such argument.

 * session.rootDirectory : the rootDirectory for the topDirectory project.

The topDirectory and rootDirectory properties are made available on the MavenSession / Session and deprecate the executionRootDirectory and multiModuleProjectDirectory properties. The rootDirectory should never change for a given project and is thus made available for profile activation and model interpolation (without the project. prefix, similar to basedir). The goal is also to make the rootDirectory property also available during command line arguments interpolation.

A root boolean attribute is also added to the model to indicate that the project is the root project. This attribute is only supported if the buildconsumer feature is active and removed before the pom is installed or deployed. It can be used as an alternative mechanism to the .mvn directory.
2023-04-20 12:58:12 +02:00
Guillaume Nodet 9e51a8fe95
[MNG-7763] Provide UTF-8 as a default value for project.build.sourceEncoding and project.reporting.outputEncoding (#1085) 2023-04-17 15:20:54 +02:00