Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNGSITE-550] What's new in Maven 4? #598

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

Bukama
Copy link
Contributor

@Bukama Bukama commented Dec 17, 2024

This PR adds an article about the major changes in Maven 4.

@Bukama
Copy link
Contributor Author

Bukama commented Dec 17, 2024

Info:

  • I put the article quite on high in the menu to make it more visible. When Maven 4 grew up a bit it can be (re-)moved.
  • I manually edited the site.xml to not apply full code style changes as it's not correctly formatted as of now (see #MNGSITE-539 Formatting the affected files #595)

@Bukama Bukama mentioned this pull request Dec 20, 2024
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@Bukama
Copy link
Contributor Author

Bukama commented Dec 20, 2024

Thanks for the feedback and the editing @gnodet!

@Bukama
Copy link
Contributor Author

Bukama commented Dec 21, 2024

Hope everything is fine now :)

@elharo elharo changed the title MNGSITE-550 What's new in Maven 4? [MNGSITE-550] What's new in Maven 4? Dec 23, 2024
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
The updated API provides hints as preparation for Maven 4.
You can enable them by passing the following argument to your build: `-Dmaven.plugin.validation=verbose`.
You should also only rely on the official Maven BOMs when developing plugins.
If a plugin still relies on long-deprecated and now removed Plexus dependency resolution, it will no longer work
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is true. If it is, elaboration is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is true. If it is, elaboration is needed.

@cstamas @gnodet Can you give us some insight please?

content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@Bukama
Copy link
Contributor Author

Bukama commented Dec 23, 2024

Thank you for your feedback @elharo! Integrated all of your text suggestions and left the two questions/doubts for further responses/discussion - I'm open to everything.

content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@Bukama
Copy link
Contributor Author

Bukama commented Dec 23, 2024

Consider the audience of this document. This simply is not relevant to someone who simply wants to use Maven to build their code. It's only relevant to the people developing Maven and that's not who this is written for.

I slightly disagree on that: The audience of this document are all Maven users - those who only want to run their build, but also those who want to know more about the changes, are responsible for build management in their teams, etc (I think someone called them "power users"). If we only considers those who "blindly" use Maven, we don't need the article at all. They are those who still run Maven 3.3.9 and mvn clean install because that's what they've read in a tutorial or what was told them years ago.

I'm not sure we can expect people reading this document to already know the difference between build and consumers. This should probably be carefully explained right up front.

What do you think about

Throughout the years, one important rule has been maintaining the highest backward compatibility possible, especially with its [POM-schema with Model version 4.0.0][2].
This is very important, because POM files with this schema version are not only used for the build of the own project.
Projects, using 3rd party libraries, also rely on the POM files of those, as it contains information needed to successfully run their own builds.
Those projects are called "(a dependency) consuming projects".

Also, "consumers" is a strange term here. I might consider dependents instead, but either way it does need to be defined.

Used the term "consumers" due the terms the committers introduced when developing this feature.

content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@slachiewicz slachiewicz added the enhancement New feature or request label Dec 23, 2024
@Bukama Bukama requested a review from elharo December 27, 2024 19:25
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@Bukama
Copy link
Contributor Author

Bukama commented Dec 27, 2024

@elharo Thanks for your feedback again. I don't know why I have not seen it 4 days ago :O Think I went through all of them, except the subproject renaming. Might have another look at it tomorrow (I'm too tired for that now).

content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@Bukama Bukama requested a review from elharo December 28, 2024 08:21
@slachiewicz
Copy link
Member

do You have plan to publish it now or when 4 is released?

@Bukama
Copy link
Contributor Author

Bukama commented Jan 5, 2025

do You have plan to publish it now or when 4 is released?

I would like to release it now, as a) @cstamas said we get asked what changes more often and b) several of us (e.g. Maarten, Karl Heinz, Robert, me) give talks about that quite a long time, but it's always too less time on conferences or many JUG to cover all.

@Bukama Bukama force-pushed the ngsite550_whatsnewmaven4 branch from 74b0df5 to 99ea2cc Compare January 7, 2025 18:45
@Bukama Bukama requested a review from elharo January 18, 2025 20:17
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved

### Declaring the root directory and directory properties

Every time Maven executes a build, it has to determine the project's root to identify things like the parent project,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where else are these terms defined?


As you can see, these properties differentiate by their scope, where `project` is always related to the Maven project's
definition (you could interpret this as the POM files) and `session` is the actual execution of a Maven build and is the
current working directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is session the actual execution of a Maven build or the
current working directory? Or does this sentence need to be rephrased?

