Java Code Examples for org.apache.maven.model.Model#getDependencies()

The following examples show how to use org.apache.maven.model.Model#getDependencies() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PomAddDependencyTest.java    From butterfly with MIT License 6 votes vote down vote up
/**
 * Get dependency list from a maven model. Note: This is needed because
 * {@link AbstractArtifactPomOperation#getDependencyInList(List, String, String)}
 * does not accept a version as argument.
 */
private Dependency getDependencyInList(Model model, String groupId, String artifactId, String version) {
    List<Dependency> dependencyList = model.getDependencies();
    if (dependencyList == null || dependencyList.size() == 0) {
        return null;
    }

    Dependency dependency = null;
    for (Dependency d : dependencyList) {
        if (d.getArtifactId().equals(artifactId) && d.getGroupId().equals(groupId)
                && d.getVersion().equals(version)) {
            dependency = d;
            break;
        }
    }

    return dependency;
}
 
Example 2
Source File: FlattenMojo.java    From flatten-maven-plugin with Apache License 2.0 6 votes vote down vote up
/**
 * Collects the resolved {@link Dependency dependencies} from the given <code>effectiveModel</code>.
 *
 * @param effectiveModel is the effective POM {@link Model} to process.
 * @param flattenedDependencies is the {@link List} where to add the collected {@link Dependency dependencies}.
 * @throws MojoExecutionException if anything goes wrong.
 */
protected void createFlattenedDependencies( Model effectiveModel, List<Dependency> flattenedDependencies )
        throws MojoExecutionException
{
    getLog().debug( "Resolving dependencies of " + effectiveModel.getId() );
    // this.project.getDependencies() already contains the inherited dependencies but also those from profiles
    // List<Dependency> projectDependencies = currentProject.getOriginalModel().getDependencies();
    List<Dependency> projectDependencies = effectiveModel.getDependencies();

    if (flattenDependencyMode == null | flattenDependencyMode == FlattenDependencyMode.direct) {
        createFlattenedDependenciesDirect(projectDependencies, flattenedDependencies);
    } else if (flattenDependencyMode == FlattenDependencyMode.all) {
        try {
            createFlattenedDependenciesAll(projectDependencies, flattenedDependencies);
        } catch (Exception e) {
            throw new MojoExecutionException("caught exception when flattening dependencies", e);
        }
    }
}
 
Example 3
Source File: ProjectModelEnricher.java    From yaks with Apache License 2.0 5 votes vote down vote up
/**
 * Dynamically add project dependencies based on different configuration sources such as environment variables,
 * system properties configuration files.
 * @param projectModel
 * @throws LifecycleExecutionException
 */
private void injectProjectDependencies(Model projectModel) throws LifecycleExecutionException {
    logger.info("Add dynamic project dependencies ...");
    List<Dependency> dependencyList = projectModel.getDependencies();
    dependencyList.addAll(new FileBasedDependencyLoader().load(projectModel.getProperties(), logger));
    dependencyList.addAll(new SystemPropertyDependencyLoader().load(projectModel.getProperties(), logger));
    dependencyList.addAll(new EnvironmentSettingDependencyLoader().load(projectModel.getProperties(), logger));
    dependencyList.addAll(new FeatureTagsDependencyLoader().load(projectModel.getProperties(), logger));
}
 
Example 4
Source File: ProjectManifestCustomizer.java    From vertx-maven-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public Map<String, String> getEntries(AbstractVertxMojo mojo, MavenProject project) {
    Map<String, String> attributes = new HashMap<>();
    Model model = project.getModel();

    attributes.put(ExtraManifestKeys.PROJECT_ARTIFACT_ID.header(), model.getArtifactId());
    attributes.put(ExtraManifestKeys.PROJECT_GROUP_ID.header(), model.getGroupId());
    attributes.put(ExtraManifestKeys.PROJECT_VERSION.header(), model.getVersion());
    attributes.put(ExtraManifestKeys.PROJECT_NAME.header(),
        model.getName() == null ? model.getArtifactId() : model.getName());

    attributes.put(ExtraManifestKeys.BUILD_TIMESTAMP.header(), manifestTimestampFormat(new Date()));

    if (project.getUrl() != null) {
        attributes.put(ExtraManifestKeys.PROJECT_URL.header(), project.getUrl());
    }

    // TODO get the filtered lists.
    List<Dependency> dependencies = model.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
        String deps = dependencies.stream()
            .filter(d -> "compile".equals(d.getScope()) || null == d.getScope())
            .map(ProjectManifestCustomizer::asCoordinates)
            .collect(Collectors.joining(" "));
        attributes.put(ExtraManifestKeys.PROJECT_DEPS.header(), deps);
    }

    return attributes;
}
 
