Repository: quarkusio/quarkus
Issue: Maven Add Extension command fails with error about BOM

**Describe the bug**
Running the Add Extension command fails with the following message:

```
The Quarkus BOM is required to add a Quarkus extension
```

**Expected behavior**
The extension is added correctly.

**Actual behavior**
The extension isn't added as the command fails.

**To Reproduce**
Steps to reproduce the behavior:
1. Use the [Amazon Lambda HTTP guide](https://quarkus.io/guides/amazon-lambda-http) to generate a project using the artefact `quarkus-amazon-lambda-http-archetype` version `1.6.0.Final`.
2. Use Maven to add an extension to this new project:

```
mvn -X quarkus:add-extension -Dextensions="smallrye-jwt"
```

The command will fail with the following stacktrace:

```
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.0.Final:add-extension (default-cli) on project artifactid1: Unable to update the pom.xml file: The Quarkus BOM is required to add a Quarkus extension -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.0.Final:add-extension (default-cli) on project artifactid1: Unable to update the pom.xml file
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to update the pom.xml file
    at io.quarkus.maven.AddExtensionMojo.doExecute (AddExtensionMojo.java:67)
    at io.quarkus.maven.QuarkusProjectMojoBase.execute (QuarkusProjectMojoBase.java:67)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: The Quarkus BOM is required to add a Quarkus extension
    at io.quarkus.devtools.project.buildfile.BuildFile.install (BuildFile.java:43)
    at io.quarkus.devtools.commands.handlers.AddExtensionsCommandHandler.execute (AddExtensionsCommandHandler.java:37)
    at io.quarkus.devtools.commands.AddExtensions.execute (AddExtensions.java:43)
    at io.quarkus.maven.AddExtensionMojo.doExecute (AddExtensionMojo.java:62)
    at io.quarkus.maven.QuarkusProjectMojoBase.execute (QuarkusProjectMojoBase.java:67)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
```


**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: `Linux DESKTOP-GJJ95MV 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux`
 - Output of `java -version`: NA
 - GraalVM version (if different from Java): NA
 - Quarkus version or git rev: `1.6.0.Final`
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): 
```
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/rich/.sdkman/candidates/maven/current
Java version: 14.0.1, vendor: AdoptOpenJDK, runtime: /home/rich/.sdkman/candidates/java/14.0.1.hs-adpt
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.19.104-microsoft-standard", arch: "amd64", family: "unix"
```

**Additional context**
(Add any other context about the problem here.)


Changed files:
independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/MavenBuildFile.java
independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/GenericGradleBuildFile.java
independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/BuildFile.java
independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/AbstractGradleBuildFile.java
independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/extensions/ExtensionManager.java

diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/AbstractGradleBuildFile.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/AbstractGradleBuildFile.java
index 948404b10fd..6c85b42629e 100644
--- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/AbstractGradleBuildFile.java
+++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/AbstractGradleBuildFile.java
@@ -97,13 +97,6 @@ protected void removeDependencyFromBuildFile(AppArtifactKey key) throws IOExcept
         getModel().setBuildContent(newBuildContent.toString());
     }
 
