String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
/** * Creates a new {@link PackageVersion}. */ public PackageVersion() { super(); this.version = VersionUtil.parseVersion("${project.version}", "${project.groupId}", "${project.artifactId}"); assert this.version != null; }
@Override public Version version() { return VersionUtil.parseVersion("0.0.1", "foo", "bar"); }
@Override public Version version() { return VersionUtil.parseVersion("1.0", "com.bazaarvoice.emodb.common.json", "lazy-json"); }
@Override public Version version() { return VersionUtil.parseVersion("1.0", "com.bazaarvoice.emodb.common.json", "lazy-json"); }
/** * Use variant that takes three arguments instead * * @deprecated */ @Deprecated public static Version parseVersion(String versionStr) { return parseVersion(versionStr, null, null); }
/** * Use variant that takes three arguments instead * * @deprecated */ @Deprecated public static Version parseVersion(String versionStr) { return parseVersion(versionStr, null, null); }
@Override public Version version() { return VersionUtil.parseVersion( "V1", rb.getString("project.groupId"), rb.getString("project.artifactId")); }
@Override public Version version() { return VersionUtil.parseVersion( rb.getString("project.version"), rb.getString("project.groupId"), rb.getString("project.artifactId")); }
@Override public Version version() { return VersionUtil.parseVersion( rb.getString("project.version"), rb.getString("project.groupId"), rb.getString("project.artifactId")); }
private static Version doReadVersion(final Reader r) { String version = null, group = null, artifact = null; final BufferedReader br = new BufferedReader(r); try { version = br.readLine(); if (version != null) { group = br.readLine(); if (group != null) { artifact = br.readLine(); } } } catch (IOException ignored) { } finally { _close(br); } // We don't trim() version: parseVersion() takes care ot that if (group != null) { group = group.trim(); } if (artifact != null) { artifact = artifact.trim(); } return parseVersion(version, group, artifact); }
private static Version doReadVersion(final Reader r) { String version = null, group = null, artifact = null; final BufferedReader br = new BufferedReader(r); try { version = br.readLine(); if (version != null) { group = br.readLine(); if (group != null) { artifact = br.readLine(); } } } catch (IOException ignored) { } finally { _close(br); } // We don't trim() version: parseVersion() takes care ot that if (group != null) { group = group.trim(); } if (artifact != null) { artifact = artifact.trim(); } return parseVersion(version, group, artifact); }
/** * Deprecated method copied from Jackson VersionUtil as this is exactly what we want :) * * @param groupId The maven groupId of this module. * @param artifactId The maven artifactId of this module. * @return The version of this maven artifact. */ private static Version mavenVersionFor(/*ClassLoader cl,*/ String groupId, String artifactId) { String groupPath = groupId.replaceAll(Pattern.quote("."), "/"); String resource = "/META-INF/maven/" + groupPath + '/' + artifactId + "/pom.properties"; InputStream pomProperties = null; try { Properties props = new Properties(); props.load(pomProperties = Compatibility.class.getResourceAsStream(resource)); String versionStr = props.getProperty("version"); String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return VersionUtil.parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (Exception e) { LOGGER.log(Level.FINEST, "Exception ignored while loading maven version.", e); } finally { _close(pomProperties); } return Version.unknownVersion(); }
String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
String pomPropertiesArtifactId = props.getProperty("artifactId"); String pomPropertiesGroupId = props.getProperty("groupId"); return parseVersion(versionStr, pomPropertiesGroupId, pomPropertiesArtifactId); } catch (IOException e) {
private void updateTopology(String oldVersion) { Version v = Version.unknownVersion(); if (oldVersion != null) { v = VersionUtil.parseVersion(oldVersion, null, null); } if (v.isUnknownVersion() || v.compareTo(new Version(1, 5, 0, null, null, null)) < 0) { if (this.sqlDialect.supportsDeferrableForeignKey()) { upgradeForeignKeysToDeferrable(); } } if (v.isUnknownVersion() || v.compareTo(new Version(2, 0, 0, null, null, null)) < 0) { addPartitionSupportToSqlgSchema(); } }
private void updateTopology(String oldVersion) { Version v = Version.unknownVersion(); if (oldVersion != null) { v = VersionUtil.parseVersion(oldVersion, null, null); } if (v.isUnknownVersion() || v.compareTo(new Version(1, 5, 0, null, null, null)) < 0) { if (this.sqlDialect.supportsDeferrableForeignKey()) { upgradeForeignKeysToDeferrable(); } } if (v.isUnknownVersion() || v.compareTo(new Version(2, 0, 0, null, null, null)) < 0) { addPartitionSupportToSqlgSchema(); } }