Example 5
Source File: VerifyMojo.java    From java-specialagent with Apache License 2.0 5 votes vote down vote up
private Map<String,String> scanRenames() throws IOException, XmlPullParserException {
  final BufferedReader in = new BufferedReader(new FileReader(project.getParent().getFile()));
  final MavenXpp3Reader reader = new MavenXpp3Reader();
  final Model model = reader.read(in);
  final Properties properties = model.getProperties();
  final Map<String,String> renames = new HashMap<>();
  for (final Dependency dependency : model.getDependencies()) {
    final String rename = properties.getProperty(dependency.getArtifactId());
    if (rename != null)
      renames.put(dependency.getArtifactId() + "-" + dependency.getVersion() + ".jar", rename + ".jar");
  }

  return renames;
}
 
Example 6
Source File: AddExtensionMojoTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@Test
void testAddSingleDependency() throws MojoExecutionException, IOException, XmlPullParserException {
    mojo.extension = DEP_GAV;
    mojo.extensions = new HashSet<>();
    mojo.execute();

    Model reloaded = reload();
    List<Dependency> dependencies = reloaded.getDependencies();
    assertThat(dependencies).hasSize(1);
    assertThat(dependencies.get(0).getArtifactId()).isEqualTo("commons-lang3");
}
 
Example 7
Source File: AddExtensionMojoTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@Test
void testAddMultipleDependency() throws MojoExecutionException, IOException, XmlPullParserException {
    Set<String> deps = new HashSet<>();
    deps.add(DEP_GAV);
    deps.add("commons-io:commons-io:2.6");
    mojo.extensions = deps;
    mojo.execute();

    Model reloaded = reload();
    List<Dependency> dependencies = reloaded.getDependencies();
    assertThat(dependencies).hasSize(2);
}
 
Example 8
Source File: PomIntegrationTest.java    From buck with Apache License 2.0 5 votes vote down vote up
@Test
public void testMultipleInvocation() throws Exception {
  // Setup: deps: com.example:with-deps:jar:1.0 -> com.othercorp:no-deps:jar:1.0
  BuildRule dep = createMavenPublishable("//example:dep", "com.othercorp:no-deps:1.0", null);

  MavenPublishable item =
      createMavenPublishable("//example:has-deps", "com.example:with-deps:1.0", null, dep);

  Path pomPath = tmp.getRoot().resolve("pom.xml");
  assertFalse(Files.exists(pomPath));

  // Basic case
  Pom.generatePomFile(pathResolver, item, pomPath);

  Model pomModel = parse(pomPath);
  assertEquals("com.example", pomModel.getGroupId());
  assertEquals("with-deps", pomModel.getArtifactId());
  assertEquals("1.0", pomModel.getVersion());
  List<Dependency> dependencies = pomModel.getDependencies();
  assertEquals(1, dependencies.size());
  Dependency dependency = dependencies.get(0);
  assertEquals("com.othercorp", dependency.getGroupId());
  assertEquals("no-deps", dependency.getArtifactId());
  assertEquals("1.0", dependency.getVersion());

  // Corrupt dependency data and ensure buck restores that
  removeDependencies(pomModel, pomPath);

  Pom.generatePomFile(pathResolver, item, pomPath);
  pomModel = parse(pomPath);

  // Add extra pom data and ensure buck preserves that
  pomModel.setUrl(URL);
  serializePom(pomModel, pomPath);

  Pom.generatePomFile(pathResolver, item, pomPath);

  pomModel = parse(pomPath);
  assertEquals(URL, pomModel.getUrl());
}
 