-    @Override
-    protected boolean containsBOM(String groupId, String artifactId) throws IOException {
-        String buildContent = getModel().getBuildContent();
-        return buildContent.contains("enforcedPlatform(\\"${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:")
-                || buildContent.contains("enforcedPlatform(\\"" + groupId + ":" + artifactId + ":");
-    }
-
     @Override
     public String getProperty(String propertyName) throws IOException {
         final String property = getModel().getPropertiesContent().getProperty(propertyName);
diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/BuildFile.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/BuildFile.java
index 640df137b4b..97996678cad 100644
--- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/BuildFile.java
+++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/BuildFile.java
@@ -32,16 +32,8 @@ public BuildFile(final Path projectDirPath, final QuarkusPlatformDescriptor plat
         this.platformDescriptor = requireNonNull(platformDescriptor, "platformDescriptor is required");
     }
 
-    @Override
-    public final boolean hasQuarkusPlatformBom() throws IOException {
-        return containsBOM(platformDescriptor.getBomGroupId(), platformDescriptor.getBomArtifactId());
-    }
-
     @Override
     public final InstallResult install(Collection<AppArtifactCoords> coords) throws IOException {
-        if (!hasQuarkusPlatformBom()) {
-            throw new IllegalStateException("The Quarkus BOM is required to add a Quarkus extension");
-        }
         this.refreshData();
         final Set<AppArtifactKey> existingKeys = getDependenciesKeys();
         final List<AppArtifactCoords> installed = coords.stream()
@@ -97,8 +89,6 @@ public final UninstallResult uninstall(Collection<AppArtifactKey> keys) throws I
 
     protected abstract String getProperty(String propertyName) throws IOException;
 
-    protected abstract boolean containsBOM(String groupId, String artifactId) throws IOException;
-
     protected abstract void refreshData();
 
     protected Path getProjectDirPath() {
diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/GenericGradleBuildFile.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/GenericGradleBuildFile.java
index 51501741f8d..29b7bf0d541 100644
--- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/GenericGradleBuildFile.java
+++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/GenericGradleBuildFile.java
@@ -22,11 +22,6 @@ public Collection<AppArtifactCoords> getInstalled() throws IOException {
         throw new IllegalStateException("This feature is not yet implemented outside of the Gradle Plugin.");
     }
 
-    @Override
-    public boolean hasQuarkusPlatformBom() throws IOException {
-        throw new IllegalStateException("This feature is not yet implemented outside of the Gradle Plugin.");
-    }
-
     @Override
     public InstallResult install(Collection<AppArtifactCoords> coords) throws IOException {
         throw new IllegalStateException("This feature is not yet implemented outside of the Gradle Plugin.");
diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/MavenBuildFile.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/MavenBuildFile.java
index 8a1061f6bb3..8ccb4cf2a96 100644
--- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/MavenBuildFile.java
+++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/buildfile/MavenBuildFile.java
@@ -67,22 +67,6 @@ public List<Dependency> getDependencies() throws IOException {
         return getModel() == null ? Collections.emptyList() : getModel().getDependencies();
     }
 
-    @Override
-    protected boolean containsBOM(String groupId, String artifactId) throws IOException {
-        if (getModel() == null || getModel().getDependencyManagement() == null) {
-            return false;
-        }
-        List<Dependency> dependencies = getModel().getDependencyManagement().getDependencies();
-        return dependencies.stream()
-                // Find bom
-                .filter(dependency -> "import".equals(dependency.getScope()))
-                .filter(dependency -> "pom".equals(dependency.getType()))
-                // Does it matches the bom artifact name
-                .anyMatch(dependency -> dependency.getArtifactId()
-                        .equals(MojoUtils.TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_VALUE)
-                        && dependency.getGroupId().equals(MojoUtils.TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_VALUE));
-    }
-
     @Override
     protected void refreshData() {
         this.modelRef.set(null);
diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/extensions/ExtensionManager.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/extensions/ExtensionManager.java
index b339ba8ebb8..6f55c44103a 100644
--- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/extensions/ExtensionManager.java
+++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/extensions/ExtensionManager.java
@@ -37,22 +37,12 @@ default boolean isInstalled(AppArtifactKey key) throws IOException {
         return getInstalled().stream().anyMatch(i -> Objects.equals(i.getKey(), key));
     }
 
-    /**
-     * Check that the Quarkus Platform bom is defined in the project.
-     * The Quarkus Platform Bom role is to define version to use for Quarkus extensions.
-     *
-     * @return true if it's defined, false else
-     * @throws IOException if a problem occurs while reading the project build file(s)
-     */
-    boolean hasQuarkusPlatformBom() throws IOException;
-
     /**
      * This is going to install/add all the specified extensions to the project build file(s).
      *
      * <pre>
-     *   - If the project Quarkus platform bom is not defined, an {@link IllegalStateException} will be thrown
      *   - Extensions which are already installed will ALWAYS be skipped whatever the specified version
-     *   - The provided version will be used wasn't already installed
+     *   - The provided version will be used if it wasn't already installed
      * </pre>
      *
      * @param coords the list of {@link AppArtifactCoords} for the extensions to install