Repository: netty/netty
Issue: Netty BOM inherit from parent and its own dependency management
Labels: defect

A BOM was recently added in #5994 but is not valid.

A BOM should only expose dependency management for the artifacts that the project produces (so in this case, netty artifacts). It should not have an opinion about third party dependencies (otherwise including that BOM in a project potentially overrides decisions that were made about them).

One way to fix that would be to stop inheriting from `netty-parent`. Also, I'd set the version of each dependency in the bom rather than using `${project.version}`. If you're including the bom for netty X.Y.Z, it should be X.Y.Z. and nothing else (Maven does not allow to override that property, which is good so it's not strictly necessary but the intent is more clear if you hardcode the current version).

Here is an example of BOM for reference: http://repo.spring.io/release/org/springframework/spring-framework-bom/4.3.8.RELEASE/spring-framework-bom-4.3.8.RELEASE.pom

We'd like to [use this bom in Spring Boot](https://github.com/spring-projects/spring-boot/issues/8553) but we can't for that reason.

Issue comments:
I'll fix this as it was my doing.
@snicoll by removing the reference to the parent the version of the bom artifact is no longer updated when the version is bumped via Maven plugins, I will check into this soon.
@johnou you can use the `oss-parent` (you'll have to add a few more details to the pom so that you can publish it to Maven central anyway).
@jasontedor I see that the recent artifact you contributed (netty-dev-tools) uses oss-parent instead of netty-parent, do you know if the artifact version for netty-dev-tools will be incremented as part of the release / deploy cycle? At least with my local tests using versions:set -DnewVersion=.. it is not updated.
to answer myself I believe the answer is yes, just tested with the following.. mvn --batch-mode release:update-versions -DdevelopmentVersion=4.1.11.Final-SNAPSHOT

Yes, you got it.
Fixed by https://github.com/netty/netty/pull/6676

Pull request review comments:
According to [this page](https://maven.apache.org/guides/mini/guide-central-repository-upload.html) you need to add the `<url>`, `<license>` and `<scm>` tags to be able to deploy it to Maven central. Check the sample BOM in the related issue for reference.
roger.

Patch that resolved the issue:
diff --git a/bom/pom.xml b/bom/pom.xml
index dd72ee32e99..88d00a71cdb 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -15,136 +15,176 @@
   ~ under the License.
   -->
 <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/maven-v4_0_0.xsd">
-
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <groupId>io.netty</groupId>
-    <artifactId>netty-parent</artifactId>
-    <version>4.1.10.Final-SNAPSHOT</version>
+    <groupId>org.sonatype.oss</groupId>
+    <artifactId>oss-parent</artifactId>
+    <version>7</version>
+    <relativePath />
   </parent>
 
+  <groupId>io.netty</groupId>
   <artifactId>netty-bom</artifactId>
+  <version>4.1.10.Final-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Netty/BOM</name>
+  <description>Netty (Bill of Materials)</description>
+  <url>http://netty.io/</url>
+
+  <organization>
+    <name>The Netty Project</name>
+    <url>http://netty.io/</url>
+  </organization>
+
+  <licenses>
+    <license>
+      <name>Apache License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+    </license>
+  </licenses>
+  <inceptionYear>2008</inceptionYear>
+
+  <scm>
+    <url>https://github.com/netty/netty</url>
+    <connection>scm:git:git://github.com/netty/netty.git</connection>
+    <developerConnection>scm:git:ssh://git@github.com/netty/netty.git</developerConnection>
+    <tag>HEAD</tag>
+  </scm>
+
+  <developers>
+    <developer>
+      <id>netty.io</id>
+      <name>The Netty Project Contributors</name>
+      <email>netty@googlegroups.com</email>
+      <url>http://netty.io/</url>
+      <organization>The Netty Project</organization>
+      <organizationUrl>http://netty.io/</organizationUrl>
+    </developer>
+  </developers>
 
   <dependencyManagement>
     <dependencies>
       <!-- All release modules -->
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-buffer</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-dns</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-haproxy</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-http</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-http2</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-memcache</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-mqtt</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-redis</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-smtp</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-socks</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-stomp</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-codec-xml</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-common</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-handler</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-handler-proxy</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-resolver</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-resolver-dns</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-transport</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-transport-rxtx</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-transport-sctp</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-transport-udt</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
       <dependency>
-        <groupId>${project.groupId}</groupId>
+        <groupId>io.netty</groupId>
         <artifactId>netty-example</artifactId>
-        <version>${project.version}</version>
+        <version>4.1.10.Final-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>io.netty</groupId>
+        <artifactId>netty-all</artifactId>
+        <version>4.1.10.Final-SNAPSHOT</version>
       </dependency>
     </dependencies>
   </dependencyManagement>


Test patch: