Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
22,200 | MavenDistribution (@Nullable String workingDirectory) { if (!useWrapper() || workingDirectory == null) { return mySettingsDistribution.getValue(); } String multiModuleDir = myWorkingDirToMultiModuleMap.computeIfAbsent(workingDirectory, this::resolveMultiModuleDirectory); return myMultimoduleDirToWrapperedMavenDistributionsMap.computeIfAbsent(multiModuleDir, this::getWrapperDistribution); } | getMavenDistribution |
22,201 | MavenDistribution (@NotNull String multiModuleDir) { String distributionUrl = getWrapperDistributionUrl(multiModuleDir); return (distributionUrl == null) ? resolveEmbeddedMavenHome() : getMavenWrapper(distributionUrl); } | getWrapperDistribution |
22,202 | MavenDistribution (String distributionUrl) { MavenDistribution distribution = MavenWrapperSupport.getCurrentDistribution(distributionUrl); if (distribution == null) { distribution = resolveEmbeddedMavenHome(); } return distribution; } | getMavenWrapper |
22,203 | LocalMavenDistribution () { if (PluginManagerCore.isRunningFromSources()) { Path mavenPath = mySourcePath.getValue(); return new LocalMavenDistribution(mavenPath, BundledMaven3.INSTANCE.getTitle()); } else { final Path pluginFileOrDir = Path.of(PathUtil.getJarPathForClass(MavenServerManager.class)); final Path root = pluginFileOrDir.getParent(); // maven3 folder inside maven plugin layout return new LocalMavenDistribution(root.resolve("maven3"), BundledMaven3.INSTANCE.getTitle()); } } | resolveEmbeddedMavenHome |
22,204 | Path () { BuildDependenciesCommunityRoot communityRoot = new BuildDependenciesCommunityRoot(Path.of(PathManager.getCommunityHomePath())); return BundledMavenDownloader.INSTANCE.downloadMavenDistributionSync(communityRoot); } | getSourceMavenPath |
22,205 | String (@NotNull String workingDirectory) { MavenProjectsManager manager = MavenProjectsManager.getInstance(myProject); if (!manager.isMavenizedProject()) { return FileUtilRt.toSystemIndependentName(calculateMultimoduleDirUpToFileTree(workingDirectory)); } return FileUtilRt.toSystemIndependentName(manager.getRootProjects().stream() .map(MavenProject::getDirectory) .filter(rpDirectory -> FileUtil.isAncestor(rpDirectory, workingDirectory, false)) .findFirst() .orElseGet(() -> calculateMultimoduleDirUpToFileTree(workingDirectory))); } | resolveMultiModuleDirectory |
22,206 | String (String directory) { VirtualFile path = LocalFileSystem.getInstance().findFileByPath(directory); if (path == null) return directory; Collection<String> knownWorkingDirs = myWorkingDirToMultiModuleMap.values(); for (String known : knownWorkingDirs) { if (FileUtil.isAncestor(known, directory, false)) { return known; } } return MavenUtil.getVFileBaseDir(path).getPath(); } | calculateMultimoduleDirUpToFileTree |
22,207 | String (@NotNull String workingDirectory) { return myWorkingDirToMultiModuleMap.computeIfAbsent(workingDirectory, this::resolveMultiModuleDirectory); } | getMultimoduleDirectory |
22,208 | boolean () { MavenWorkspaceSettings settings = MavenWorkspaceSettingsComponent.getInstance(myProject).getSettings(); return MavenUtil.isWrapper(settings.getGeneralSettings()); } | useWrapper |
22,209 | Transformer (@NotNull Project project) { List<RemotePathTransformerFactory> transformers = MAVEN_REMOTE_PATH_TRANSFORMER_EP_NAME.getExtensionList(); List<RemotePathTransformerFactory> aTransformers = ContainerUtil.filter(transformers, factory -> factory.isApplicable(project)); if (aTransformers.size() > 1) { Logger.getInstance(RemotePathTransformerFactory.class).warn("More than one RemotePathTransformer is applicable: " + aTransformers); } return aTransformers.isEmpty() ? Transformer.ID : aTransformers.get(0).createTransformer(project); } | createForProject |
22,210 | boolean (String s) { return false; } | canBeRemotePath |
22,211 | MavenServerProgressIndicator (final MavenProgressIndicator indicator) { return doWrapAndExport(new RemoteMavenServerProgressIndicator(indicator)); } | wrapAndExport |
22,212 | void (@NlsContexts.ProgressText String text) { myProcess.setText(text); } | setText |
22,213 | void (@NlsContexts.ProgressDetails String text) { myProcess.setText2(text); } | setText2 |
22,214 | boolean () { return myProcess.isCanceled(); } | isCanceled |
22,215 | void (boolean value) { myProcess.getIndicator().setIndeterminate(value); } | setIndeterminate |
22,216 | void (double fraction) { myProcess.setFraction(fraction); } | setFraction |
22,217 | MavenRemoteProcessSupport (Sdk jdk, String vmOptions, MavenDistribution distribution, Project project, Integer debugPort) { MavenActionsUsagesCollector.trigger(project, MavenActionsUsagesCollector.START_LOCAL_MAVEN_SERVER); return new LocalMavenServerRemoteProcessSupport(jdk, vmOptions, distribution, project, debugPort); } | create |
22,218 | MavenRemoteProcessSupport (Sdk jdk, String vmOptions, MavenDistribution distribution, Integer debugPort) { return new LocalMavenIndexServerRemoteProcessSupport(jdk, vmOptions, distribution, debugPort); } | createIndexerSupport |
22,219 | boolean (Project project) { return false; } | isApplicable |
22,220 | boolean () { return false; } | shouldLogErrors |
22,221 | boolean () { return !myConnectStarted.get(); } | isNew |
22,222 | void () { if (!myConnectStarted.compareAndSet(false, true)) { return; } MavenLog.LOG.debug("connecting new maven server: " + this); ApplicationManager.getApplication().executeOnPooledThread(newStartServerTask()); } | connect |
22,223 | MavenServer () { while (!myServerPromise.isDone()) { try { myServerPromise.get(100, TimeUnit.MILLISECONDS); } catch (Exception ignore) { } if (throwExceptionIfProjectDisposed && myProject.isDisposed()) { throw new CannotStartServerException("Project already disposed"); } ProgressManager.checkCanceled(); } return myServerPromise.get(); } | waitForServer |
22,224 | MavenServer () { try { MavenServer server = waitForServer(); if (server == null) { throw new ProcessCanceledException(); } return server; } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { try { MavenServerManager.getInstance().shutdownConnector(this, false); } catch (Throwable ignored) { } throw e instanceof CannotStartServerException ? (CannotStartServerException)e : new CannotStartServerException(e); } } | getServer |
22,225 | void (boolean wait) { MavenLog.LOG.debug("[connector] shutdown " + this + " " + (mySupport == null)); cleanUpFutures(); MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; if (support != null) { support.stopAll(wait); } myTerminated.set(true); } | stop |
22,226 | State () { return switch (myServerPromise.getState()) { case SUCCEEDED -> myTerminated.get() ? State.STOPPED : State.RUNNING; case REJECTED -> State.FAILED; default -> State.STARTING; }; } | getState |
22,227 | boolean () { MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; return support != null && !support.getActiveConfigurations().isEmpty(); } | checkConnected |
22,228 | boolean () { try { boolean pinged = getServer().ping(MavenRemoteObjectWrapper.ourToken); if (MavenLog.LOG.isTraceEnabled()) { MavenLog.LOG.trace("maven server ping: " + pinged); } return pinged; } catch (RemoteException e) { MavenLog.LOG.warn("maven server ping error", e); return false; } } | ping |
22,229 | MavenRemoteProcessSupportFactory (@NotNull Project project) { MavenRemoteProcessSupportFactory applicable = MAVEN_SERVER_SUPPORT_EP_NAME.findFirstSafe(factory -> factory.isApplicable(project)); if (applicable == null) { return new LocalMavenRemoteProcessSupportFactory(); } return applicable; } | forProject |
22,230 | MavenRemoteProcessSupportFactory () { return new LocalMavenRemoteProcessSupportFactory(); } | forIndexer |
22,231 | void () { } | fireModificationCountChanged |
22,232 | String (@NotNull Object file) { return MavenServerManager.class.getSimpleName(); } | getName |
22,233 | void (ProcessHandler handler) { if (handler.getProcessInput() == null) { return; } OutputStreamWriter writer = new OutputStreamWriter(handler.getProcessInput(), StandardCharsets.UTF_8); try { writer.write(TokenReader.PREFIX + MavenRemoteObjectWrapper.ourToken); writer.write(System.lineSeparator()); writer.flush(); MavenLog.LOG.info("Sent token to maven server"); } catch (IOException e) { MavenLog.LOG.warn("Cannot send token to maven server", e); } } | sendDataAfterStart |
22,234 | void (Consumer<ProcessEvent> onTerminate) { this.onTerminate = onTerminate; } | onTerminate |
22,235 | void (ProcessEvent event) { Consumer<ProcessEvent> eventConsumer = onTerminate; if (eventConsumer != null) { eventConsumer.accept(event); } if (event.getExitCode() == 0) { return; } myImportEventProcessor.finish(); Project[] openProjects = ProjectManager.getInstance().getOpenProjects(); for (Project p : openProjects) { ReadAction.run(() -> { if (p.isDisposed()) { return; } MavenProjectsManager manager = MavenProjectsManager.getInstance(p); if (!manager.isMavenizedProject()) { return; } manager.terminateImport(event.getExitCode()); }); } } | onProcessTerminated |
22,236 | void (@NotNull Object configuration, @NotNull ProcessEvent event, @NotNull Key outputType) { super.logText(configuration, event, outputType); myMavenSpyEventsBuffer.addText(event.getText(), outputType); } | logText |
22,237 | void () { if (myParent != null) myParent.onWrappeeAccessed(); } | onWrappeeAccessed |
22,238 | boolean (Sdk jdk, String vmOptions, MavenDistribution distribution) { throw new UnsupportedOperationException(); } | isCompatibleWith |
22,239 | StartIndexingServerTask () { return new StartIndexingServerTask(); } | newStartServerTask |
22,240 | void () { } | cleanUpFutures |
22,241 | String () { MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; return support == null ? "INDEX-?" : "INDEX-" + support.type(); } | getSupportType |
22,242 | void () { ProgressIndicator indicator = new EmptyProgressIndicator(); String dirForLogs = myMultimoduleDirectories.iterator().next(); MavenLog.LOG.debug("Connecting maven connector in " + dirForLogs); try { if (myDebugPort != null) { //noinspection UseOfSystemOutOrSystemErr System.out.println("Listening for transport dt_socket at address: " + myDebugPort); } MavenRemoteProcessSupportFactory factory = MavenRemoteProcessSupportFactory.forIndexer(); mySupport = factory.createIndexerSupport(myJdk, myVmOptions, myDistribution, myDebugPort); mySupport.onTerminate(e -> { MavenLog.LOG.debug("[connector] terminate " + MavenIndexingConnectorImpl.this); MavenServerManager.getInstance().shutdownConnector(MavenIndexingConnectorImpl.this, false); }); // Maven server's lifetime is bigger than the activity that spawned it, so we let it go untracked try (AccessToken ignored = ThreadContext.resetThreadContext()) { MavenServer server = mySupport.acquire(this, "", indicator); myServerPromise.setResult(server); } MavenLog.LOG.debug("[connector] in " + dirForLogs + " has been connected " + MavenIndexingConnectorImpl.this); } catch (Throwable e) { MavenLog.LOG.warn("[connector] cannot connect in " + dirForLogs, e); myServerPromise.setError(e); } } | run |
22,243 | MavenServerManager () { return ApplicationManager.getApplication().getService(MavenServerManager.class); } | getInstance |
22,244 | MavenServerManager () { return ApplicationManager.getApplication().getServiceIfCreated(MavenServerManager.class); } | getInstanceIfCreated |
22,245 | MavenServerConnector (@NotNull Project project, @NotNull Sdk jdk, @NotNull String vmOptions, @Nullable Integer debugPort, @NotNull MavenDistribution mavenDistribution, @NotNull String multimoduleDirectory) { return new MavenServerConnectorImpl(project, jdk, vmOptions, debugPort, mavenDistribution, multimoduleDirectory); } | create |
22,246 | void (@NotNull Project project, @Nullable String workingDir) { checkOrInstall(project, workingDir, null); } | checkOrInstall |
22,247 | void (@NotNull Project project, @Nullable String workingDir) { checkOrInstall(project, workingDir, MavenProjectsManager.getInstance(project).getSyncConsole()); } | checkOrInstallForSync |
22,248 | void (@NotNull ProgressIndicator indicator) { } | run |
22,249 | void (String text) { super.setText(text); if (mySyncConsole != null && text != null) { mySyncConsole.addWrapperProgressText(text); } } | setText |
22,250 | void (double fraction) { super.setFraction(fraction); if (mySyncConsole != null) { long newFraction = Math.round(fraction * 100); if (myFraction == newFraction) return; myFraction = newFraction; ProgressBuildEventImpl event = new ProgressBuildEventImpl( SyncBundle.message("maven.sync.wrapper"), SyncBundle.message("maven.sync.wrapper"), System.currentTimeMillis(), SyncBundle.message("maven.sync.wrapper.downloading.progress", myFraction, 100), 100, myFraction, "%"); mySyncConsole.addBuildEvent(event); } } | setFraction |
22,251 | void (boolean isRestart) { shutdown(false); } | appWillBeClosed |
22,252 | void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { if (MavenUtil.INTELLIJ_PLUGIN_ID.equals(pluginDescriptor.getPluginId().getIdString())) { shutdown(false); } } | beforePluginUnload |
22,253 | void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { MavenUtil.restartMavenConnectors(project, true, it -> isDummy(it)); } } | onProjectTrusted |
22,254 | void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { MavenUtil.restartMavenConnectors(project, true, it -> !isDummy(it)); } } | onProjectUntrusted |
22,255 | void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { manager.forceUpdateAllProjectsOrFindAllAvailablePomFiles(); } } | onProjectTrustedFromNotification |
22,256 | Collection<MavenServerConnector> () { Set<MavenServerConnector> set = Collections.newSetFromMap(new IdentityHashMap<>()); synchronized (myMultimoduleDirToConnectorMap) { set.addAll(myMultimoduleDirToConnectorMap.values()); if (myIndexingConnector != null) { set.add(myIndexingConnector); } } return set; } | getAllConnectors |
22,257 | void (Project project, boolean wait, Predicate<MavenServerConnector> condition) { List<MavenServerConnector> connectorsToShutDown = new ArrayList<>(); synchronized (myMultimoduleDirToConnectorMap) { getAllConnectors().forEach(it -> { if (project.equals(it.getProject()) && condition.test(it)) { connectorsToShutDown.add(removeConnector(it)); } }); } MavenProjectsManager.getInstance(project).getEmbeddersManager().reset(); MavenServerManagerEx.stopConnectors(project, wait, connectorsToShutDown); } | restartMavenConnectors |
22,258 | MavenServerConnector (@NotNull Project project, @NotNull String workingDirectory) { String multimoduleDirectory = MavenDistributionsCache.getInstance(project).getMultimoduleDirectory(workingDirectory); MavenWorkspaceSettings settings = MavenWorkspaceSettingsComponent.getInstance(project).getSettings(); Sdk jdk = getJdk(project, settings); MavenServerConnector connector = doGetOrCreateConnector(project, multimoduleDirectory, jdk); if (connector.isNew()) { connector.connect(); } else { if (!compatibleParameters(project, connector, jdk, multimoduleDirectory)) { MavenLog.LOG.info("[connector] " + connector + " is incompatible, restarting"); shutdownConnector(connector, false); connector = this.doGetOrCreateConnector(project, multimoduleDirectory, jdk); connector.connect(); } } if (MavenLog.LOG.isTraceEnabled()) { MavenLog.LOG.trace("[connector] get " + connector); } return connector; } | doGetConnector |
22,259 | MavenServerConnector (@NotNull Project project, @NotNull String workingDirectory) { var connector = doGetConnector(project, workingDirectory); if (!connector.ping()) { shutdownConnector(connector, true); connector = doGetConnector(project, workingDirectory); } return connector; } | getConnector |
22,260 | MavenServerConnector (@NotNull Project project, @NotNull String multimoduleDirectory, @NotNull Sdk jdk) { MavenServerConnector connector; synchronized (myMultimoduleDirToConnectorMap) { connector = myMultimoduleDirToConnectorMap.get(multimoduleDirectory); if (connector != null) return connector; connector = findCompatibleConnector(project, jdk, multimoduleDirectory); if (connector != null) { MavenLog.LOG.debug("[connector] use existing connector for " + connector); connector.addMultimoduleDir(multimoduleDirectory); } else { connector = registerNewConnector(project, jdk, multimoduleDirectory); } myMultimoduleDirToConnectorMap.put(multimoduleDirectory, connector); } return connector; } | doGetOrCreateConnector |
22,261 | MavenServerConnector (Project project, Sdk jdk, String multimoduleDirectory) { MavenDistribution distribution = MavenDistributionsCache.getInstance(project).getMavenDistribution(multimoduleDirectory); String vmOptions = MavenDistributionsCache.getInstance(project).getVmOptions(multimoduleDirectory); Integer debugPort = getFreeDebugPort(); MavenServerConnector connector; if (TrustedProjects.isTrusted(project) || project.isDefault()) { var connectorFactory = ApplicationManager.getApplication().getService(MavenServerConnectorFactory.class); connector = connectorFactory.create(project, jdk, vmOptions, debugPort, distribution, multimoduleDirectory); MavenLog.LOG.debug("[connector] new maven connector " + connector); } else { MavenLog.LOG.warn("Project " + project + " not trusted enough. Will not start maven for it"); connector = new DummyMavenServerConnector(project, jdk, vmOptions, distribution, multimoduleDirectory); } registerDisposable(project, connector); return connector; } | registerNewConnector |
22,262 | void (Project project, MavenServerConnector connector) { Disposer.register(MavenDisposable.getInstance(project), () -> { ApplicationManager.getApplication().executeOnPooledThread(() -> shutdownConnector(connector, false)); }); } | registerDisposable |
22,263 | void () { shutdown(false); } | dispose |
22,264 | boolean (MavenServerConnector connector, boolean wait) { MavenServerConnector connectorToStop = removeConnector(connector); if (connectorToStop == null) return false; connectorToStop.stop(wait); return true; } | shutdownConnector |
22,265 | MavenServerConnector (@Nullable MavenServerConnector connector) { if (connector == null) return null; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexingConnector == connector) { myIndexingConnector = null; myIndexerWrapper = null; return connector; } if (!myMultimoduleDirToConnectorMap.containsValue(connector)) { return null; } myMultimoduleDirToConnectorMap.entrySet().removeIf(e -> e.getValue() == connector); } return connector; } | removeConnector |
22,266 | void (boolean wait) { Collection<MavenServerConnector> values; synchronized (myMultimoduleDirToConnectorMap) { values = new ArrayList<>(myMultimoduleDirToConnectorMap.values()); } shutdownConnector(myIndexingConnector, wait); values.forEach(c -> shutdownConnector(c, wait)); } | shutdown |
22,267 | File () { return getEventListenerJar(); } | getMavenEventListener |
22,268 | File () { if (eventListenerJar != null) { return eventListenerJar; } final File pluginFileOrDir = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); final String root = pluginFileOrDir.getParent(); if (pluginFileOrDir.isDirectory()) { eventListenerJar = getEventSpyPathForLocalBuild(); if (!eventListenerJar.exists()) { MavenLog.LOG.warn(""" Event listener does not exist: Please run rebuild for maven modules: community/plugins/maven/maven-event-listener""" ); } } else { eventListenerJar = new File(root, "maven-event-listener.jar"); if (!eventListenerJar.exists()) { MavenLog.LOG.warn("Event listener does not exist at " + eventListenerJar + ". It should be built as part of plugin layout process and bundled along with maven plugin jars"); } } return eventListenerJar; } | getEventListenerJar |
22,269 | MavenEmbedderWrapper (final Project project, final boolean alwaysOnline, @NotNull String multiModuleProjectDirectory) { return new MavenEmbedderWrapper(project) { private MavenServerConnector myConnector; @NotNull @Override protected synchronized MavenServerEmbedder create() throws RemoteException { MavenServerSettings settings = convertSettings(project, MavenProjectsManager.getInstance(project).getGeneralSettings(), multiModuleProjectDirectory); if (alwaysOnline && settings.isOffline()) { settings = settings.clone(); settings.setOffline(false); } RemotePathTransformerFactory.Transformer transformer = RemotePathTransformerFactory.createForProject(project); String sdkPath = MavenUtil.getSdkPath(ProjectRootManager.getInstance(project).getProjectSdk()); if (sdkPath != null) { sdkPath = transformer.toRemotePath(sdkPath); } settings.setProjectJdk(sdkPath); var forceResolveDependenciesSequentially = Registry.is("maven.server.force.resolve.dependencies.sequentially"); var useCustomDependenciesResolver = Registry.is("maven.server.use.custom.dependencies.resolver"); myConnector = MavenServerManagerImpl.this.getConnector(project, multiModuleProjectDirectory); return myConnector.createEmbedder(new MavenEmbedderSettings( settings, transformer.toRemotePath(multiModuleProjectDirectory), forceResolveDependenciesSequentially, useCustomDependenciesResolver )); } @Override protected synchronized void cleanup() { super.cleanup(); if (myConnector != null) { shutdownConnector(myConnector, false); } } }; } | createEmbedder |
22,270 | MavenIndexerWrapper () { return createDedicatedIndexer(); } | createIndexer |
22,271 | MavenIndexerWrapper (@NotNull Project project) { if (Registry.is("maven.dedicated.indexer")) { return createDedicatedIndexer(); } else { return createLegacyIndexer(project); } } | createIndexer |
22,272 | MavenIndexerWrapper () { if (myIndexerWrapper != null) return myIndexerWrapper; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexerWrapper != null) return myIndexerWrapper; String workingDir = SystemUtils.getUserHome().getAbsolutePath(); myIndexerWrapper = new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } @Override protected @NotNull MavenServerIndexer create() throws RemoteException { MavenServerConnector indexingConnector = getIndexingConnector(); return indexingConnector.createIndexer(); } @Override protected synchronized void handleRemoteError(RemoteException e) { super.handleRemoteError(e); if (waitIfNotIdeaShutdown()) { MavenIndexingConnectorImpl indexingConnector = myIndexingConnector; if (indexingConnector != null && !indexingConnector.checkConnected()) { shutdownConnector(indexingConnector, true); } } } private MavenServerConnector getIndexingConnector() { if (myIndexingConnector != null) return myIndexingConnector; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexingConnector != null) return myIndexingConnector; myIndexingConnector = new MavenIndexingConnectorImpl(JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(), "", getFreeDebugPort(), MavenDistributionsCache.resolveEmbeddedMavenHome(), workingDir); myIndexingConnector.connect(); } return myIndexingConnector; } private static boolean waitIfNotIdeaShutdown() { try { Thread.sleep(100); return true; } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } return false; } }; } return myIndexerWrapper; } | createDedicatedIndexer |
22,273 | MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } | createMavenIndices |
22,274 | MavenServerConnector () { if (myIndexingConnector != null) return myIndexingConnector; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexingConnector != null) return myIndexingConnector; myIndexingConnector = new MavenIndexingConnectorImpl(JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(), "", getFreeDebugPort(), MavenDistributionsCache.resolveEmbeddedMavenHome(), workingDir); myIndexingConnector.connect(); } return myIndexingConnector; } | getIndexingConnector |
22,275 | boolean () { try { Thread.sleep(100); return true; } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } return false; } | waitIfNotIdeaShutdown |
22,276 | MavenIndexerWrapper (@NotNull Project project) { String path = project.getBasePath(); if (path == null) { path = new File(".").getPath(); } String finalPath = path; if (MavenWslUtil.tryGetWslDistributionForPath(path) != null) { return new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } @Override protected @NotNull MavenServerIndexer create() { return new DummyIndexer(); } }; } return new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } @NotNull @Override protected MavenServerIndexer create() throws RemoteException { MavenServerConnector connector; synchronized (myMultimoduleDirToConnectorMap) { connector = ContainerUtil.find(myMultimoduleDirToConnectorMap.values(), c -> ContainerUtil.find( c.getMultimoduleDirectories(), mDir -> FileUtil .isAncestor(finalPath, mDir, false)) != null ); } if (connector != null) { return connector.createIndexer(); } String workingDirectory = ObjectUtils.chooseNotNull(project.getBasePath(), SystemUtils.getUserHome().getAbsolutePath()); return MavenServerManagerImpl.this.getConnector(project, workingDirectory).createIndexer(); } }; } | createLegacyIndexer |
22,277 | MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } | createMavenIndices |
22,278 | MavenServerIndexer () { return new DummyIndexer(); } | create |
22,279 | MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; } | createMavenIndices |
22,280 | Integer () { if (Registry.is("maven.server.debug")) { try { return NetUtils.findAvailableSocketPort(); } catch (IOException e) { MavenLog.LOG.warn(e); } } return null; } | getFreeDebugPort |
22,281 | Sdk (Project project, MavenWorkspaceSettings settings) { String jdkForImporterName = settings.getImportingSettings().getJdkForImporter(); Sdk jdk; try { jdk = MavenUtil.getJdk(project, jdkForImporterName); } catch (ExternalSystemJdkException e) { jdk = MavenUtil.getJdk(project, MavenRunnerSettings.USE_PROJECT_JDK); MavenProjectsManager.getInstance(project).getSyncConsole().addWarning(SyncBundle.message("importing.jdk.changed"), SyncBundle.message("importing.jdk.changed.description", jdkForImporterName, jdk.getName()) ); } if (JavaSdkVersionUtil.isAtLeast(jdk, JavaSdkVersion.JDK_1_8)) { return jdk; } else { MavenLog.LOG.info("Selected jdk [" + jdk.getName() + "] is not JDK1.8+ Will use internal jdk instead"); return JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(); } } | getJdk |
22,282 | boolean (Project project, MavenServerConnector connector, Sdk jdk, String multimoduleDirectory) { if (Registry.is("maven.server.per.idea.project")) return true; MavenDistributionsCache cache = MavenDistributionsCache.getInstance(project); MavenDistribution distribution = cache.getMavenDistribution(multimoduleDirectory); String vmOptions = cache.getVmOptions(multimoduleDirectory); return connector.isCompatibleWith(jdk, vmOptions, distribution); } | compatibleParameters |
22,283 | File () { final File root = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); return new File(root.getParent(), "intellij.maven.server.eventListener"); } | getEventSpyPathForLocalBuild |
22,284 | MavenServerSettings (@NotNull Project project, @Nullable MavenGeneralSettings settings, @NotNull String multiModuleProjectDirectory) { if (settings == null) { settings = MavenWorkspaceSettingsComponent.getInstance(project).getSettings().getGeneralSettings(); } RemotePathTransformerFactory.Transformer transformer = RemotePathTransformerFactory.createForProject(project); MavenServerSettings result = new MavenServerSettings(); result.setLoggingLevel(settings.getOutputLevel().getLevel()); result.setOffline(settings.isWorkOffline()); result.setUpdateSnapshots(settings.isAlwaysUpdateSnapshots()); MavenDistribution mavenDistribution = MavenDistributionsCache.getInstance(project).getMavenDistribution(multiModuleProjectDirectory); String remotePath = transformer.toRemotePath(mavenDistribution.getMavenHome().toString()); result.setMavenHomePath(remotePath); File userSettings = MavenWslUtil.getUserSettings(project, settings.getUserSettingsFile(), settings.getMavenConfig()); String userSettingsPath = userSettings.toPath().toAbsolutePath().toString(); result.setUserSettingsPath(transformer.toRemotePath(userSettingsPath)); String localRepository = MavenWslUtil.getLocalRepo(project, settings.getLocalRepository(), new MavenInSpecificPath(mavenDistribution.getMavenHome().toFile()), settings.getUserSettingsFile(), settings.getMavenConfig()).getAbsolutePath(); result.setLocalRepositoryPath(transformer.toRemotePath(localRepository)); File file = getGlobalConfigFromMavenConfig(project, settings, transformer); if (file == null) { file = MavenUtil.resolveGlobalSettingsFile(mavenDistribution.getMavenHome().toFile()); } result.setGlobalSettingsPath(transformer.toRemotePath(file.getAbsolutePath())); return result; } | convertSettings |
22,285 | String () { return SyncBundle.message("maven.core.plexus.init.issue.title"); } | getTitle |
22,286 | String () { StringBuilder desc = new StringBuilder(SyncBundle.message("maven.core.plexus.init.issue.description")); if (myMavenVersion == null || VersionComparatorUtil.compare("3.8.5", myMavenVersion) <= 0) { desc.append("\n").append(SyncBundle.message("maven.core.plexus.init.issue.fix.downgrade", OpenMavenSettingsQuickFix.ID)); } desc.append("\n").append(SyncBundle.message("maven.core.plexus.init.issue.fix.remove", RestartMavenEmbeddersQuickFix.ID)); desc.append("\n\n\n").append(SyncBundle.message("maven.core.plexus.init.issue.description.exception")); desc.append("\n").append(myMessage); return desc.toString(); //NON-NLS } | getDescription |
22,287 | List<BuildIssueQuickFix> () { return List.of( new RestartMavenEmbeddersQuickFix(), new OpenMavenSettingsQuickFix() ); } | getQuickFixes |
22,288 | Navigatable (@NotNull Project project) { for (String directory : myMultimoduleDirectories) { Path extensions = Path.of(directory).resolve(".mvn").resolve("extensions.xml"); if (!extensions.toFile().isFile()) continue; if (MavenUtil.containsDeclaredExtension(extensions.toFile(), myUnresolvedExtensionId)) { return new FileNavigatable(project, new FilePosition(extensions.toFile(), 0, 0)); } } return null; } | getNavigatable |
22,289 | RunProfileState (@NotNull Object target, @NotNull Object configuration, @NotNull Executor executor) { return new MavenServerCMDState(myJdk, myOptions, myDistribution, myDebugPort); } | getRunProfileState |
22,290 | String () { return "Local"; } | type |
22,291 | boolean () { return true; } | shouldKillProcessSoftly |
22,292 | boolean (@Nullable File mavenHome) { String version = MavenUtil.getMavenVersion(mavenHome); return StringUtil.compareVersionNumbers(version, "4") >= 0; } | isSupportedByExtension |
22,293 | List<File> (@NotNull MavenDistribution distribution) { final File pluginFileOrDir = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); final String root = pluginFileOrDir.getParent(); final List<File> classpath = new ArrayList<>(); if (pluginFileOrDir.isDirectory()) { MavenLog.LOG.debug("collecting classpath for local run"); prepareClassPathForLocalRunAndUnitTests(distribution.getVersion(), classpath, root); } else { MavenLog.LOG.debug("collecting classpath for production"); prepareClassPathForProduction(distribution.getVersion(), classpath, root); } addMavenLibs(classpath, distribution.getMavenHome().toFile()); MavenLog.LOG.debug("Collected classpath = ", classpath); return classpath; } | collectClassPathAndLibsFolder |
22,294 | void (@NotNull String mavenVersion, List<File> classpath, String root) { classpath.add(new File(PathUtil.getJarPathForClass(MavenId.class))); classpath.add(new File(PathUtil.getJarPathForClass(MavenServer.class))); addDir(classpath, new File(root, "maven4-server-lib"), f -> true); classpath.add(new File(root, "maven40-server.jar")); } | prepareClassPathForProduction |
22,295 | void (@NotNull String mavenVersion, List<File> classpath, String root) { BuildDependenciesCommunityRoot communityRoot = new BuildDependenciesCommunityRoot(Path.of(PathManager.getCommunityHomePath())); BundledMavenDownloader.INSTANCE.downloadMaven4LibsSync(communityRoot); classpath.add(new File(PathUtil.getJarPathForClass(MavenId.class))); classpath.add(new File(root, "intellij.maven.server")); File parentFile = MavenUtil.getMavenPluginParentFile(); addDir(classpath, new File(parentFile, "maven40-server-impl/lib"), f -> true); classpath.add(new File(root, "intellij.maven.server.m40")); } | prepareClassPathForLocalRunAndUnitTests |
22,296 | void (List<File> classpath, File mavenHome) { addDir(classpath, new File(mavenHome, "lib"), f -> !f.getName().contains("maven-slf4j-provider")); File bootFolder = new File(mavenHome, "boot"); File[] classworldsJars = bootFolder.listFiles((dir, name) -> StringUtil.contains(name, "classworlds")); if (classworldsJars != null) { Collections.addAll(classpath, classworldsJars); } } | addMavenLibs |
22,297 | void (List<File> classpath, File dir, Predicate<File> filter) { File[] files = dir.listFiles(); if (files == null) return; for (File jar : files) { if (jar.isFile() && jar.getName().endsWith(".jar") && filter.test(jar)) { classpath.add(jar); } } } | addDir |
22,298 | String () { return MavenProjectBundle.message("maven.name"); } | getName |
22,299 | Icon () { return OpenapiIcons.RepositoryLibraryLogo; } | getIcon |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.