Example 9
Source File: MavenCommandLineMojo.java    From dependency-mediator with Apache License 2.0 5 votes vote down vote up
public String getTestDependencyArtifactIds() throws MojoExecutionException {
    StringBuilder result = new StringBuilder();
    Model model = buildProjectModel();
    List<Dependency> dependencies = model.getDependencies();
    for (Dependency dep : dependencies) {
        if ("test".equalsIgnoreCase(dep.getScope())) {
            result.append(dep.getArtifactId()).append(",");
        }
    }
    return result.toString().isEmpty() ? "" : result.toString().substring(0,
            result.length() - 1);
}
 
Example 10
Source File: MavenHelpers.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
/**
 * Returns true if the pom has the given dependency
 */
public static boolean hasDependency(Model pom, String groupId, String artifactId) {
    if (pom != null) {
        List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies();
        return hasDependency(dependencies, groupId, artifactId);
    }
    return false;
}
 
Example 11
Source File: ProjectManifestCustomizer.java    From vertx-maven-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public Map<String, String> getEntries(PackageMojo mojo, MavenProject project) {
    Map<String, String> attributes = new HashMap<>();
    Model model = project.getModel();

    attributes.put("Project-Name",
        model.getName() == null ? model.getArtifactId() : model.getName());
    attributes.put("Project-Group", model.getGroupId());
    attributes.put("Project-Version", model.getVersion());
    attributes.put("Build-Timestamp", manifestTimestampFormat(new Date()));

    if (project.getUrl() != null) {
        attributes.put("Project-Url", model.getUrl());
    }

    // TODO get the filtered lists.
    List<Dependency> dependencies = model.getDependencies();
    if (dependencies != null && !dependencies.isEmpty()) {
        String deps = dependencies.stream()
            .filter(d -> "compile".equals(d.getScope()) || null == d.getScope())
            .map(ProjectManifestCustomizer::asCoordinates)
            .collect(Collectors.joining(" "));
        attributes.put("Project-Dependencies", deps);
    }

    return attributes;
}
 
Example 12
Source File: DataflowDependencyManager.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private static Dependency getDataflowDependencyFromModel(Model model) {
  for (Dependency dependency : model.getDependencies()) {
    if (isDataflowDependency(dependency)) {
      return dependency;
    }
  }
  return null;
}
 
Example 13
Source File: ThorntailFacet.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
public List<FractionDescriptor> getInstalledFractions()
{
   MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
   Model pom = maven.getModel();
   List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies();
   return FractionList.get().getFractionDescriptors()
            .stream()
            .filter(d -> alreadyInstalled(d.getArtifactId(), dependencies))
            .collect(toList());
}
 
Example 14
Source File: ThorntailFacet.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
public List<FractionDescriptor> getFractions()
{
   MavenFacet maven = getFaceted().getFacet(MavenFacet.class);
   Model pom = maven.getModel();
   List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies();
   return FractionList.get().getFractionDescriptors()
            .stream()
            .filter(d -> !d.isInternal() && !alreadyInstalled(d.getArtifactId(), dependencies))
            .sorted(comparing(FractionDescriptor::getArtifactId))
            .collect(toList());
}
 
