LOG.info( "- " + moduleInfo.toString() ); if ( "deegree-services-commons".equals( moduleInfo.getArtifactId() ) ) { version = moduleInfo.getVersion();
private Collection<ModuleInfo> extractModulesInfo( ServletContext servletContext ) throws IOException, URISyntaxException { if ( servletContext.getServerInfo() != null && servletContext.getServerInfo().contains( "WebLogic" ) ) { LOG.debug( "Running on weblogic. Not extracting module info from classpath, but from WEB-INF/lib." ); return ModuleInfo.extractModulesInfo( forWebInfLib( servletContext ) ); } return ModuleInfo.extractModulesInfo( forClassLoader() ); }
/** * Returns the {@link ModuleInfo}s for the deegree modules on the given classpathes. * * @param classpathURLs * classpath urls, must not be <code>null</code> * @return module infos, never <code>null</code>, but can be empty (if no deegree module information is present on * the given classpathes) * @throws IOException * if accessing <code>META-INF/deegree/buildinfo.properties</code> or * <code>META-INF/maven/[..]/pom.properties</code> fails */ public static Collection<ModuleInfo> extractModulesInfo( Collection<URL> classpathURLs ) throws IOException { SortedSet<ModuleInfo> modules = new TreeSet<ModuleInfo>(); for ( URL classpathURL : classpathURLs ) { if ( classpathURL.getFile().toLowerCase().endsWith( ".zip" ) ) { continue; } try { ModuleInfo moduleInfo = extractModuleInfo( classpathURL ); if ( moduleInfo != null ) { modules.add( moduleInfo ); } } catch ( Throwable e ) { LOG.warn( "Could not extract module info from {}.", classpathURL ); } } return modules; }
moduleInfo = new ModuleInfo( buildArtifactId, pomVersion, buildRev, buildDate, buildBy ); } finally { closeQuietly( buildInfoStream );
/** * Returns the {@link ModuleInfo} for all deegree modules in the workspace. * * @return * @throws IOException */ public Collection<ModuleInfo> getModulesInfo() throws IOException { if ( !( workspace.getModuleClassLoader() instanceof URLClassLoader ) ) { return null; } Set<URL> urls = new HashSet<URL>(); for ( URL url : ( (URLClassLoader) workspace.getModuleClassLoader() ).getURLs() ) { urls.add( url ); } return ModuleInfo.extractModulesInfo( urls ); }
if ( url.getFile().endsWith( ".jar" ) ) { urls.add( url ); ModuleInfo moduleInfo = ModuleInfo.extractModuleInfo( url ); if ( moduleInfo != null ) { LOG.info( " - " + moduleInfo );
@Override public boolean equals( Object o ) { if ( o instanceof ModuleInfo ) { return this.toString().equals( o.toString() ); } return false; }