diff --git a/.github/toolchains.xml b/.github/toolchains.xml index fec0bc56..24237215 100644 --- a/.github/toolchains.xml +++ b/.github/toolchains.xml @@ -2,7 +2,7 @@ - + jdk diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index c89e3b50..ef21bb74 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -5,21 +5,26 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: | 8 11 17 + 21 distribution: 'temurin' cache: 'maven' # - name: Build with Maven # run: xvfb-run mvn clean verify -Dtycho.localArtifacts=ignore + - name: Set up Maven + uses: stCarolas/setup-maven@v5 + with: + maven-version: 3.9.9 - name: Build with Maven env: - JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} + JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }} run: | cp .github/toolchains.xml ~/.m2/toolchains.xml xvfb-run mvn clean verify @@ -29,7 +34,7 @@ jobs: # run: mvn -V -B verify # - name: Run GUI Tests # env: - # JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} + # JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }} # uses: coactions/setup-xvfb@v1 # with: # run: mvn --batch-mode verify diff --git a/org.eclipse.virgo.ide.bundlor.core/META-INF/MANIFEST.MF b/org.eclipse.virgo.ide.bundlor.core/META-INF/MANIFEST.MF index 5579e576..db61b6c7 100644 --- a/org.eclipse.virgo.ide.bundlor.core/META-INF/MANIFEST.MF +++ b/org.eclipse.virgo.ide.bundlor.core/META-INF/MANIFEST.MF @@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.m2e.maven.runtime;bundle-version="1.0.0";resolution:=optional Import-Package: org.apache.commons.lang;version="2.4.0", org.apache.commons.logging -Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.eclipse.virgo.ide.bundlor.internal.core +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/.classpath b/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/.classpath index 5ed6c91d..4308e3ed 100644 --- a/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/.classpath +++ b/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/.classpath @@ -2,7 +2,7 @@ - + diff --git a/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/template.mf b/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/template.mf index cc88c7ba..95d112b5 100644 --- a/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/template.mf +++ b/org.eclipse.virgo.ide.export.tests/workspace/bundlor-test/template.mf @@ -4,4 +4,5 @@ Bundle-ManifestVersion: 2 Bundle-SymbolicName: com.springsource.bundlor Bundle-Version: 1.0.0 Spring-Context: META-INF/spring/*.xml +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Template: org.springframework.*;version="[2.5.6.A,2.6.0)" diff --git a/org.eclipse.virgo.ide.feature/feature.xml b/org.eclipse.virgo.ide.feature/feature.xml index a91fb5ec..b6fee505 100644 --- a/org.eclipse.virgo.ide.feature/feature.xml +++ b/org.eclipse.virgo.ide.feature/feature.xml @@ -338,4 +338,18 @@ version="0.0.0" unpack="false"/> + + + + diff --git a/org.eclipse.virgo.ide.management.remote/META-INF/MANIFEST.MF b/org.eclipse.virgo.ide.management.remote/META-INF/MANIFEST.MF index a6534a54..17c4f143 100644 --- a/org.eclipse.virgo.ide.management.remote/META-INF/MANIFEST.MF +++ b/org.eclipse.virgo.ide.management.remote/META-INF/MANIFEST.MF @@ -18,4 +18,3 @@ Import-Package: org.eclipse.gemini.blueprint;resolution:=optional, Require-Bundle: org.apache.felix.gogo.runtime;bundle-version="[0.10.0,1.0.0)";resolution:=optional Bundle-Vendor: Eclipse.org - Virgo Export-Package: org.eclipse.virgo.ide.management.remote -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/org.eclipse.virgo.ide.management.remote/README.TXT b/org.eclipse.virgo.ide.management.remote/README.TXT index f52a8147..d32a462b 100644 --- a/org.eclipse.virgo.ide.management.remote/README.TXT +++ b/org.eclipse.virgo.ide.management.remote/README.TXT @@ -31,7 +31,11 @@ Important attention points: in Virgo, not in Eclipse - the execution environment of this bundle and the Java level must remain the same as Virgo Server or lower, otherwise - the Jar won't be resolved in Virgo at runtime. + the Jar won't be resolved in Virgo at runtime. As of Eclipse 2024-12 + JavaSE7 is no more supported for compiling. Virgo can run with Java8 + but declares to support only JavaSE7, as such I am removing the + execution environment header from MANIFEST.MF to make this bundle + deployable and runnable in Virgo - Virgo still ships with a very dated version of Felix Gogo Shell and Eclipse 2022 and later includes a newer version of the same. One of the methods that the JMX bridge uses to execute shell commands diff --git a/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/Helper.java b/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/Helper.java index 3bfafc41..5b0f79ba 100644 --- a/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/Helper.java +++ b/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/Helper.java @@ -182,7 +182,7 @@ private static java.util.List getEntries(IProject project) throws CoreEx * @throws CoreException */ /* package */ static IPath getOutputLocation(IProject project) throws CoreException { - IJavaProject jp = (IJavaProject) project.getNature(JavaCore.NATURE_ID); + IJavaProject jp = JavaCore.create(project); IPath outputLocation = jp.getOutputLocation(); if (outputLocation == null) { diff --git a/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/cmd/SetupProjectOperation.java b/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/cmd/SetupProjectOperation.java index aadab6f3..23c51d8b 100644 --- a/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/cmd/SetupProjectOperation.java +++ b/org.eclipse.virgo.ide.pde.core/src/org/eclipse/virgo/ide/pde/core/internal/cmd/SetupProjectOperation.java @@ -121,6 +121,10 @@ public void run(IProgressMonitor monitor) throws CoreException { addNatures(project); monitor.worked(1); + IBundleProjectDescription bundleDescription = service.getDescription(project); + // remove execution environment + bundleDescription.setExecutionEnvironments(new String[0]); + if (contextRoot != null && contextRoot.length() > 0) { IPath webContentPath = configureWABClasspath(project); @@ -129,18 +133,17 @@ public void run(IProgressMonitor monitor) throws CoreException { createIndexHTML(contextRoot, webContentPath); createBuildProperties(); - IBundleProjectDescription bundleDescription = service.getDescription(project); - bundleDescription.setHeader(HEADER_WEB_CONTEXT_PATH, SLASH + contextRoot); bundleDescription.setHeader(HEADER_BUNDLE_CLASS_PATH, CLASS_PATH_VALUE); - bundleDescription.apply(null); } + bundleDescription.apply(null); monitor.worked(1); IFacetedProject fProject = ProjectFacetsManager.create(project.getProject(), true, null); fProject.installProjectFacet(ProjectFacetsManager.getProjectFacet(FacetCorePlugin.BUNDLE_FACET_ID).getDefaultVersion(), null, null); monitor.worked(1); monitor.done(); + } private void createBuildProperties() throws CoreException { @@ -195,7 +198,7 @@ private void createFileFromTemplate(String contextRoot, IPath webContentPath, St } private IPath configureWABClasspath(IProject project) throws CoreException, JavaModelException { - IJavaProject javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID); + IJavaProject javaProject = JavaCore.create(project); javaProject.setOutputLocation(project.getFullPath().append(BIN), null); IClasspathEntry[] entries = javaProject.getRawClasspath(); IClasspathEntry[] newEntries = new IClasspathEntry[entries.length + 1]; diff --git a/org.eclipse.virgo.ide.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.virgo.ide.ui.tests/META-INF/MANIFEST.MF index 5a61491a..99d2fb8b 100644 --- a/org.eclipse.virgo.ide.ui.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.virgo.ide.ui.tests/META-INF/MANIFEST.MF @@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.core.filesystem, org.eclipse.swtbot.swt.finder, org.eclipse.virgo.ide.tests.util, org.eclipse.virgo.ide.runtime.core, - org.hamcrest.core;bundle-version="[1.3.0,2.0.0)", + org.hamcrest.core, slf4j.api Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-17 diff --git a/org.eclipse.virgo.ide.ui.tests/src/org/eclipse/virgo/ide/ui/tests/util/InSection.java b/org.eclipse.virgo.ide.ui.tests/src/org/eclipse/virgo/ide/ui/tests/util/InSection.java index 7d55f198..7a1915ce 100644 --- a/org.eclipse.virgo.ide.ui.tests/src/org/eclipse/virgo/ide/ui/tests/util/InSection.java +++ b/org.eclipse.virgo.ide.ui.tests/src/org/eclipse/virgo/ide/ui/tests/util/InSection.java @@ -20,7 +20,7 @@ import org.eclipse.swtbot.swt.finder.utils.TreePath; import org.eclipse.ui.forms.widgets.Section; import org.hamcrest.Description; -import org.hamcrest.Factory; +//import org.hamcrest.Factory; import org.hamcrest.Matcher; /** @@ -28,12 +28,12 @@ */ public class InSection extends AbstractMatcher { - @Factory + // @Factory public static Matcher inSection(Matcher matcher) { return new InSection(matcher); } - @Factory + // @Factory public static Matcher inSection(String labelText) { return new InSection(labelText); } diff --git a/org.eclipse.virgo.ide.ui/META-INF/MANIFEST.MF b/org.eclipse.virgo.ide.ui/META-INF/MANIFEST.MF index dbcbe33a..9c87deb9 100644 --- a/org.eclipse.virgo.ide.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.virgo.ide.ui/META-INF/MANIFEST.MF @@ -41,7 +41,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.ltk.core.refactoring, org.eclipse.wst.sse.ui.infopop;bundle-version="1.0.300", org.eclipse.virgo.ide.pde.core, - org.eclipse.wst.web + org.eclipse.wst.web, + org.eclipse.ui.genericeditor Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.virgo.ide.internal.ui, diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/AbstractPdeFormTextEditorContributor.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/AbstractPdeFormTextEditorContributor.java index 58e9582d..b7ae6f40 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/AbstractPdeFormTextEditorContributor.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/AbstractPdeFormTextEditorContributor.java @@ -23,7 +23,6 @@ import org.eclipse.jface.action.Separator; import org.eclipse.pde.internal.ui.PDEUIMessages; import org.eclipse.pde.internal.ui.editor.PDEFormEditorContributor; -import org.eclipse.pde.internal.ui.editor.PDEProjectionSourcePage; import org.eclipse.pde.internal.ui.editor.PDESourcePage; import org.eclipse.pde.internal.ui.editor.actions.HyperlinkAction; import org.eclipse.pde.internal.ui.editor.actions.PDEActionConstants; @@ -240,46 +239,47 @@ public void setActivePage(IEditorPart newEditor) { * */ protected void updateQuickOutlineMenuEntry() { - // Get the main action bar - IActionBars actionBars = getActionBars(); - IMenuManager menuManager = actionBars.getMenuManager(); - // Get the navigate menu - IMenuManager navigateMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE); - // Ensure there is a navigate menu - if (navigateMenu == null) { - return; - } - // Remove the previous version of the quick outline menu entry - if - // one exists - // Prevent duplicate menu entries - // Prevent wrong quick outline menu from being brought up for the wrong - // page - navigateMenu.remove(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); - // Ensure the active page is a source page - // Only add the quick outline menu to the source pages - if (this.fPage instanceof PDEProjectionSourcePage == false) { - return; - } - PDEProjectionSourcePage page = (PDEProjectionSourcePage) this.fPage; - // Only add the action if the source page supports it - if (page.isQuickOutlineEnabled() == false) { - return; - } - // Get the appropriate quick outline action associated with the active - // source page - IAction quickOutlineAction = page.getAction(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); - // Ensure it is defined - if (quickOutlineAction == null) { - return; - } - // Add the quick outline action after the "Show In" menu contributed - // by JDT - // This could break if JDT changes the "Show In" menu ID - try { - navigateMenu.insertAfter("showIn", quickOutlineAction); //$NON-NLS-1$ - } catch (IllegalArgumentException e) { - // Ignore - } + // Not possible starting from Eclipse 2024-12 + // // Get the main action bar + // IActionBars actionBars = getActionBars(); + // IMenuManager menuManager = actionBars.getMenuManager(); + // // Get the navigate menu + // IMenuManager navigateMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE); + // // Ensure there is a navigate menu + // if (navigateMenu == null) { + // return; + // } + // // Remove the previous version of the quick outline menu entry - if + // // one exists + // // Prevent duplicate menu entries + // // Prevent wrong quick outline menu from being brought up for the wrong + // // page + // navigateMenu.remove(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); + // // Ensure the active page is a source page + // // Only add the quick outline menu to the source pages + // if (this.fPage instanceof PDEProjectionSourcePage == false) { + // return; + // } + // PDEProjectionSourcePage page = (PDEProjectionSourcePage) this.fPage; + // // Only add the action if the source page supports it + // if (page.isQuickOutlineEnabled() == false) { + // return; + // } + // // Get the appropriate quick outline action associated with the active + // // source page + // IAction quickOutlineAction = page.getAction(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); + // // Ensure it is defined + // if (quickOutlineAction == null) { + // return; + // } + // // Add the quick outline action after the "Show In" menu contributed + // // by JDT + // // This could break if JDT changes the "Show In" menu ID + // try { + // navigateMenu.insertAfter("showIn", quickOutlineAction); //$NON-NLS-1$ + // } catch (IllegalArgumentException e) { + // // Ignore + // } } protected TextEditorActionContributor createSourceContributor() { diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleExecutionEnvironmentSection.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleExecutionEnvironmentSection.java index 1a92ae7d..a62d2ab9 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleExecutionEnvironmentSection.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleExecutionEnvironmentSection.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.environments.IExecutionEnvironment; @@ -119,7 +120,8 @@ public Object[] getElements(Object inputElement) { IBundle bundle = model.getBundle(); IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT); if (header instanceof RequiredExecutionEnvironmentHeader) { - return ((RequiredExecutionEnvironmentHeader) header).getEnvironments(); + RequiredExecutionEnvironmentHeader header2 = (RequiredExecutionEnvironmentHeader) header; + return header2.getEnvironments().toArray(new Object[0]); } } return new Object[0]; @@ -129,7 +131,7 @@ public Object[] getElements(Object inputElement) { public BundleExecutionEnvironmentSection(PDEFormPage page, Composite parent) { super(page, parent, Section.DESCRIPTION, new String[] { PDEUIMessages.RequiredExecutionEnvironmentSection_add, PDEUIMessages.RequiredExecutionEnvironmentSection_remove, - PDEUIMessages.RequiredExecutionEnvironmentSection_up, PDEUIMessages.RequiredExecutionEnvironmentSection_down }); + PDEUIMessages.ManifestEditor_LibrarySection_up, PDEUIMessages.ManifestEditor_LibrarySection_down }); createClient(getSection(), page.getEditor().getToolkit()); } @@ -287,8 +289,11 @@ private void handleRemove() { Iterator iter = ssel.iterator(); while (iter.hasNext()) { Object object = iter.next(); - if (object instanceof ExecutionEnvironment) { - getHeader().removeExecutionEnvironment((ExecutionEnvironment) object); + // if (object instanceof ExecutionEnvironment) { + // getHeader().removeExecutionEnvironment((ExecutionEnvironment) object); + // } + if (object instanceof String) { + getHeader().removeExecutionEnvironment(object.toString()); } } } @@ -329,7 +334,11 @@ private void addExecutionEnvironments(Object[] result) { getBundle().setHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, buffer.toString()); } else { RequiredExecutionEnvironmentHeader ee = (RequiredExecutionEnvironmentHeader) header; - ee.addExecutionEnvironments(result); + List ees = new ArrayList(); + for (Object object : result) { + ees.add(object.toString()); + } + ee.addExecutionEnvironments(ees); } } @@ -349,9 +358,9 @@ private Object[] getEnvironments() { return envs; } ArrayList list = new ArrayList(); - for (int i = 0; i < envs.length; i++) { - if (!header.hasExecutionEnvironment(envs[i])) { - list.add(envs[i]); + for (IExecutionEnvironment env : envs) { + if (!header.getEnvironments().contains(env)) { + list.add(env); } } return list.toArray(); diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleManifestEditor.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleManifestEditor.java index 2c836be4..5ff61aad 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleManifestEditor.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleManifestEditor.java @@ -52,7 +52,6 @@ import org.eclipse.pde.internal.ui.editor.JarEntryFile; import org.eclipse.pde.internal.ui.editor.ModelDataTransfer; import org.eclipse.pde.internal.ui.editor.PDEFormEditor; -import org.eclipse.pde.internal.ui.editor.PDESourcePage; import org.eclipse.pde.internal.ui.editor.context.InputContextManager; import org.eclipse.pde.internal.ui.editor.plugin.BundleInputContext; import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor; @@ -103,8 +102,7 @@ public class BundleManifestEditor extends ManifestEditor { public IEditorPart[] getParts() { ArrayList parts = new ArrayList(getPageCount()); if (this.pages != null) { - for (int i = 0; i < this.pages.size(); i++) { - Object page = this.pages.get(i); + for (Object page : this.pages) { if (page instanceof IEditorPart) { parts.add((IEditorPart) page); } @@ -134,7 +132,7 @@ protected void addEditorPages() { } @Override - protected PDESourcePage createSourcePage(PDEFormEditor editor, String title, String name, String contextId) { + protected IEditorPart createSourcePage(PDEFormEditor editor, String title, String name, String contextId) { if (contextId.equals(BundleInputContext.CONTEXT_ID)) { return new SpringBundleSourcePage(editor, title, name); } @@ -349,7 +347,7 @@ private String getTitleText(IPluginModelBase model) { if (FacetUtils.isParProject(getCommonProject())) { BundleInputContext context = (BundleInputContext) getContextManager().findContext(BundleInputContext.CONTEXT_ID); if (context != null) { - IBundleModel bundleModel = (IBundleModel) context.getModel(); + IBundleModel bundleModel = context.getModel(); if (pref != null && pref.equals(IPreferenceConstants.VALUE_USE_NAMES)) { builder.append(bundleModel.getBundle().getHeader(IHeaderConstants.PAR_NAME)); } diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleOverviewPage.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleOverviewPage.java index d5336547..80f51366 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleOverviewPage.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/BundleOverviewPage.java @@ -11,14 +11,8 @@ package org.eclipse.virgo.ide.ui.editors; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.eclipse.core.resources.ICommand; import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; @@ -43,9 +37,6 @@ import org.eclipse.pde.internal.ui.util.SharedLabelProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTException; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; @@ -60,8 +51,8 @@ import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.forms.widgets.Section; import org.eclipse.ui.forms.widgets.TableWrapData; -import org.eclipse.virgo.ide.bundlor.internal.core.BundlorCorePlugin; -import org.eclipse.virgo.ide.bundlor.ui.BundlorUiPlugin; +//import org.eclipse.virgo.ide.bundlor.internal.core.BundlorCorePlugin; +//import org.eclipse.virgo.ide.bundlor.ui.BundlorUiPlugin; import org.eclipse.virgo.ide.export.BundleExportWizard; import org.eclipse.virgo.ide.jdt.internal.core.classpath.ServerClasspathContainerUpdateJob; import org.eclipse.virgo.ide.manifest.internal.core.BundleManifestManager; @@ -177,58 +168,65 @@ private void createBundleActionSection(IManagedForm managedForm, Composite paren Composite container = createStaticSectionClient(toolkit, section); FormText noteText = createClient(container, - "