Example 15
Source File: PluginBundleManager.java    From BIMserver with GNU Affero General Public License v3.0 4 votes vote down vote up
public PluginBundle loadFromPluginDir(PluginBundleVersionIdentifier pluginBundleVersionIdentifier, SPluginBundleVersion pluginBundleVersion, List<SPluginInformation> plugins, boolean strictDependencyChecking) throws Exception {
	Path target = pluginsDir.resolve(pluginBundleVersionIdentifier.getFileName());
	if (!Files.exists(target)) {
		throw new PluginException(target.toString() + " not found");
	}

	SPluginBundle sPluginBundle = new SPluginBundle();

	MavenXpp3Reader mavenreader = new MavenXpp3Reader();

	Model model = null;
	try (JarFile jarFile = new JarFile(target.toFile())) {
		ZipEntry entry = jarFile.getEntry("META-INF/maven/" + pluginBundleVersion.getGroupId() + "/" + pluginBundleVersion.getArtifactId() + "/pom.xml");
		try (InputStream inputStream = jarFile.getInputStream(entry)) {
			model = mavenreader.read(inputStream);
		}
	}
	sPluginBundle.setOrganization(model.getOrganization().getName());
	sPluginBundle.setName(model.getName());

	DelegatingClassLoader delegatingClassLoader = new DelegatingClassLoader(getClass().getClassLoader());

	loadDependencies(model.getVersion(), strictDependencyChecking, model, delegatingClassLoader);
	
	for (org.apache.maven.model.Dependency dependency : model.getDependencies()) {
		if (dependency.getGroupId().equals("org.opensourcebim") && (dependency.getArtifactId().equals("shared") || dependency.getArtifactId().equals("pluginbase") || dependency.getArtifactId().equals("ifcplugins"))) {
			// TODO Skip, we should also check the version though
		} else {
			PluginBundleIdentifier pluginBundleIdentifier = new PluginBundleIdentifier(dependency.getGroupId(), dependency.getArtifactId());
			if (pluginBundleIdentifierToPluginBundle.containsKey(pluginBundleIdentifier)) {
				if (strictDependencyChecking) {
					VersionRange versionRange = VersionRange.createFromVersion(dependency.getVersion());
					String version = pluginBundleIdentifierToPluginBundle.get(pluginBundleIdentifier).getPluginBundleVersion().getVersion();
					ArtifactVersion artifactVersion = new DefaultArtifactVersion(version);
					if (versionRange.containsVersion(artifactVersion)) {
						// OK
					} else {
						throw new Exception("Required dependency " + pluginBundleIdentifier + " is installed, but it's version (" + version + ") does not comply to the required version (" + dependency.getVersion() + ")");
					}
				} else {
					LOGGER.info("Skipping strict dependency checking for dependency " + dependency.getArtifactId());
				}
			} else {
				if (dependency.getGroupId().equals("org.opensourcebim") && (dependency.getArtifactId().equals("shared") || dependency.getArtifactId().equals("pluginbase"))) {
				} else {
					MavenPluginLocation mavenPluginLocation = mavenPluginRepository.getPluginLocation(dependency.getGroupId(), dependency.getArtifactId());

					try {
						Path depJarFile = mavenPluginLocation.getVersionJar(dependency.getVersion());

						FileJarClassLoader jarClassLoader = new FileJarClassLoader(pluginManager, delegatingClassLoader, depJarFile);
						jarClassLoaders.add(jarClassLoader);
						delegatingClassLoader.add(jarClassLoader);
					} catch (Exception e) {

					}
				}
			}
		}
	}
	return loadPlugin(pluginBundleVersionIdentifier, target, sPluginBundle, pluginBundleVersion, plugins, delegatingClassLoader);
}
 