content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
content/markdown/whatsnewinmaven4.md Outdated Show resolved Hide resolved
@michael-o
Copy link
Member

Removing myself since I don't have the capacity to review such large PRs.

@gnodet gnodet self-requested a review January 21, 2025 16:15
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't say that the namespace is changing from http://maven.apache.org/POM/4.0.0 to http://maven.apache.org/POM/4.1.0. IMHO it shouldn't be changing and I'm hopeful this change can be reverted. Mixing versions into namespace URIs is a known XML antipattern. But if it's in play it is a huge change that should be called out here.

@gnodet
Copy link
Contributor

gnodet commented Jan 22, 2025

This doesn't say that the namespace is changing from http://maven.apache.org/POM/4.0.0 to http://maven.apache.org/POM/4.1.0. IMHO it shouldn't be changing and I'm hopeful this change can be reverted. Mixing versions into namespace URIs is a known XML antipattern. But if it's in play it is a huge change that should be called out here.

What are you referring to exactly ?

@elharo
Copy link
Contributor

elharo commented Jan 22, 2025

For this PR it should call out that the namespace used to be http://maven.apache.org/POM/4.0.0 and is now http://maven.apache.org/POM/4.1.0

For the general Issue I filed a bug in Jira with more details. Versions in namespace URIs is an antipattern, though a common one.

@Bukama
Copy link
Contributor Author

Bukama commented Jan 23, 2025

For this PR it should call out that the namespace used to be http://maven.apache.org/POM/4.0.0 and is now http://maven.apache.org/POM/4.1.0

Mentioned the new namespace in the Model 4.1.0 section

@Bukama Bukama requested a review from elharo January 23, 2025 18:37
@elharo elharo dismissed their stale review January 23, 2025 19:10

rereading


Security is important, and storing unencrypted passwords is bad practice.
Maven 3's password encryption had several serious issues and could more accurately be called "password obfuscation".
Maven 4 instead has a completely redone encryption system, based on Maven Encryption (`mvnenc`) - a standalone CLI tool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvnenc is just a frontend, the underlying backend is rather https://github.com/codehaus-plexus/plexus-sec-dispatcher. Compare with #654.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not go into this distinction: plexus-sec-dispatcher is NOT an API, is not something people should use or reuse or even made aware. We already had problems with it in Maven3.

Copy link
Member

@kwin kwin Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But

based on Maven Encryption (mvnenc) - a standalone CLI tool.

feels wrong to me. I would rather remove the sentence then altogether.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what API is proposed by Maven for sensitive values e.g. for Mojos or extensions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"plexus-sec-dispatcher is NOT an API, is not something people should use or reuse or even made aware. " -- Hyrum's Law rides again

Copy link
Contributor Author

@Bukama Bukama Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But

based on Maven Encryption (mvnenc) - a standalone CLI tool.

feels wrong to me. I would rather remove the sentence then altogether.

The phrasing is based on @cstamas blog about it:

Maven4 password encryption is handled by the new CLI tool: mvnenc.

Shall I add a link to https://maven.apache.org/guides/mini/guide-encryption.html here, because that's the guide about encryption, which can (or should) hold the details.

content/site.xml Outdated Show resolved Hide resolved
<meta name="author" content="Matthias Bünger" />
</head>

# What's new in Maven 4?
Copy link

@lbruun lbruun Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inference of <modelVersion> is another new feature in Maven v4. You may want to add that.

Doing

<project xmlns="http://maven.apache.org/POM/4.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 https://maven.apache.org/xsd/maven-4.1.0.xsd">
  <modelVersion>4.1.0</modelVersion>
</project>

is no longer necessary: you can leave out the <modelVersion> element and it will be inferred from the XML ns.

The below is equivalent to the above:

<project xmlns="http://maven.apache.org/POM/4.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 https://maven.apache.org/xsd/maven-4.1.0.xsd">
</project>

(no <modelVersion> element)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that feature has been challenged by https://issues.apache.org/jira/browse/MNG-8537

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that feature has been challenged by https://issues.apache.org/jira/browse/MNG-8537

I'm aware of this issue and as far as I understand the discussion it's also the cause why this PR does not move forward. Maybe I should even close it completely. It's open for about 6 weeks now, some don't want to review it cause if its size and as long as it's open from time and time someone sneaks in to request documentation which should be in the explicit pages but not in a summary (@lbruun I don't mean you by this, your ping about the not necessary <modelVersion> is totally fine and I would instantly add it, if MNG-8537 would not exists/be closed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.