versionInProject = null; try { versionInProject = MavenUtils.asInProject().getVersion(groupId, artifactId); } catch (RuntimeException e) { logger.info("Can not find version of transitive dependency " + groupId + ":" + artifactId
if (versionAsInProject) try { version = MavenUtils.asInProject().getVersion(groupId, artifactId); } catch (Throwable e) { logger.error("Could not find version of " + groupId + ":" + artifactId + " in Maven project");
public static String getKarafVersionAsInProject() { return MavenUtils.asInProject().getVersion(KARAF_GROUP_ID, KARAF_ARTIFACT_ID); }
public MavenArtifactUrlReference version(final VersionResolver _resolver) { validateNotNull(_resolver, "Version resolver"); return version(_resolver.getVersion(groupId, artifactId)); }
public MavenArtifactUrlReference version(final VersionResolver _resolver) { validateNotNull(_resolver, "Version resolver"); return version(_resolver.getVersion(groupId, artifactId)); }
/** * Discovers the profile version out of the project. * To do so, the maven project should have a dependency on the profile and Pax Exam maven plugin configured to run * the "generate-depends-file" goal. * * @return itself, for fluent api usage */ public ProfileOption versionAsInProject() { return version( MavenUtils.asInProject().getVersion( "org.ops4j.pax.runner.profiles", getProfile() ) ); }
/** * Set the project version as a Karaf system property * <p/> * This method assumes that the test-support bundle has the same * version as the code being tested */ public static SystemPropertyOption projectVersionAsSystemProperty() { String version = MavenUtils.asInProject() .getVersion("org.apache.provisionr", "provisionr-test-support"); return systemProperty("project.version").value(version); }