Example 16
Source File: PluginBundleManager.java    From BIMserver with GNU Affero General Public License v3.0 4 votes vote down vote up
private void loadDependencies(String pluginBundleVersion, boolean strictDependencyChecking, Model model,
			DelegatingClassLoader delegatingClassLoader)
			throws DependencyCollectionException, InvalidVersionSpecificationException, Exception {
		if (model.getRepositories() != null) {
			for (Repository repository : model.getRepositories()) {
				mavenPluginRepository.addRepository(repository.getId(), "default", repository.getUrl());
			}
		}

		List<Dependency> dependenciesToResolve = new ArrayList<>();
		for (org.apache.maven.model.Dependency dependency2 : model.getDependencies()) {
			String scope = dependency2.getScope();
			if (scope != null && (scope.contentEquals("test"))) {
				// Skip
				continue;
			}
			Dependency d = new Dependency(new DefaultArtifact(dependency2.getGroupId(), dependency2.getArtifactId(), dependency2.getType(), dependency2.getVersion()), dependency2.getScope());
			Set<Exclusion> exclusions = new HashSet<>();
			d.setExclusions(exclusions);
			exclusions.add(new Exclusion("org.opensourcebim", "pluginbase", null, "jar"));
			exclusions.add(new Exclusion("org.opensourcebim", "shared", null, "jar"));
			exclusions.add(new Exclusion("org.opensourcebim", "ifcplugins", null, "jar"));
			dependenciesToResolve.add(d);
		}
		CollectRequest collectRequest = new CollectRequest(dependenciesToResolve, null, null);
		collectRequest.setRepositories(mavenPluginRepository.getRepositoriesAsList());
		CollectResult collectDependencies = mavenPluginRepository.getSystem().collectDependencies(mavenPluginRepository.getSession(), collectRequest);
		PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
		DependencyNode rootDep = collectDependencies.getRoot();
		rootDep.accept(nlg);
		
		for (Dependency dependency : nlg.getDependencies(true)) {
			if (dependency.getScope().contentEquals("test")) {
				continue;
			}
//			LOGGER.info(dependency.getArtifact().getGroupId() + "." + dependency.getArtifact().getArtifactId());
			Artifact dependencyArtifact = dependency.getArtifact();
			PluginBundleIdentifier pluginBundleIdentifier = new PluginBundleIdentifier(dependencyArtifact.getGroupId(), dependencyArtifact.getArtifactId());
			if (pluginBundleIdentifierToPluginBundle.containsKey(pluginBundleIdentifier)) {
				if (strictDependencyChecking) {
					String version = dependencyArtifact.getVersion();
					if (!version.contains("[") && !version.contains("(")) {
						version = "[" + version + "]";
					}
					VersionRange versionRange = VersionRange.createFromVersionSpec(version);
					// String version =
					// pluginBundleIdentifierToPluginBundle.get(pluginBundleIdentifier).getPluginBundleVersion().getVersion();
					ArtifactVersion artifactVersion = new DefaultArtifactVersion(pluginBundleVersion);
					if (versionRange.containsVersion(artifactVersion)) {
						// OK
					} else {
						throw new Exception(
								"Required dependency " + pluginBundleIdentifier + " is installed, but it's version (" + pluginBundleVersion + ") does not comply to the required version (" + dependencyArtifact.getVersion() + ")");
					}
				} else {
					LOGGER.info("Skipping strict dependency checking for dependency " + dependencyArtifact.getArtifactId());
				}
			} else {
				try {
					if (dependencyArtifact.getGroupId().contentEquals("com.sun.xml.ws")) {
						continue;
					}
					MavenPluginLocation mavenPluginLocation = mavenPluginRepository.getPluginLocation(dependencyArtifact.getGroupId(), dependencyArtifact.getArtifactId());
					if (dependencyArtifact.getExtension().contentEquals("jar")) {
						Path depJarFile = mavenPluginLocation.getVersionJar(dependencyArtifact.getVersion());
						
						FileJarClassLoader jarClassLoader = new FileJarClassLoader(pluginManager, delegatingClassLoader, depJarFile);
						jarClassLoaders.add(jarClassLoader);
						delegatingClassLoader.add(jarClassLoader);
					}
				} catch (Exception e) {
					e.printStackTrace();
					throw new Exception("Required dependency " + pluginBundleIdentifier + " is not installed");
				}
			}
		}
	}
 
Example 17
Source File: PomProperty.java    From flatten-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public List<Dependency> get( Model model )
{
    return model.getDependencies();
}
 
Example 18
Source File: XmlXPathReplaceTest.java    From butterfly with MIT License 4 votes vote down vote up
@Test
public void changesElementValueOnMatch() throws IOException, XmlPullParserException, ParserConfigurationException {
    String xpath = "/project/dependencies/dependency[groupId='xmlunit']";

    DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docFactory.newDocumentBuilder();

    // root elements
    Document doc = docBuilder.newDocument();
    Element replacement = doc.createElement("dependency");
    Element groupId = doc.createElement("groupId");
    Element artifactId = doc.createElement("artifactId");
    Element version = doc.createElement("version");
    groupId.setTextContent("thegroup");
    artifactId.setTextContent("theartifact");
    version.setTextContent("theversion");
    replacement.appendChild(groupId);
    replacement.appendChild(artifactId);
    replacement.appendChild(version);

    XmlXPathReplace xmlElement = new XmlXPathReplace(xpath, replacement)
            .relative("pom.xml");
    TOExecutionResult executionResult = xmlElement.execution(transformedAppFolder, transformationContext);
    Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS);
    Assert.assertNotNull(executionResult.getDetails());
    assertChangedFile("pom.xml");
    Model pomModel = getTransformedPomModel("pom.xml");
    boolean hasNewElement = false;

    for (Dependency dependency : pomModel.getDependencies()) {
        if (!hasNewElement && groupId.getTextContent().equals(dependency.getGroupId())) {
            Assert.assertEquals(dependency.getArtifactId(), artifactId.getTextContent());
            Assert.assertEquals(dependency.getVersion(), version.getTextContent());
            hasNewElement = true;
        } else {
            Assert.assertNotEquals(dependency.getGroupId(), "xmlunit");
            Assert.assertNotEquals(dependency.getArtifactId(), "xmlunit");
            Assert.assertNotEquals(dependency.getVersion(), "1.5");
        }
    }
    
    Assert.assertTrue(hasNewElement, "New element wasn't found in xml.");
    Assert.assertEquals(xmlElement.getDescription(),
            "Replace node of XPath " + xpath + " in XML file pom.xml with user supplied XML Element");
}
 
