/** * If minification enabled. */ public boolean isMinificationEnabled() { return !(Boolean.getBoolean(DISABLE_MINIFICATION) || PluginUtils.isAtlassianDevMode()); }
/** * Determines if a plugin requires a restart after being installed at runtime. Looks for the annotation * {@link RequiresRestart} on the plugin's module descriptors. * * @param plugin The plugin that was just installed at runtime, but not yet enabled * @return True if a restart is required * @since 2.1 */ public static boolean doesPluginRequireRestart(final Plugin plugin) { //PLUG-451: When in dev mode, plugins should not require a restart. if (isAtlassianDevMode()) { return false; } for (final ModuleDescriptor<?> descriptor : plugin.getModuleDescriptors()) { if (descriptor.getClass().getAnnotation(RequiresRestart.class) != null) { return true; } } return false; }
if (Boolean.getBoolean(ATLASSIAN_WEBRESOURCE_DISABLE_MINIFICATION) || PluginUtils.isAtlassianDevMode()) { return false;
if (isAtlassianDevMode() && pluginsInEnablingState.size() == 1) { final long currentTime = System.currentTimeMillis(); if (singlePluginTimeout == 0) {
private void assertSpringAvailableIfRequired(final TransformContext context) { if (isAtlassianDevMode() && context.shouldRequireSpring()) { final String header = context.getManifest().getMainAttributes().getValue(SPRING_CONTEXT); if (header == null) { log.debug("Manifest has no 'Spring-Context:' header. Prefer the header 'Spring-Context: *' in the jar '{}'.", context.getPluginArtifact()); } else if (header.contains(";timeout:=")) { log.warn("Manifest contains a 'Spring-Context:' header with a timeout, namely '{}'. This can cause problems as the " + "timeout is server specific. Use the header 'Spring-Context: *' in the jar '{}'.", header, context.getPluginArtifact()); } // else there's a Spring-Context with no timeout:=, which is fine. } }
public Config(ResourceBatchingConfiguration batchingConfiguration, WebResourceIntegration integration, WebResourceUrlProvider urlProvider, ServletContextFactory servletContextFactory, TransformerCache transformerCache, ResourceCompiler resourceCompiler) { this.batchingConfiguration = batchingConfiguration; this.integration = integration; this.urlProvider = urlProvider; this.servletContextFactory = servletContextFactory; this.transformerCache = transformerCache; this.isContentCacheEnabled = !(Boolean.getBoolean(PluginUtils.WEBRESOURCE_DISABLE_FILE_CACHE) || PluginUtils.isAtlassianDevMode()); this.isUrlCachingEnabled = !Boolean.getBoolean(DISABLE_URL_CACHING); this.contentCacheSize = Integer.getInteger(PluginUtils.WEBRESOURCE_FILE_CACHE_SIZE, 1000); this.incrementalCacheSize = Integer.getInteger(INCREMENTAL_CACHE_SIZE, 1000); this.urlCacheSize = Integer.getInteger(PluginUtils.WEBRESOURCE_FILE_CACHE_SIZE, 200); cdnResourceUrlTransformer = new CdnResourceUrlTransformerImpl(this); this.resourceCompiler = resourceCompiler == null ? new NoOpResourceCompiler() : resourceCompiler; this.usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins = integration.usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins(); this.syncContextCreated = false; }
@SuppressWarnings("unchecked") public void execute(TransformContext context) throws PluginTransformationException { XPath xpath = DocumentHelper.createXPath("//@class"); List<Attribute> attributes = xpath.selectNodes(context.getDescriptorDocument()); for (Attribute attr : attributes) { String className = attr.getValue(); scanForHostComponents(context, className); int dotpos = className.lastIndexOf("."); if (dotpos > -1) { String pkg = className.substring(0, dotpos); String pkgPath = pkg.replace('.', '/') + '/'; // Only add an import if the system exports it and the plugin isn't using the package if (context.getSystemExports().isExported(pkg)) { if (context.getPluginArtifact().doesResourceExist(pkgPath)) { if (isAtlassianDevMode()) log.warn("The plugin '{}' uses a package '{}' that is also exported by the application. " + "It is highly recommended that the plugin use its own packages.", context.getPluginArtifact(), pkg); } else { context.getExtraImports().add(pkg); } } } } }
String msg = webResourceDeprecationWarnings.get(key).buildLogMessage() + " (required by \"" + completeKey + "\")"; if (PluginUtils.isAtlassianDevMode()) { supportLogger.warn(msg); } else {