OSGi dependency meta data in the MANIFEST.MF file can automatically be updated based on dependencies expressed in source code artifacts.

Java source files, Spring XML configuration, JPA persistence.xml and Hibernate .hbm mapping files will be analysed. The process will create Import-Package and Export-Package headers.

  • Update MANIFEST.MF: automatically generate MANIFEST.MF file based on dependencies in source code artifacts.
  • ", + // "

    OSGi dependency meta data in the MANIFEST.MF file can automatically be updated based on + // dependencies expressed in source code artifacts.

    Java source files, Spring XML configuration, JPA + // persistence.xml and Hibernate .hbm mapping files will be analysed. The process will create Import-Package + // and Export-Package headers.

  • Update MANIFEST.MF: automatically generate MANIFEST.MF file based on dependencies + // in source code artifacts.
  • ", + "

    OSGi dependency meta data in the MANIFEST.MF file can automatically be updated based on dependencies expressed in source code artifacts.

    Java source files, Spring XML configuration, JPA persistence.xml and Hibernate .hbm mapping files will be analysed. The process will create Import-Package and Export-Package headers.

    ", true, toolkit); noteText.setImage("manifest", ServerIdeUiPlugin.getImage("full/obj16/osgi_obj.gif")); //$NON-NLS-1$ noteText.addHyperlinkListener(this); - Button button = toolkit.createButton(container, "Automatically update MANIFEST.MF file in background.", SWT.CHECK); - button.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - IRunnableWithProgress op = new WorkspaceModifyOperation() { - - @Override - protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException { - IProject project = BundleOverviewPage.this.resource.getProject(); - IProjectDescription description = project.getDescription(); - try { - List cmds = Arrays.asList(description.getBuildSpec()); - List newCmds = new ArrayList(cmds); - if (BundlorUiPlugin.isBundlorBuilding(project)) { - for (ICommand config : cmds) { - if (config.getBuilderName().equals(BundlorCorePlugin.BUILDER_ID)) { - newCmds.remove(config); - } - } - } else { - ICommand command = project.getDescription().newCommand(); - command.setBuilderName(BundlorCorePlugin.BUILDER_ID); - newCmds.add(command); - } - if (!cmds.equals(newCmds)) { - description.setBuildSpec(newCmds.toArray(new ICommand[] {})); - project.setDescription(description, monitor); - } - } catch (CoreException e1) { - } - } - }; - try { - PlatformUI.getWorkbench().getProgressService().runInUI(PDEPlugin.getActiveWorkbenchWindow(), op, - PDEPlugin.getWorkspace().getRoot()); - } catch (InvocationTargetException e1) { - } catch (InterruptedException e1) { - } - - } - }); - TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); - data.indent = 5; - button.setLayoutData(data); - boolean building = this.resource != null && BundlorUiPlugin.isBundlorBuilding(this.resource.getProject()); - button.setSelection(building); + // Button button = toolkit.createButton(container, "Automatically update MANIFEST.MF file in background.", + // SWT.CHECK); + // button.addSelectionListener(new SelectionAdapter() { + // + // @Override + // public void widgetSelected(SelectionEvent e) { + // IRunnableWithProgress op = new WorkspaceModifyOperation() { + // + // @Override + // protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException { + // IProject project = BundleOverviewPage.this.resource.getProject(); + // IProjectDescription description = project.getDescription(); + // try { + // List cmds = Arrays.asList(description.getBuildSpec()); + // List newCmds = new ArrayList(cmds); + // if (BundlorUiPlugin.isBundlorBuilding(project)) { + // for (ICommand config : cmds) { + // if (config.getBuilderName().equals(BundlorCorePlugin.BUILDER_ID)) { + // newCmds.remove(config); + // } + // } + // } else { + // ICommand command = project.getDescription().newCommand(); + // command.setBuilderName(BundlorCorePlugin.BUILDER_ID); + // newCmds.add(command); + // } + // if (!cmds.equals(newCmds)) { + // description.setBuildSpec(newCmds.toArray(new ICommand[] {})); + // project.setDescription(description, monitor); + // } + // } catch (CoreException e1) { + // } + // } + // }; + // try { + // PlatformUI.getWorkbench().getProgressService().runInUI(PDEPlugin.getActiveWorkbenchWindow(), op, + // PDEPlugin.getWorkspace().getRoot()); + // } catch (InvocationTargetException e1) { + // } catch (InterruptedException e1) { + // } + // + // } + // }); + // TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); + // data.indent = 5; + // button.setLayoutData(data); + // boolean building = this.resource != null && BundlorUiPlugin.isBundlorBuilding(this.resource.getProject()); + // button.setSelection(building); toolkit.createLabel(container, ""); @@ -290,8 +288,8 @@ protected void execute(IProgressMonitor monitor) throws CoreException, Interrupt } catch (InvocationTargetException e1) { } catch (InterruptedException e1) { } - } else if (e.getHref().equals("generate")) { - BundlorUiPlugin.runBundlorOnProject(JavaCore.create(this.resource.getProject())); + // } else if (e.getHref().equals("generate")) { + // BundlorUiPlugin.runBundlorOnProject(JavaCore.create(this.resource.getProject())); } else if (e.getHref().equals("exportbundle")) { Display.getDefault().asyncExec(new Runnable() { diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/SpringBundleSourcePage.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/SpringBundleSourcePage.java index ede681af..272e1276 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/SpringBundleSourcePage.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/SpringBundleSourcePage.java @@ -12,7 +12,6 @@ import java.util.ArrayList; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.ResourceBundle; @@ -298,7 +297,7 @@ public Object[] getChildren(Object parent) { } else if (parent instanceof ExportPackageHeader) { return ((ExportPackageHeader) parent).getPackages(); } else if (parent instanceof RequiredExecutionEnvironmentHeader) { - return ((RequiredExecutionEnvironmentHeader) parent).getEnvironments(); + return ((RequiredExecutionEnvironmentHeader) parent).getEnvironments().toArray(new Object[0]); } else if (parent instanceof RequireBundleHeader) { return ((RequireBundleHeader) parent).getRequiredBundles(); } else if (parent instanceof BundleClasspathHeader) { @@ -333,8 +332,8 @@ public Object[] getElements(Object parent) { BundleModel model = (BundleModel) parent; Map manifest = ((Bundle) model.getBundle()).getHeaders(); ArrayList keys = new ArrayList(); - for (Iterator elements = manifest.keySet().iterator(); elements.hasNext();) { - IDocumentKey key = (IDocumentKey) manifest.get(elements.next()); + for (Object element : manifest.keySet()) { + IDocumentKey key = (IDocumentKey) manifest.get(element); if (key.getOffset() > -1) { keys.add(key); } diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/AbstractPdeManifestContentAssistProcessor.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/AbstractPdeManifestContentAssistProcessor.java index 6043f8b9..126bbf02 100644 --- a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/AbstractPdeManifestContentAssistProcessor.java +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/AbstractPdeManifestContentAssistProcessor.java @@ -43,7 +43,6 @@ import org.eclipse.pde.core.plugin.PluginRegistry; import org.eclipse.pde.internal.core.ICoreConstants; import org.eclipse.pde.internal.core.ibundle.IBundleModel; -import org.eclipse.pde.internal.core.util.HeaderMap; import org.eclipse.pde.internal.core.util.PDEJavaHelper; import org.eclipse.pde.internal.ui.PDEPluginImages; import org.eclipse.pde.internal.ui.editor.PDEFormEditor; @@ -646,9 +645,9 @@ protected ICompletionProposal[] handleRequiredExecEnv(String currentValue, int o set = new HashSet(0); } int length = currentValue.length(); - for (int i = 0; i < fExecEnvs.length; i++) { - if (fExecEnvs[i].regionMatches(true, 0, currentValue, 0, length) && !set.contains(fExecEnvs[i])) { - completions.add(new BundleTypeCompletionProposal(fExecEnvs[i], getImage(F_TYPE_EXEC_ENV), fExecEnvs[i], offset - length, length)); + for (String fExecEnv : fExecEnvs) { + if (fExecEnv.regionMatches(true, 0, currentValue, 0, length) && !set.contains(fExecEnv)) { + completions.add(new BundleTypeCompletionProposal(fExecEnv, getImage(F_TYPE_EXEC_ENV), fExecEnv, offset - length, length)); } } return (ICompletionProposal[]) completions.toArray(new ICompletionProposal[completions.size()]); @@ -845,9 +844,9 @@ public Image getImage(int type) { } protected void dispose() { - for (int i = 0; i < this.fImages.length; i++) { - if (this.fImages[i] != null && !this.fImages[i].isDisposed()) { - this.fImages[i].dispose(); + for (Image fImage : this.fImages) { + if (fImage != null && !fImage.isDisposed()) { + fImage.dispose(); } } } diff --git a/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/HeaderMap.java b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/HeaderMap.java new file mode 100644 index 00000000..37a07cb5 --- /dev/null +++ b/org.eclipse.virgo.ide.ui/src/org/eclipse/virgo/ide/ui/editors/text/HeaderMap.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2007, 2012 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.virgo.ide.ui.editors.text; + +import java.util.Comparator; +import java.util.TreeMap; + +/** + * + * Designed as a Map to contain Manifest headers and values. Returns the value of a header if it matches (case + * insensitive) to the key. + * + */ +public class HeaderMap extends TreeMap { + + private static final long serialVersionUID = 1L; + + private static class HeaderComparator implements Comparator { + + @Override + public int compare(Object arg0, Object arg1) { + String header0 = (String) arg0; + String header1 = (String) arg1; + return header0.compareToIgnoreCase(header1); + } + } + + public HeaderMap() { + super(new HeaderComparator()); + } + +} \ No newline at end of file diff --git a/org.eclipse.virgo.ide/2024-12-TargetPlatform.target b/org.eclipse.virgo.ide/2024-12-TargetPlatform.target new file mode 100644 index 00000000..5275797a --- /dev/null +++ b/org.eclipse.virgo.ide/2024-12-TargetPlatform.target @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8233eb8e..f6c2456a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -14,7 +15,8 @@ true - 3.0.5 + + 4.0.10 1.1.5 @@ -54,7 +56,7 @@ - + jenkins.eclipse.org @@ -63,8 +65,10 @@ - /home/data/httpd/download.eclipse.org/virgo/snapshot/IDE/drops - /home/data/httpd/download.eclipse.org/virgo/snapshot/IDE + + /home/data/httpd/download.eclipse.org/virgo/snapshot/IDE/drops + + /home/data/httpd/download.eclipse.org/virgo/snapshot/IDE false @@ -75,7 +79,7 @@ ${tycho-version} false - JavaSE-17 + JavaSE-21 false @@ -98,7 +102,7 @@ - + osx @@ -114,31 +118,46 @@ + + GEF Classic + p2 + https://download.eclipse.org/tools/gef/classic/release/3.21.0 + eclipse p2 - https://download.eclipse.org/releases/2023-09/ + https://download.eclipse.org/releases/2024-12/ m2e p2 https://download.eclipse.org/technology/m2e/releases/latest + + + + + - orbit_2303 + orbit_202211 p2 - https://download.eclipse.org/tools/orbit/downloads/drops/R20230302014618/repository/ + + https://download.eclipse.org/tools/orbit/downloads/drops/R20221123021534/repository - orbit_22 + orbit_202203 p2 - https://download.eclipse.org/tools/orbit/downloads/drops/R20220302172233/repository + + https://download.eclipse.org/tools/orbit/downloads/drops/R20220302172233/repository orbit_202305 p2 - https://download.eclipse.org/tools/orbit/downloads/drops/R20230531010532/repository + + + https://download.eclipse.org/tools/orbit/downloads/drops/R20230531010532/repository @@ -154,7 +173,7 @@ bundlor p2 - file:./bundlor/repo/ + ${project.baseUri}../bundlor/repo virgo-release @@ -165,7 +184,8 @@ - + cbi https://repo.eclipse.org/content/repositories/cbi-releases/ @@ -205,7 +225,7 @@ target-platform-configuration ${tycho-version} - JavaSE-17 + JavaSE-21 consider