/** * Return the full version string of the present Spring codebase, * or {@code null} if it cannot be determined. * @see Package#getImplementationVersion() */ @Nullable public static String getVersion() { Package pkg = SpringVersion.class.getPackage(); return (pkg != null ? pkg.getImplementationVersion() : null); }
String getImplementationVersion(Class type) { if (type == null) { return "na"; } Package aPackage = type.getPackage(); if (aPackage != null) { String v = aPackage.getImplementationVersion(); if (v == null) { return "na"; } else { return v; } } return "na"; }
private String getDruidVersion() { return Status.class.getPackage().getImplementationVersion(); }
@Override protected String getVersionString() { return "reader-" + DexFileReader.class.getPackage().getImplementationVersion() + ", translator-" + Dex2jar.class.getPackage().getImplementationVersion() + ", ir-" + ET.class.getPackage().getImplementationVersion(); }
/** * Returns the version string printed when the user requests version help (--version or -V). * @return a version string based on the package implementation version */ private static String getVersionString() { return "Checkstyle version: " + Main.class.getPackage().getImplementationVersion(); }
public static String getVersionString() { if ( version == null ) { version = Version.class.getPackage().getImplementationVersion(); if ( version == null ) { version = "[WORKING]"; } } return version; } }
public boolean showVersionIfRequested() { if (version) { String clientVersion = Presto.class.getPackage().getImplementationVersion(); System.out.println("Presto CLI " + firstNonNull(clientVersion, "(version unknown)")); } return version; } }
public static String getVersion() { Package pkg = MybatisPlusVersion.class.getPackage(); return (pkg != null ? pkg.getImplementationVersion() : null); }
private static void doAddVersion(List<String> vs, String pkg, Class<?> clz) { try { vs.add(pkg + "-" + clz.getPackage().getImplementationVersion()); } catch (Exception ignore) { // ignored } }
public static String getVersion() { Package pkg = SpringSecurityCoreVersion.class.getPackage(); return (pkg != null ? pkg.getImplementationVersion() : null); }
/** * Return the full version string of the present Spring codebase, * or {@code null} if it cannot be determined. * @see Package#getImplementationVersion() */ @Nullable public static String getVersion() { Package pkg = SpringVersion.class.getPackage(); return (pkg != null ? pkg.getImplementationVersion() : null); }
protected String getVersionString() { return getClass().getPackage().getImplementationVersion(); }
@Override public void auditStarted(AuditEvent event) { writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); final String version = XMLLogger.class.getPackage().getImplementationVersion(); writer.println("<checkstyle version=\"" + version + "\">"); }
String getApplicationTitle() { Package pack = BeeLine.class.getPackage(); return loc("app-introduction", new Object[] { "Beeline", pack.getImplementationVersion() == null ? "???" : pack.getImplementationVersion(), "Apache Hive", // getManifestAttribute ("Specification-Title"), // getManifestAttribute ("Implementation-Version"), // getManifestAttribute ("Implementation-ReleaseDate"), // getManifestAttribute ("Implementation-Vendor"), // getManifestAttribute ("Implementation-License"), }); }
@Test(groups = CLI, timeOut = TIMEOUT) public void shouldDisplayVersion() throws IOException { launchPrestoCli("--version"); String version = firstNonNull(Presto.class.getPackage().getImplementationVersion(), "(version unknown)"); assertThat(presto.readRemainingOutputLines()).containsExactly("Presto CLI " + version); }
public SecurityNamespaceHandler() { String coreVersion = SpringSecurityCoreVersion.getVersion(); Package pkg = SpringSecurityCoreVersion.class.getPackage(); if (pkg == null || coreVersion == null) { logger.info("Couldn't determine package version information."); return; } String version = pkg.getImplementationVersion(); logger.info("Spring Security 'config' module version is " + version); if (version.compareTo(coreVersion) != 0) { logger.error("You are running with different versions of the Spring Security 'core' and 'config' modules"); } }
/** * Load the unique extensions and return their implementation-versions * * @return map of extensions loaded with their respective implementation versions. */ private List<ModuleVersion> getExtensionVersions(Collection<DruidModule> druidModules) { List<ModuleVersion> moduleVersions = new ArrayList<>(); for (DruidModule module : druidModules) { String artifact = module.getClass().getPackage().getImplementationTitle(); String version = module.getClass().getPackage().getImplementationVersion(); moduleVersions.add(new ModuleVersion(module.getClass().getCanonicalName(), artifact, version)); } return moduleVersions; } }
public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } }
public static void main(String... args) { if (shouldRedirectStdOutAndErr()) { redirectStdOutAndErr(); } log("Starting process: "); log(" Working directory : " + System.getProperty("user.dir")); log(" Application arguments: " + Arrays.asList(args)); log(" GoCD Version: " + Boot.class.getPackage().getImplementationVersion()); if (shouldLogJVMArgsAndEnvVars()) { log(" JVM arguments : " + jvmArgs()); log(" JVM properties: " + System.getProperties()); log(" Environment Variables: " + System.getenv()); } new Boot(args).run(); }
@Test public void shouldCallActualMockserverVersion() throws Exception { String actualVersion = MockServerClient.class.getPackage().getImplementationVersion(); try (MockServerContainer mockServer = new MockServerContainer(actualVersion)) { mockServer.start(); String expectedBody = "Hello World!"; assertThat("MockServer returns correct result", responseFromMockserver(mockServer, expectedBody, "/hello"), containsString(expectedBody) ); } }