Example 19
Source File: Analyzer.java    From Moss with Apache License 2.0 4 votes vote down vote up
private static PomInfo readPom(InputStream is) throws SAXException, IOException, ParserConfigurationException {
    if (null != is) {
        MavenXpp3Reader reader = new MavenXpp3Reader();
        try {
            Model model = reader.read(is);
            PomInfo pomInfo = new PomInfo();
            pomInfo.setArtifactId(model.getArtifactId());
            if (StringUtils.isEmpty(model.getGroupId())) {
                pomInfo.setGroupId(model.getParent().getGroupId());
            } else {
                pomInfo.setGroupId(model.getGroupId());
            }
            if (StringUtils.isEmpty(model.getVersion())) {
                pomInfo.setVersion(model.getParent().getVersion());
            } else {
                pomInfo.setVersion(model.getVersion());
            }
            List<Dependency> dependencies = model.getDependencies();
            List<PomDependency> pomDependencies = Lists.newArrayList();
            for (Dependency dependency : dependencies) {
                PomDependency pomDependency = new PomDependency();
                String groupId = dependency.getGroupId();
                if (StringUtils.isNotEmpty(groupId) && (groupId.equals("${project.groupId}"))) {
                    groupId = pomInfo.groupId;
                }
                pomDependency.setGroupId(groupId);
                pomDependency.setArtifactId(dependency.getArtifactId());
                String version = dependency.getVersion();
                if (StringUtils.isNotEmpty(version) && (version.startsWith("${") && version.endsWith("}"))) {
                    version = model.getProperties().getProperty(version.substring(2, version.length() - 1));
                }
                pomDependency.setVersion(version);

                pomDependency.setScope(dependency.getScope());
                pomDependencies.add(pomDependency);
            }
            pomInfo.setDependencies(pomDependencies);
            return pomInfo;
        } catch (XmlPullParserException e) {
            e.printStackTrace();
            logger.error("read pom failed!" + e.getMessage());
        }
    }

    return null;
}
 
Example 20
Source File: CamelQuarkusExtension.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
public static CamelQuarkusExtension read(Path runtimePomXmlPath) {
    try (Reader runtimeReader = Files.newBufferedReader(runtimePomXmlPath, StandardCharsets.UTF_8)) {
        final MavenXpp3Reader rxppReader = new MavenXpp3Reader();
        final Model runtimePom = rxppReader.read(runtimeReader);
        final List<Dependency> deps = runtimePom.getDependencies();

        final String aid = runtimePom.getArtifactId();
        String camelComponentArtifactId = null;
        if (deps != null && !deps.isEmpty()) {
            Optional<Dependency> artifact = deps.stream()
                    .filter(dep ->

                    "org.apache.camel".equals(dep.getGroupId()) &&
                            ("compile".equals(dep.getScope()) || dep.getScope() == null))
                    .findFirst();
            if (artifact.isPresent()) {
                camelComponentArtifactId = CqCatalog.toCamelComponentArtifactIdBase(artifact.get().getArtifactId());
            }
        }
        final Properties props = runtimePom.getProperties() != null ? runtimePom.getProperties() : new Properties();

        String name = props.getProperty("title");
        if (name == null) {
            name = CqUtils.getNameBase(runtimePom.getName());
        }

        final String version = CqUtils.getVersion(runtimePom);

        return new CamelQuarkusExtension(
                runtimePomXmlPath,
                camelComponentArtifactId,
                (String) props.get("firstVersion"),
                aid,
                name,
                runtimePom.getDescription(),
                props.getProperty("label"),
                version,
                !runtimePomXmlPath.getParent().getParent().getParent().getFileName().toString().endsWith("-jvm"),
                deps == null ? Collections.emptyList() : Collections.unmodifiableList(deps));
    } catch (IOException | XmlPullParserException e) {
        throw new RuntimeException("Could not read " + runtimePomXmlPath, e);
    }
}