GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Generate netty-bom that does not inherit from netty-parent by normanmaurer · Pull Request #15265 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented May 26, 2025

Copy link
Copy Markdown
Member

Motivation:

We need to ensure our netty-bom does not have netty-parent as a parent as otherwise it will also pull in the dependency management of the parent which might lead to unexpected behaviour. Beside this we also should ensure our native jars are marked as runtime dependency.

Modifications:

  • Use plugin to generate the correct bom file and so not depend on the parent
  • Use correct runtime scope for native dependencies
  • Fix netty-all generation to directly specify dependency versions and not depend on the bom as this does not work (due the usage of the plugin).
  • Remove duplicated tcnative.version declaration as this is not needed anymore (the plugin does the correct resulution).
  • Remove usage of script during build as its not needed anymore

Result:

Correct dependency management

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
Generate netty-bom that does not inherit from netty-parent
b3918e2
Motivation:

We need to ensure our netty-bom does not have netty-parent as a parent as otherwise it will also pull in the dependency management of the parent which might lead to unexpected behaviour.
Beside this we also should ensure our native jars are marked as runtime dependency.

Modifications:

- Use plugin to generate the correct bom file and so not depend on the parent
- Use correct runtime scope for native dependencies
- Fix netty-all generation to directly specify dependency versions and not depend on the bom as this does not work (due the usage of the plugin).
- Remove duplicated tcnative.version declaration as this is not needed anymore (the plugin does the correct resulution).
- Remove usage of script during build as its not needed anymore

Result:

Correct dependency management
@normanmaurer

normanmaurer commented May 26, 2025

Copy link
Copy Markdown
Member Author

Before this PR a project with the following pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>untitled</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-bom</artifactId>
                <version>4.2.2.Final-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-tcnative-classes</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.activation</groupId>
            <artifactId>javax.activation</artifactId>
        </dependency>
    </dependencies>
</project>
mvn clean dependency:tree
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< org.example:untitled >------------------------
[INFO] Building untitled 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ untitled ---
[INFO] 
[INFO] --- dependency:3.7.0:tree (default-cli) @ untitled ---
[INFO] org.example:untitled:jar:1.0-SNAPSHOT
[INFO] +- io.netty:netty-tcnative-classes:jar:2.0.72.Final:compile
[INFO] \- com.sun.activation:javax.activation:jar:1.2.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.418 s
[INFO] Finished at: 2025-05-26T11:16:49+02:00
[INFO] ------------------------------------------------------------------------

After this PR:

 ~/Downloads/apache-maven-3.9.9/bin/mvn clean dependency:tree
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.sun.activation:javax.activation:jar is missing. @ line 33, column 21
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.example:untitled:1.0-SNAPSHOT (/Users/norman/Documents/workspace/apple/untitled/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.sun.activation:javax.activation:jar is missing. @ line 33, column 21
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Which is the expected result ^^

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer added this to the 4.2.2.Final milestone May 26, 2025
@normanmaurer
normanmaurer requested review from chrisvest, franz1981 and idelpivnitskiy May 26, 2025 10:08
idelpivnitskiy
idelpivnitskiy reviewed May 26, 2025
View reviewed changes
Comment thread all/pom.xml
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>

@idelpivnitskiy idelpivnitskiy May 26, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fix netty-all generation to directly specify dependency versions and not depend on the bom as this does not work (due the usage of the plugin).

Hm, in Gradle if a plugin task executes later (let's say at publish time), but is required early (let's say at compile/assemble time), it's possible to define that assemble tasks depends on plugin task. That way, plugin output is available for other projects at any time. Is there something like that in Maven?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer May 26, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This does not work as maven just looks at the netty-bom/pom.xml and that's it (and not execute the plugin etc first in netty-com). I am not aware that what you describe is possible.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@idelpivnitskiy idelpivnitskiy May 26, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I see that bom generation is the last task now. Maybe it doesn't work here because you switched from dependencyManagement to dependencies section inside bom. If others don't have better ideas, then it's ok to leave as-is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer May 27, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

we need to use dependencies here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/ci-build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Remove unused script
2998b27
@normanmaurer
normanmaurer requested a review from idelpivnitskiy May 26, 2025 15:18
idelpivnitskiy
idelpivnitskiy reviewed May 26, 2025
View reviewed changes
Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread all/pom.xml
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>

@idelpivnitskiy idelpivnitskiy May 26, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I see that bom generation is the last task now. Maybe it doesn't work here because you switched from dependencyManagement to dependencies section inside bom. If others don't have better ideas, then it's ok to leave as-is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
idelpivnitskiy
idelpivnitskiy reviewed May 27, 2025
View reviewed changes
Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added 2 commits May 27, 2025 08:03
@normanmaurer
Add missing
d016fd4
@normanmaurer
Remove example
dfb9645
@normanmaurer
normanmaurer requested a review from idelpivnitskiy May 27, 2025 06:09
idelpivnitskiy
idelpivnitskiy approved these changes May 27, 2025
View reviewed changes

@idelpivnitskiy idelpivnitskiy left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🚀

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

chrisvest
chrisvest approved these changes May 27, 2025
View reviewed changes
@normanmaurer
normanmaurer merged commit ec8542b into 4.2 May 28, 2025
@normanmaurer
normanmaurer deleted the bom_plugin branch May 28, 2025 06:18
normanmaurer added a commit that referenced this pull request May 28, 2025
@normanmaurer
Generate netty-bom that does not inherit from netty-parent (#15265)
b6f60f3
Motivation:

We need to ensure our netty-bom does not have netty-parent as a parent
as otherwise it will also pull in the dependency management of the
parent which might lead to unexpected behaviour. Beside this we also
should ensure our native jars are marked as runtime dependency.

Modifications:

- Use plugin to generate the correct bom file and so not depend on the
parent
- Use correct runtime scope for native dependencies
- Fix netty-all generation to directly specify dependency versions and
not depend on the bom as this does not work (due the usage of the
plugin).
- Remove duplicated tcnative.version declaration as this is not needed
anymore (the plugin does the correct resulution).
- Remove usage of script during build as its not needed anymore

Result:

Correct dependency management
idelpivnitskiy added a commit to idelpivnitskiy/netty that referenced this pull request Jun 3, 2025
@idelpivnitskiy
Correct what artifacts included in netty-bom
585149a
Motivation:

See discussions in netty#15265:

1. `netty-tcnative` misses a variant with `osx-aarch_64` classifier.
2. `netty-tcnative` variant with `linux-aarch_64-fedora` classifier was
removed starting from version 2.0.72.
3. `netty-example` should not be included in the `netty-bom`.

Result:

`netty-bom` has correct set of managed artifacts.
@idelpivnitskiy idelpivnitskiy mentioned this pull request Jun 3, 2025
Correct what artifacts included in netty-bom #15308
Merged
normanmaurer pushed a commit that referenced this pull request Jun 4, 2025
@idelpivnitskiy
Correct what artifacts included in netty-bom (#15308)
4f13582
Motivation and modifications:

See discussions in #15265:

1. `netty-tcnative` misses a variant with `osx-aarch_64` classifier.
2. `netty-tcnative` variant with `linux-aarch_64-fedora` classifier was
removed starting from version 2.0.72.
3. `netty-example` should not be included in the `netty-bom`.

Result:

`netty-bom` has correct set of managed artifacts.
@chrisvest chrisvest mentioned this pull request Jun 4, 2026
Remove scope (runtime) from netty-bom #16789
Open
@phiz71 phiz71 mentioned this pull request Oct 2, 2026
fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20626
Merged
This was referenced Oct 2, 2026
[4.10.x] fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20649
Merged
[4.9.x] fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20650
Merged
[4.11.x] fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20651
Merged
[4.12.x] fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20652
Merged
[4.13.x] fix(bom): stop netty-tcnative from being packaged into plugin archives gravitee-io/gravitee-api-management#20653
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chrisvest chrisvest chrisvest approved these changes
@idelpivnitskiy idelpivnitskiy idelpivnitskiy approved these changes
@franz1981 franz1981 Awaiting requested review from franz1981

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.2.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@normanmaurer @chrisvest @idelpivnitskiy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.