diff --git a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
index 915ced74c6a0..e78d776d2f29 100644
--- a/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/netbeans_bug_report.yml
@@ -28,7 +28,7 @@ body:
multiple: false
options:
- "Apache NetBeans 22"
-# - "Apache NetBeans 22 release candidate"
+ - "Apache NetBeans 23 release candidate"
- "Apache NetBeans latest daily build"
validations:
required: true
@@ -73,6 +73,7 @@ body:
multiple: false
options:
- "No / Don't know"
+ - "Apache NetBeans 22"
- "Apache NetBeans 21"
- "Apache NetBeans 20"
- "Apache NetBeans 19"
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3c7d7e52fe6b..6befecbe2b53 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -124,7 +124,7 @@ jobs:
timeout-minutes: 40
strategy:
matrix:
- java: [ '17', '21', '22' ]
+ java: [ '17', '21', '23-ea' ]
exclude:
- java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }}
fail-fast: false
@@ -525,6 +525,18 @@ jobs:
- name: Extract
run: tar --zstd -xf build.tar.zst
+ - name: apisupport.project
+ run: ant $OPTS -f apisupport/apisupport.project test
+
+ - name: apisupport.refactoring
+ run: ant $OPTS -f apisupport/apisupport.refactoring test
+
+ - name: apisupport.wizards
+ run: ant $OPTS -f apisupport/apisupport.wizards test
+
+ - name: timers
+ run: ant $OPTS -f apisupport/timers test
+
- name: ide/api.xml
run: ant $OPTS -f ide/api.xml test
@@ -808,7 +820,7 @@ jobs:
timeout-minutes: 50
strategy:
matrix:
- java: [ '17', '21', '22' ]
+ java: [ '17', '21', '23-ea' ]
exclude:
- java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }}
fail-fast: false
@@ -1403,56 +1415,6 @@ jobs:
paths: "./*/*/build/test/*/results/TEST-*.xml"
- # TODO merge this job into other jobs once tests are fixed
- apisupport-modules-test:
- name: APISupport Modules on Linux/JDK ${{ matrix.java }}
- needs: base-build
- runs-on: ubuntu-latest
- timeout-minutes: 60
- strategy:
- matrix:
- java: [ '17' ]
- fail-fast: false
- steps:
-
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v4
- with:
- java-version: ${{ matrix.java }}
- distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }}
-
- - name: Setup Xvfb
- run: |
- echo "DISPLAY=:99.0" >> $GITHUB_ENV
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
-
- - name: Download Build
- uses: actions/download-artifact@v4
- with:
- name: build
-
- - name: Extract
- run: tar --zstd -xf build.tar.zst
-
- - name: apisupport.project
- run: ant $OPTS -f apisupport/apisupport.project test
-
- - name: apisupport.refactoring
- run: ant $OPTS -f apisupport/apisupport.refactoring test
-
- - name: apisupport.wizards
- run: ant $OPTS -f apisupport/apisupport.wizards test
-
- - name: timers
- run: ant $OPTS -f apisupport/timers test
-
- - name: Create Test Summary
- uses: test-summary/action@v2
- if: failure()
- with:
- paths: "./*/*/build/test/*/results/TEST-*.xml"
-
-
java-hints-test:
name: Java Hints ${{ matrix.config }} on Linux/JDK ${{ matrix.java }}
# equals env.test_java == 'true'
@@ -1462,10 +1424,10 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
- java: [ '17', '22' ]
+ java: [ '17', '23-ea' ]
config: [ 'batch1', 'batch2' ]
exclude:
- - java: ${{ github.event_name == 'pull_request' && 'nothing' || '22' }}
+ - java: ${{ github.event_name == 'pull_request' && 'nothing' || '23-ea' }}
fail-fast: false
steps:
@@ -1509,13 +1471,13 @@ jobs:
java-debugger-test:
name: Java Debugger tests on Linux/JDK ${{ matrix.java }}
# equals env.test_java == 'true'
- if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'debugger') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }}
needs: base-build
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
- java: [ '17', '21', '22' ]
+ java: [ '17', '21', '23-ea' ]
exclude:
- java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }}
fail-fast: false
@@ -2114,9 +2076,8 @@ jobs:
- name: web.jsfapi
run: ant $OPTS -f enterprise/web.jsfapi test
-# Fails
-# - name: web.jspparser
-# run: ant $OPTS -f enterprise/web.jspparser test
+ - name: web.jspparser
+ run: ant $OPTS -f enterprise/web.jspparser test
# Fails
# - name: web.project
@@ -2658,7 +2619,6 @@ jobs:
- java-hints-test
- java-debugger-test
- profiler-test
- - apisupport-modules-test
- build-tools
- webcommon-test
- php
diff --git a/.gitignore b/.gitignore
index 6045e2589e5a..d20d1599df4e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,6 +50,8 @@
/nb/ide.launcher/windows/nbproject/Package-*.bash
/platform/o.n.bootstrap/launcher/windows/nbproject/Makefile-*.mk
/platform/o.n.bootstrap/launcher/windows/nbproject/Package-*.bash
+/enterprise/web.jspparser/test/unit/data/emptyWebProject/lib/*.jar
+/enterprise/web.jspparser/test/unit/data/project2/lib/*.jar
# Database logs
derby.log
diff --git a/apisupport/apisupport.ant/manifest.mf b/apisupport/apisupport.ant/manifest.mf
index 99bf9f2919ce..91e09bdfbdc8 100644
--- a/apisupport/apisupport.ant/manifest.mf
+++ b/apisupport/apisupport.ant/manifest.mf
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.apisupport.ant
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/Bundle.properties
-OpenIDE-Module-Specification-Version: 2.97
+OpenIDE-Module-Specification-Version: 2.98
AutoUpdate-Show-In-Client: false
OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/resources/layer.xml
diff --git a/apisupport/apisupport.installer.maven/manifest.mf b/apisupport/apisupport.installer.maven/manifest.mf
index dfcb4a450122..8ffa9129d304 100644
--- a/apisupport/apisupport.installer.maven/manifest.mf
+++ b/apisupport/apisupport.installer.maven/manifest.mf
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.apisupport.installer.maven
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/installer/maven/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.47
+OpenIDE-Module-Specification-Version: 1.48
diff --git a/apisupport/apisupport.installer/manifest.mf b/apisupport/apisupport.installer/manifest.mf
index fa3cdcddb112..ebd6287366e8 100644
--- a/apisupport/apisupport.installer/manifest.mf
+++ b/apisupport/apisupport.installer/manifest.mf
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.apisupport.installer
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/installer/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.48
+OpenIDE-Module-Specification-Version: 1.49
diff --git a/apisupport/apisupport.kit/manifest.mf b/apisupport/apisupport.kit/manifest.mf
index 71f90de6eb74..732dea9169b4 100644
--- a/apisupport/apisupport.kit/manifest.mf
+++ b/apisupport/apisupport.kit/manifest.mf
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.apisupport.kit
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/kit/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.55
+OpenIDE-Module-Specification-Version: 1.56
OpenIDE-Module-Provides: org.netbeans.modules.apisupport.kit
diff --git a/apisupport/apisupport.project/manifest.mf b/apisupport/apisupport.project/manifest.mf
index 8249b93cd79c..ca578473b9fb 100644
--- a/apisupport/apisupport.project/manifest.mf
+++ b/apisupport/apisupport.project/manifest.mf
@@ -4,5 +4,5 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/api/Bu
OpenIDE-Module-Requires: javax.script.ScriptEngine.freemarker
OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/ui/resources/layer.xml
AutoUpdate-Show-In-Client: false
-OpenIDE-Module-Specification-Version: 1.101
+OpenIDE-Module-Specification-Version: 1.102
diff --git a/apisupport/apisupport.refactoring/manifest.mf b/apisupport/apisupport.refactoring/manifest.mf
index cf88272d9dec..fa7873bfa3f0 100644
--- a/apisupport/apisupport.refactoring/manifest.mf
+++ b/apisupport/apisupport.refactoring/manifest.mf
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.apisupport.refactoring
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/refactoring/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.62
+OpenIDE-Module-Specification-Version: 1.63
diff --git a/apisupport/apisupport.wizards/manifest.mf b/apisupport/apisupport.wizards/manifest.mf
index f95f8229d96c..72242032354b 100644
--- a/apisupport/apisupport.wizards/manifest.mf
+++ b/apisupport/apisupport.wizards/manifest.mf
@@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.apisupport.wizards
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/apisupport/project/ui/wizard/common/Bundle.properties
OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/ui/wizard/common/layer.xml
-OpenIDE-Module-Specification-Version: 1.45
+OpenIDE-Module-Specification-Version: 1.46
diff --git a/apisupport/maven.apisupport/manifest.mf b/apisupport/maven.apisupport/manifest.mf
index 5ddfb1a6b17a..9c3a2e42a359 100644
--- a/apisupport/maven.apisupport/manifest.mf
+++ b/apisupport/maven.apisupport/manifest.mf
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.maven.apisupport/1
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/apisupport/Bundle.properties
AutoUpdate-Show-In-Client: false
-OpenIDE-Module-Specification-Version: 1.84
+OpenIDE-Module-Specification-Version: 1.85
diff --git a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java
index 16b3c8508079..5a7c08bc9b53 100644
--- a/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java
+++ b/apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NBMNativeMWI.java
@@ -24,8 +24,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
@@ -49,6 +47,7 @@
import org.netbeans.modules.maven.model.pom.Project;
import org.netbeans.modules.maven.model.pom.Repository;
import org.netbeans.modules.maven.model.pom.RepositoryPolicy;
+import org.netbeans.modules.maven.options.MavenVersionSettings;
import org.netbeans.modules.maven.spi.newproject.CreateProjectBuilder;
import org.openide.util.Exceptions;
@@ -58,12 +57,12 @@
*/
final class NBMNativeMWI {
- static void instantiate(ProjectInfo vi, File projFile, String version, boolean useOsgi, MavenProject mp) {
+ static void instantiate(ProjectInfo vi, File projFile, String nbVersion, boolean useOsgi, MavenProject mp) {
CreateProjectBuilder builder = new CreateProjectBuilder(projFile, vi.groupId, vi.artifactId, vi.version)
.setPackageName(vi.packageName)
.setPackaging("nbm")
.setAdditionalNonPomWork(new AdditionalFiles())
- .setAdditionalOperations(new AdditionalOperations(version, useOsgi));
+ .setAdditionalOperations(new AdditionalOperations(nbVersion, useOsgi));
if (mp != null) {
builder = builder.setParentProject(mp);
}
@@ -237,7 +236,6 @@ public void performOperation(POMModel model) {
//nbm-maven-plugin
boolean addPlugin = true;
String managedPVersion = null;
- String pVersion = MavenNbModuleImpl.getLatestNbmPluginVersion();
// boolean useOsgiDepsSet = false;
if (parent != null) {
//TODO do we want to support the case when the plugin is defined in parent pom with inherited=true?
@@ -259,12 +257,13 @@ public void performOperation(POMModel model) {
}
}
}
+ MavenVersionSettings settings = MavenVersionSettings.getDefault();
if (addPlugin) {
Plugin p = model.getFactory().createPlugin();
p.setGroupId(MavenNbModuleImpl.GROUPID_APACHE);
p.setArtifactId(MavenNbModuleImpl.NBM_PLUGIN);
if (managedPVersion == null) {
- p.setVersion(pVersion);
+ p.setVersion(MavenNbModuleImpl.getLatestNbmPluginVersion());
}
p.setExtensions(true);
if (useOsgi) {
@@ -278,52 +277,44 @@ public void performOperation(POMModel model) {
//now comes the compiler plugin
addPlugin = true;
managedPVersion = null;
- String source = null;
- String target = null;
- pVersion = "3.11.0";
if (parent != null) {
//TODO do we want to support the case when the plugin is defined in parent pom with inherited=true?
PluginManagement pm = parent.getPluginManagement();
if (pm != null) {
- for (org.apache.maven.model.Plugin p : pm.getPlugins()) {
- if (Constants.GROUP_APACHE_PLUGINS.equals(p.getGroupId()) && Constants.PLUGIN_COMPILER.equals(p.getArtifactId())) {
- managedPVersion = p.getVersion();
- Xpp3Dom conf = (Xpp3Dom) p.getConfiguration();
- if (conf != null) {
- Xpp3Dom sourceEl = conf.getChild("source");
- if (sourceEl != null) {
- source = sourceEl.getValue();
- }
- Xpp3Dom targetEl = conf.getChild("target");
- if (targetEl != null) {
- target = targetEl.getValue();
+ if (parent.getProperties().getProperty("maven.compiler.release") != null) {
+ addPlugin = false;
+ } else {
+ for (org.apache.maven.model.Plugin p : pm.getPlugins()) {
+ if (Constants.GROUP_APACHE_PLUGINS.equals(p.getGroupId()) && Constants.PLUGIN_COMPILER.equals(p.getArtifactId())) {
+ managedPVersion = p.getVersion();
+ Xpp3Dom conf = (Xpp3Dom) p.getConfiguration();
+ if (conf != null) {
+ if ( conf.getChild("release") != null
+ || conf.getChild("source") != null
+ || conf.getChild("target") != null) {
+ addPlugin = false;
+ }
}
+ break;
}
- break;
}
}
}
}
- addPlugin = target == null || source == null;
if (addPlugin) {
Plugin p = model.getFactory().createPlugin();
p.setGroupId(Constants.GROUP_APACHE_PLUGINS);
p.setArtifactId(Constants.PLUGIN_COMPILER);
if (managedPVersion == null) {
- p.setVersion(pVersion);
+ p.setVersion(settings.getVersion(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER));
}
- Configuration c = model.getFactory().createConfiguration();
- c.setSimpleParameter("source", "1.8");
- c.setSimpleParameter("target", "1.8");
- p.setConfiguration(c);
getOrCreateBuild(model).addPlugin(p);
+ model.getProject().getProperties().setProperty("maven.compiler.release", "17");
}
//now the jar plugin
- addPlugin = true;
managedPVersion = null;
String useManifest = null;
- pVersion = "3.3.0";
if (parent != null) {
//TODO do we want to support the case when the plugin is defined in parent pom with inherited=true?
PluginManagement pm = parent.getPluginManagement();
@@ -359,6 +350,7 @@ public void performOperation(POMModel model) {
p.setGroupId(Constants.GROUP_APACHE_PLUGINS);
p.setArtifactId(Constants.PLUGIN_JAR);
if (managedPVersion == null) {
+ String pVersion = settings.getVersion(Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_JAR);
p.setVersion(pVersion);
managedPVersion = pVersion;
}
diff --git a/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java b/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java
index 869fe7a1b20a..2fa9e7aa1c21 100644
--- a/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java
+++ b/apisupport/maven.apisupport/test/unit/src/org/netbeans/modules/maven/apisupport/NBMNativeMWITest.java
@@ -38,6 +38,8 @@
public class NBMNativeMWITest extends NbTestCase {
+ private static final String EXPECTED_JAVAC_PLUGIN_VERSION = "3.13.0";
+
private FileObject wd;
public NBMNativeMWITest(String testName) {
@@ -64,7 +66,7 @@ public void testPathNoParent() throws IOException, XmlPullParserException {
assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId());
assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion());
assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId());
- assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion());
+ assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion());
assertEquals(0, model.getRepositories().size());
}
@@ -82,7 +84,7 @@ public void testPathNoParentSnapshot() throws IOException, XmlPullParserExceptio
assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId());
assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion());
assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId());
- assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion());
+ assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion());
assertEquals(1, model.getRepositories().size());
}
@@ -109,7 +111,7 @@ public void testPathParent() throws IOException, XmlPullParserException {
assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId());
assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion());
assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId());
- assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion());
+ assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion());
assertEquals(0, model.getRepositories().size());
}
@@ -135,7 +137,7 @@ public void testPathParentSnapshot() throws IOException, XmlPullParserException
assertEquals("nbm-maven-plugin", model.getBuild().getPlugins().get(0).getArtifactId());
assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), model.getBuild().getPlugins().get(0).getVersion());
assertEquals("maven-compiler-plugin", model.getBuild().getPlugins().get(1).getArtifactId());
- assertEquals("3.11.0", model.getBuild().getPlugins().get(1).getVersion());
+ assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, model.getBuild().getPlugins().get(1).getVersion());
assertEquals(1, model.getRepositories().size());
}
@@ -190,7 +192,7 @@ public void testPathParentJar() throws IOException, XmlPullParserException {
assertEquals("nbm-maven-plugin", modeloutput.getBuild().getPlugins().get(0).getArtifactId());
assertEquals(MavenNbModuleImpl.getLatestNbmPluginVersion(), modeloutput.getBuild().getPlugins().get(0).getVersion());
assertEquals("maven-compiler-plugin", modeloutput.getBuild().getPlugins().get(1).getArtifactId());
- assertEquals("3.11.0", modeloutput.getBuild().getPlugins().get(1).getVersion());
+ assertEquals(EXPECTED_JAVAC_PLUGIN_VERSION, modeloutput.getBuild().getPlugins().get(1).getVersion());
assertEquals(0, model.getRepositories().size());
}
diff --git a/apisupport/timers/manifest.mf b/apisupport/timers/manifest.mf
index 7015ddff5895..f6440d98df2c 100644
--- a/apisupport/timers/manifest.mf
+++ b/apisupport/timers/manifest.mf
@@ -3,6 +3,6 @@ OpenIDE-Module: org.netbeans.modules.timers/1
OpenIDE-Module-Layer: org/netbeans/modules/timers/resources/layer.xml
OpenIDE-Module-Install: org/netbeans/modules/timers/Install.class
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/timers/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.56
+OpenIDE-Module-Specification-Version: 1.57
AutoUpdate-Show-In-Client: true
diff --git a/cpplite/cpplite.debugger/manifest.mf b/cpplite/cpplite.debugger/manifest.mf
index dceff650eab9..6c1481f7fa5e 100644
--- a/cpplite/cpplite.debugger/manifest.mf
+++ b/cpplite/cpplite.debugger/manifest.mf
@@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.cpplite.debugger
OpenIDE-Module-Layer: org/netbeans/modules/cpplite/debugger/resources/mf-layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/debugger/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.17
+OpenIDE-Module-Specification-Version: 1.18
diff --git a/cpplite/cpplite.editor/manifest.mf b/cpplite/cpplite.editor/manifest.mf
index 708c207e824d..f7217b1eaa7b 100644
--- a/cpplite/cpplite.editor/manifest.mf
+++ b/cpplite/cpplite.editor/manifest.mf
@@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.cpplite.editor
OpenIDE-Module-Layer: org/netbeans/modules/cpplite/editor/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/editor/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.16
+OpenIDE-Module-Specification-Version: 1.17
diff --git a/cpplite/cpplite.kit/manifest.mf b/cpplite/cpplite.kit/manifest.mf
index cea2d0344ac2..727320821958 100644
--- a/cpplite/cpplite.kit/manifest.mf
+++ b/cpplite/cpplite.kit/manifest.mf
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.netbeans.modules.cpplite.kit
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/kit/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.16
+OpenIDE-Module-Specification-Version: 1.17
diff --git a/cpplite/cpplite.project/manifest.mf b/cpplite/cpplite.project/manifest.mf
index b444bd2fe41e..7a007bd781f6 100644
--- a/cpplite/cpplite.project/manifest.mf
+++ b/cpplite/cpplite.project/manifest.mf
@@ -3,5 +3,5 @@ AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.cpplite.project
OpenIDE-Module-Layer: org/netbeans/modules/cpplite/project/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cpplite/project/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.16
+OpenIDE-Module-Specification-Version: 1.17
diff --git a/enterprise/api.web.webmodule/manifest.mf b/enterprise/api.web.webmodule/manifest.mf
index 71d15edd5143..5975312711cd 100644
--- a/enterprise/api.web.webmodule/manifest.mf
+++ b/enterprise/api.web.webmodule/manifest.mf
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.api.web.webmodule
-OpenIDE-Module-Specification-Version: 1.63
+OpenIDE-Module-Specification-Version: 1.64
OpenIDE-Module-Layer: org/netbeans/modules/web/webmodule/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/webmodule/Bundle.properties
diff --git a/enterprise/cloud.amazon/manifest.mf b/enterprise/cloud.amazon/manifest.mf
index 915f38913b56..335657d3a2d4 100644
--- a/enterprise/cloud.amazon/manifest.mf
+++ b/enterprise/cloud.amazon/manifest.mf
@@ -4,5 +4,5 @@ OpenIDE-Module: org.netbeans.modules.cloud.amazon/0
OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/amazon/Bundle.properties
OpenIDE-Module-Layer: org/netbeans/modules/cloud/amazon/resources/layer.xml
-OpenIDE-Module-Specification-Version: 1.37
+OpenIDE-Module-Specification-Version: 1.38
diff --git a/enterprise/cloud.common/manifest.mf b/enterprise/cloud.common/manifest.mf
index e51c5462d868..bf35b4921a46 100644
--- a/enterprise/cloud.common/manifest.mf
+++ b/enterprise/cloud.common/manifest.mf
@@ -2,4 +2,4 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.cloud.common
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/common/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.36
+OpenIDE-Module-Specification-Version: 1.37
diff --git a/enterprise/cloud.oracle/external/binaries-list b/enterprise/cloud.oracle/external/binaries-list
index 194a2c6741d2..cc4884799098 100644
--- a/enterprise/cloud.oracle/external/binaries-list
+++ b/enterprise/cloud.oracle/external/binaries-list
@@ -32,6 +32,7 @@ D9918C04C60741D1BBEFBCC82E9D3B8BE690D412 com.oracle.oci.sdk:oci-java-sdk-objects
3088420C75219556F803B55D8B71B96D29D1FC80 com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:3.25.3
A7D98B96CEA17F78E4BB9270B4A60FEBFACF6C78 com.oracle.oci.sdk:oci-java-sdk-core:3.25.3
2236737DDF39CA3A3BABDB58B41F50C47E861EA7 com.oracle.oci.sdk:oci-java-sdk-containerengine:3.25.3
+923F38FE7186DFCBF921F9B3626832FFFFB8F6E9 com.oracle.oci.sdk:oci-java-sdk-artifacts:3.25.3
E5F6CAE5CA7ECAAC1EC2827A9E2D65AE2869CADA org.apache.httpcomponents:httpclient:4.5.13
853B96D3AFBB7BF8CC303FE27EE96836A10C1834 org.apache.httpcomponents:httpcore:4.4.13
diff --git a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
index 77fab270b8f5..10b6404ef8f3 100644
--- a/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
+++ b/enterprise/cloud.oracle/external/oci-java-sdk-3.25.3-license.txt
@@ -3,7 +3,7 @@ Description: Oracle Cloud Infrastructure SDK for Java
Origin: https://github.com/oracle/oci-java-sdk
Version: 3.25.3
License: UPL-Apache-2.0
-Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar oci-java-sdk-containerengine-3.25.3.jar oci-java-sdk-core-3.25.3.jar oci-java-sdk-objectstorage-3.25.3.jar oci-java-sdk-objectstorage-extensions-3.25.3.jar oci-java-sdk-objectstorage-generated-3.25.3.jar
+Files: oci-java-sdk-circuitbreaker-3.25.3.jar, oci-java-sdk-common-3.25.3.jar, oci-java-sdk-database-3.25.3.jar, oci-java-sdk-identity-3.25.3.jar, oci-java-sdk-workrequests-3.25.3.jar, oci-java-sdk-adm-3.25.3.jar, oci-java-sdk-devops-3.25.3.jar, oci-java-sdk-addons-apache-configurator-jersey-3.25.3.jar, oci-java-sdk-common-httpclient-3.25.3.jar, oci-java-sdk-common-httpclient-jersey-3.25.3.jar oci-java-sdk-keymanagement-3.25.3.jar oci-java-sdk-vault-3.25.3.jar oci-java-sdk-containerengine-3.25.3.jar oci-java-sdk-core-3.25.3.jar oci-java-sdk-objectstorage-3.25.3.jar oci-java-sdk-objectstorage-extensions-3.25.3.jar oci-java-sdk-objectstorage-generated-3.25.3.jar, oci-java-sdk-artifacts-3.25.3.jar
Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
diff --git a/enterprise/cloud.oracle/manifest.mf b/enterprise/cloud.oracle/manifest.mf
index eb908421be8b..356c13b0211d 100644
--- a/enterprise/cloud.oracle/manifest.mf
+++ b/enterprise/cloud.oracle/manifest.mf
@@ -4,6 +4,6 @@ OpenIDE-Module: org.netbeans.modules.cloud.oracle
OpenIDE-Module-Layer: org/netbeans/modules/cloud/oracle/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cloud/oracle/Bundle.properties
OpenIDE-Module-Provides: org.netbeans.modules.serverplugins.javaee
-OpenIDE-Module-Specification-Version: 1.11
+OpenIDE-Module-Specification-Version: 1.12
OpenIDE-Module-Display-Category: Cloud
diff --git a/enterprise/cloud.oracle/nbproject/project.properties b/enterprise/cloud.oracle/nbproject/project.properties
index 3f1ec9aa79e2..7463cc5d67a8 100644
--- a/enterprise/cloud.oracle/nbproject/project.properties
+++ b/enterprise/cloud.oracle/nbproject/project.properties
@@ -33,6 +33,7 @@ release.external/oci-java-sdk-objectstorage-generated-3.25.3.jar=modules/ext/oci
release.external/oci-java-sdk-objectstorage-extensions-3.25.3.jar=modules/ext/oci-java-sdk-objectstorage-extensions-3.25.3.jar
release.external/oci-java-sdk-core-3.25.3.jar=modules/ext/oci-java-sdk-core-3.25.3.jar
release.external/oci-java-sdk-containerengine-3.25.3.jar=modules/ext/oci-java-sdk-containerengine-3.25.3.jar
+release.external/oci-java-sdk-artifacts-3.25.3.jar=modules/ext/oci-java-sdk-artifacts-3.25.3.jar
release.external/httpclient-4.5.13.jar=modules/ext/httpclient-4.5.13.jar
release.external/httpcore-4.4.13.jar=modules/ext/httpcore-4.4.13.jar
release.external/javassist-3.25.0-GA.jar=modules/ext/javassist-3.25.0-GA.jar
diff --git a/enterprise/cloud.oracle/nbproject/project.xml b/enterprise/cloud.oracle/nbproject/project.xml
index 73205d6646ae..797fc5dcdb62 100644
--- a/enterprise/cloud.oracle/nbproject/project.xml
+++ b/enterprise/cloud.oracle/nbproject/project.xml
@@ -307,6 +307,10 @@
ext/oci-java-sdk-containerengine-3.25.3.jar
external/oci-java-sdk-containerengine-3.25.3.jar
+
+ ext/oci-java-sdk-artifacts-3.25.3.jar
+ external/oci-java-sdk-artifacts-3.25.3.jar
+
ext/httpclient-4.5.13.jar
external/httpclient-4.5.13.jar
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java
index 4d25183bac78..bfc515d76fe3 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java
@@ -19,11 +19,11 @@
package org.netbeans.modules.cloud.oracle;
import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Action;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import org.netbeans.modules.cloud.oracle.items.OCIItem;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children;
@@ -114,6 +114,11 @@ public void refresh() {
if (factory != null) {
factory.refreshKeys();
}
+ update(item);
+ }
+
+ public void update(OCIItem item) {
+
}
@Override
@@ -121,10 +126,11 @@ public Node.Handle getHandle() {
return super.getHandle();
}
- private final class RefreshListener implements ChangeListener {
+ private final class RefreshListener implements PropertyChangeListener {
@Override
- public void stateChanged(ChangeEvent e) {
+ public void propertyChange(PropertyChangeEvent evt) {
refresh();
+ fireDisplayNameChange("", getDisplayName());
}
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
index d20706a03454..5e8d6f807289 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddADBAction.java
@@ -34,6 +34,7 @@
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
@@ -48,7 +49,6 @@
import org.netbeans.modules.cloud.oracle.items.OCID;
import org.netbeans.modules.cloud.oracle.items.OCIItem;
import org.netbeans.modules.cloud.oracle.items.TenancyItem;
-import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.NotifyDescriptor.ComposedInput.Callback;
@@ -56,8 +56,8 @@
import org.openide.NotifyDescriptor.QuickPick.Item;
import org.openide.awt.ActionID;
import org.openide.awt.ActionRegistration;
-import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
/**
*
@@ -67,47 +67,46 @@
category = "Tools",
id = "org.netbeans.modules.cloud.oracle.actions.AddADBAction"
)
-@ActionRegistration(
- displayName = "#AddADB",
+@ActionRegistration(
+ displayName = "#AddADB",
asynchronous = true
)
@NbBundle.Messages({
"AddADB=Add Oracle Autonomous DB",
"SelectProfile=Select OCI Profile",
- "# {0} - tenancy name",
- "# {1} - region id",
- "SelectProfile_Description={0} (region: {1})",
"SelectCompartment=Select Compartment",
"SelectDatabase=Select Database",
"NoDatabase=No Database available in this Compartment",
"EnterUsername=Enter Username",
- "EnterPassword=Enter Password"
+ "EnterPassword=Enter Password",
+ "MSG_CollectingProfiles=Searching for OCI Profiles",
+ "MSG_CollectingProfiles_Text=Loading OCI Profiles",
+ "MSG_CollectingItems=Loading OCI contents",
+ "MSG_CollectingItems_Text=Listing compartments and databases",
+ "SelectProfile_Description={0} (region: {1})"
})
public class AddADBAction implements ActionListener {
+
private static final Logger LOGGER = Logger.getLogger(AddADBAction.class.getName());
-
+
private static final String DB = "db"; //NOI18N
private static final String USERNAME = "username"; //NOI18N
private static final String PASSWORD = "password"; //NOI18N
private static final int NUMBER_OF_INPUTS = 4;
+ private static final RequestProcessor RP = new RequestProcessor(AddADBAction.class);
- @NbBundle.Messages({
- "MSG_CollectingProfiles=Searching for OCI Profiles",
- "MSG_CollectingProfiles_Text=Loading OCI Profiles",
- "MSG_CollectingItems=Loading OCI contents",
- "MSG_CollectingItems_Text=Listing compartments and databases",
- })
@Override
public void actionPerformed(ActionEvent e) {
addADB();
}
-
- public DatabaseItem addADB() {
- Map result = new HashMap<> ();
-
+
+ public CompletableFuture addADB() {
+ Map result = new HashMap<>();
+ CompletableFuture future = new CompletableFuture();
+
NotifyDescriptor.ComposedInput ci = new NotifyDescriptor.ComposedInput(Bundle.AddADB(), NUMBER_OF_INPUTS, new Callback() {
- Map values = new HashMap<> ();
+ Map values = new HashMap<>();
@Override
public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int number) {
@@ -115,7 +114,7 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu
ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingProfiles());
h.start();
h.progress(Bundle.MSG_CollectingProfiles_Text());
-
+
Map profiles = new LinkedHashMap<>();
Map tenancyItems = new LinkedHashMap<>();
try {
@@ -157,9 +156,9 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu
NotifyDescriptor prev = input.getInputs()[number - 2];
OCIItem prevItem = null;
if (prev instanceof NotifyDescriptor.QuickPick) {
- for (QuickPick.Item item : ((QuickPick)prev).getItems()) {
+ for (QuickPick.Item item : ((QuickPick) prev).getItems()) {
if (item.isSelected()) {
- prevItem = (OCIItem)values.get(number - 1).get(item.getLabel());
+ prevItem = (OCIItem) values.get(number - 1).get(item.getLabel());
break;
}
}
@@ -201,36 +200,40 @@ public NotifyDescriptor createInput(NotifyDescriptor.ComposedInput input, int nu
return null;
}
}
-
+
});
- if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(ci)) {
- try {
- DatabaseItem selectedDatabase = (DatabaseItem) result.get(DB);
- DownloadWalletAction action = new DownloadWalletAction(selectedDatabase);
- WalletInfo info = new WalletInfo(
- DownloadWalletDialog.getWalletsDir().getAbsolutePath(),
- AbstractPasswordPanel.generatePassword(),
- (String) result.get(USERNAME),
- ((String) result.get(PASSWORD)).toCharArray(),
- selectedDatabase.getKey().getValue(),
- selectedDatabase.getCompartmentId());
- action.addConnection(info);
- return selectedDatabase;
- } catch (IOException ex) {
- Exceptions.printStackTrace(ex);
+ DialogDisplayer.getDefault().notifyFuture(ci).handle((r, exception) -> {
+ if (exception == null) {
+ try {
+ DatabaseItem selectedDatabase = (DatabaseItem) result.get(DB);
+ DownloadWalletAction action = new DownloadWalletAction(selectedDatabase);
+ WalletInfo info = new WalletInfo(
+ DownloadWalletDialog.getWalletsDir().getAbsolutePath(),
+ AbstractPasswordPanel.generatePassword(),
+ (String) result.get(USERNAME),
+ ((String) result.get(PASSWORD)).toCharArray(),
+ selectedDatabase);
+ action.addConnection(info);
+ future.complete(selectedDatabase);
+ } catch (IOException ex) {
+ future.completeExceptionally(exception);
+ }
+ } else {
+ future.completeExceptionally(exception);
}
- }
- return null;
+ return null;
+ });
+ return future;
}
-
+
private NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) {
-
+
List- items = ociItems.entrySet().stream()
.map(entry -> new Item(entry.getKey(), entry.getValue().getDescription()))
.collect(Collectors.toList());
return new NotifyDescriptor.QuickPick(title, title, items, false);
}
-
+
private Map getFlatCompartment(TenancyItem tenancy) {
Map compartments = new HashMap<>();
OCISessionInitiator session = OCIManager.getDefault().getActiveSession();
@@ -259,7 +262,7 @@ FlatCompartmentItem getItem(OCID compId) {
nextPageToken = response.getOpcNextPage();
} while (nextPageToken != null);
Map pickItems = computeFlatNames(compartments);
- pickItems.put(tenancy.getName()+" (root)", tenancy); // NOI18N
+ pickItems.put(tenancy.getName() + " (root)", tenancy); // NOI18N
return pickItems;
}
@@ -272,6 +275,7 @@ private Map computeFlatNames(Map com
}
private abstract class FlatCompartmentItem extends CompartmentItem {
+
private final OCID parentId;
private String flatName;
@@ -288,9 +292,13 @@ public String getName() {
if (flatName == null) {
String parentFlatName = "";
FlatCompartmentItem parentComp = getItem(parentId);
- if (parentComp != null) parentFlatName = parentComp.getName();
+ if (parentComp != null) {
+ parentFlatName = parentComp.getName();
+ }
flatName = super.getName();
- if (!parentFlatName.isEmpty()) flatName = parentFlatName + "/" + flatName; // NOI18N
+ if (!parentFlatName.isEmpty()) {
+ flatName = parentFlatName + "/" + flatName; // NOI18N
+ }
}
return flatName;
}
@@ -299,7 +307,7 @@ public String getName() {
}
private Map getDbs(OCIItem parent) {
- Map items = new HashMap<> ();
+ Map items = new HashMap<>();
try {
if (parent instanceof CompartmentItem) {
DatabaseNode.getDatabases().apply((CompartmentItem) parent).forEach((db) -> items.put(db.getName(), db));
@@ -309,5 +317,5 @@ private Map getDbs(OCIItem parent) {
}
return items;
}
-
+
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
index e4d0dc0eb6ae..1e43599166ec 100644
--- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/AddDbConnectionToVault.java
@@ -18,19 +18,19 @@
*/
package org.netbeans.modules.cloud.oracle.actions;
+import org.netbeans.modules.cloud.oracle.steps.PasswordStep;
+import org.netbeans.modules.cloud.oracle.steps.DatasourceNameStep;
+import org.netbeans.modules.cloud.oracle.steps.OverwriteStep;
import com.oracle.bmc.devops.DevopsClient;
import com.oracle.bmc.devops.model.DeployArtifactSource;
import com.oracle.bmc.devops.model.DeployArtifactSummary;
import com.oracle.bmc.devops.model.InlineDeployArtifactSource;
-import com.oracle.bmc.devops.model.ProjectSummary;
import com.oracle.bmc.devops.model.UpdateDeployArtifactDetails;
import com.oracle.bmc.devops.requests.GetDeployArtifactRequest;
import com.oracle.bmc.devops.requests.ListDeployArtifactsRequest;
-import com.oracle.bmc.devops.requests.ListProjectsRequest;
import com.oracle.bmc.devops.requests.UpdateDeployArtifactRequest;
import com.oracle.bmc.devops.responses.GetDeployArtifactResponse;
import com.oracle.bmc.devops.responses.ListDeployArtifactsResponse;
-import com.oracle.bmc.devops.responses.ListProjectsResponse;
import org.netbeans.api.db.explorer.DatabaseConnection;
import com.oracle.bmc.model.BmcException;
import com.oracle.bmc.vault.VaultsClient;
@@ -51,20 +51,14 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
-import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Set;
import java.util.UUID;
-import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.project.Project;
@@ -72,31 +66,24 @@
import static org.netbeans.modules.cloud.oracle.OCIManager.getDefault;
import org.netbeans.modules.cloud.oracle.assets.DependencyUtils;
import org.netbeans.modules.cloud.oracle.assets.Steps;
-import org.netbeans.modules.cloud.oracle.assets.Step;
+import org.netbeans.modules.cloud.oracle.steps.CompartmentStep;
+import org.netbeans.modules.cloud.oracle.steps.DevopsStep;
import org.netbeans.modules.cloud.oracle.assets.Steps.NextStepProvider;
-import org.netbeans.modules.cloud.oracle.assets.Steps.ProjectStep;
-import org.netbeans.modules.cloud.oracle.assets.Steps.TenancyStep;
-import org.netbeans.modules.cloud.oracle.compartment.CompartmentItem;
+import org.netbeans.modules.cloud.oracle.steps.KeyStep;
+import org.netbeans.modules.cloud.oracle.steps.ProjectStep;
+import org.netbeans.modules.cloud.oracle.steps.TenancyStep;
+import org.netbeans.modules.cloud.oracle.steps.VaultStep;
import org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem;
-import org.netbeans.modules.cloud.oracle.devops.DevopsProjectService;
-import org.netbeans.modules.cloud.oracle.items.OCID;
-import org.netbeans.modules.cloud.oracle.items.OCIItem;
import org.netbeans.modules.cloud.oracle.vault.KeyItem;
-import org.netbeans.modules.cloud.oracle.vault.KeyNode;
-import org.netbeans.modules.cloud.oracle.vault.SecretItem;
-import org.netbeans.modules.cloud.oracle.vault.SecretNode;
import org.netbeans.modules.cloud.oracle.vault.VaultItem;
-import org.netbeans.modules.cloud.oracle.vault.VaultNode;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
-import org.openide.NotifyDescriptor.QuickPick.Item;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
-import org.openide.util.Pair;
import org.openide.util.lookup.Lookups;
/**
@@ -116,20 +103,8 @@
})
@NbBundle.Messages({
"AddADBToVault=Add Oracle Autonomous DB details to OCI Vault",
- "SelectKey=Select Key",
- "SelectVault=Select Vault",
"SecretsCreated=Secrets were created or updated",
- "NoKeys=No keys in this Vault. Select another one.",
- "DatasourceName=Datasource Name",
- "AddVersion=Add new versions",
- "Cancel=Cancel",
- "SecretExists=Secrets with name {0} already exists",
- "NoProfile=There is not any OCI profile in the config",
- "NoCompartment=There are no compartments in the Tenancy",
- "Password=Enter password for Database user {0}",
"NoConfigMap=No ConfigMap found in the Devops project {0}",
- "SelectDevopsProject=Select Devops Project",
- "NoDevopsProjects=There are no Devops Projects in selected Compartment",
"ConfigmapUpdateFailed=Failed to update ConfigMap",
"CreatingSecret=Creating secret {0}",
"UpdatingSecret=Updating secret {0}",
@@ -138,7 +113,6 @@
"DatasourceEmpty=Datasource name cannot be empty"
})
public class AddDbConnectionToVault implements ActionListener {
-
private static final Logger LOG = Logger.getLogger(AddDbConnectionToVault.class.getName());
private final DatabaseConnection context;
@@ -146,357 +120,37 @@ public class AddDbConnectionToVault implements ActionListener {
public AddDbConnectionToVault(DatabaseConnection context) {
this.context = context;
}
-
- class VaultStep implements Step {
-
- private Map vaults = null;
- private VaultItem selected;
- private Lookup lookup;
-
- public Step prepare(CompartmentItem compartment, Lookup lookup) {
- this.lookup = lookup;
- ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems());
- h.start();
- h.progress(Bundle.MSG_CollectingItems_Text());
- try {
- vaults = getVaults(compartment);
- } finally {
- h.finish();
- }
- return this;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- return createQuickPick(vaults, Bundle.SelectVault());
- }
-
- @Override
- public Step getNext() {
- return new KeyStep().prepare(getValue(), lookup);
- }
-
- @Override
- public void setValue(String selected) {
- this.selected = vaults.get(selected);
- }
-
- @Override
- public VaultItem getValue() {
- if (onlyOneChoice()) {
- selected = vaults.values().iterator().next();
- }
- return selected;
- }
-
- @Override
- public boolean onlyOneChoice() {
- return vaults.size() == 1;
- }
- }
-
- class KeyStep implements Step> {
-
- private Map keys = null;
- private KeyItem selected;
- private VaultItem vault;
- private Lookup lookup;
-
- public Step> prepare(VaultItem vault, Lookup lookup) {
- this.vault = vault;
- this.lookup = lookup;
- ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems());
- h.start();
- h.progress(Bundle.MSG_CollectingItems_Text());
- try {
- keys = getKeys(vault);
- } finally {
- h.finish();
- }
- return this;
- }
-
- @Override
- public boolean onlyOneChoice() {
- return keys.size() == 1;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- if (keys.size() > 1) {
- return createQuickPick(keys, Bundle.SelectKey());
- }
- if (keys.size() == 0) {
- return new NotifyDescriptor.QuickPick("", Bundle.NoKeys(), Collections.emptyList(), false);
- }
-
- throw new IllegalStateException("No data to create input"); // NOI18N
- }
-
- @Override
- public Step getNext() {
- return new DatasourceNameStep().prepare(getValue(), lookup);
- }
-
- @Override
- public void setValue(String selected) {
- this.selected = keys.get(selected);
- }
-
- @Override
- public Pair getValue() {
- if (keys.size() == 1) {
- return Pair.of(vault, keys.values().iterator().next());
- }
- return Pair.of(vault, selected);
- }
-
- }
-
- class DatasourceNameStep implements Step, Result> {
-
- private Result result = new Result();
- private Lookup lookup;
-
- @Override
- public Step, Result> prepare(Pair item, Lookup lookup) {
- this.lookup = lookup;
- result.vault = item.first();
- result.key = item.second();
- return this;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- return new NotifyDescriptor.InputLine("DEFAULT", Bundle.DatasourceName()); //NOI18N
- }
-
- @Override
- public Step getNext() {
- return new OverwriteStep().prepare(result, lookup);
- }
-
- @Override
- public void setValue(String selected) {
- result.datasourceName = selected;
- }
-
- @Override
- public Result getValue() {
- return result;
- }
-
- @Override
- public boolean onlyOneChoice() {
- return false;
- }
-
- }
-
- class OverwriteStep implements Step {
-
- private Result result;
- private Set dsNames;
- private String choice;
- private Lookup lookup;
-
- @Override
- public Step prepare(Result result, Lookup lookup) {
- this.lookup = lookup;
- this.result = result;
- if (result.datasourceName == null || result.datasourceName.isEmpty()) {
- return this;
- }
- List secrets = SecretNode.getSecrets().apply(result.vault);
- this.dsNames = secrets.stream()
- .map(s -> extractDatasourceName(s.getName()))
- .filter(Objects::nonNull)
- .collect(Collectors.toSet());
- return this;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- if (result.datasourceName == null || result.datasourceName.isEmpty()) {
- return new NotifyDescriptor.QuickPick("", Bundle.DatasourceEmpty(), Collections.emptyList(), false);
- }
- List
- yesNo = new ArrayList();
- yesNo.add(new Item(Bundle.AddVersion(), ""));
- yesNo.add(new Item(Bundle.Cancel(), ""));
- return new NotifyDescriptor.QuickPick("", Bundle.SecretExists(result.datasourceName), yesNo, false);
- }
-
- @Override
- public Step getNext() {
- return new PasswordStep().prepare(result, lookup);
- }
-
- @Override
- public void setValue(String choice) {
- this.choice = choice;
- }
-
- @Override
- public Result getValue() {
- if (Bundle.AddVersion().equals(choice) || onlyOneChoice()) {
- result.update = true;
- return result;
- }
- return null;
- }
-
- @Override
- public boolean onlyOneChoice() {
- return dsNames != null && !dsNames.contains(result.datasourceName);
- }
-
- }
-
- class PasswordStep implements Step {
- private Result item;
- private boolean ask;
- private Lookup lookup;
-
- @Override
- public Step prepare(Result item, Lookup lookup) {
- this.lookup = lookup;
- item.password = context.getPassword();
- ask = item.password == null || item.password.isEmpty();
- this.item = item;
- return this;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- return new NotifyDescriptor.PasswordLine("DEFAULT", Bundle.Password(context.getUser())); //NOI18N
- }
-
- @Override
- public boolean onlyOneChoice() {
- return !ask;
- }
-
- @Override
- public Step getNext() {
- return new DevopsStep().prepare(item, lookup);
- }
-
- @Override
- public void setValue(String password) {
- item.password = password;
- }
-
- @Override
- public Result getValue() {
- return item;
- }
- }
-
- class DevopsStep implements Step {
- private Result item;
- private Map devopsProjects;
- private Lookup lookup;
-
- @Override
- public Step prepare(Result item, Lookup lookup) {
- this.item = item;
- this.lookup = lookup;
- ProgressHandle h = ProgressHandle.createHandle(Bundle.MSG_CollectingItems());
- h.start();
- h.progress(Bundle.MSG_CollectingItems_Text());
- try {
- List devops = DevopsProjectService.getDevopsProjectOcid();
-
- Map allProjectsInCompartment = getDevopsProjects(item.vault.getCompartmentId());
- Map filtered = allProjectsInCompartment.entrySet()
- .stream()
- .filter(e -> devops.contains(e.getValue().getKey().getValue()))
- .collect(Collectors
- .toMap(Entry::getKey, Entry::getValue));
- if (filtered.size() > 0) {
- devopsProjects = filtered;
- } else {
- devopsProjects = allProjectsInCompartment;
- }
- if (devopsProjects.size() == 1) {
- item.project = devopsProjects.values().iterator().next();
- }
-
- } finally {
- h.finish();
- }
- return this;
- }
-
- @Override
- public NotifyDescriptor createInput() {
- if (devopsProjects.size() > 1) {
- return createQuickPick(devopsProjects, Bundle.SelectDevopsProject());
- }
- if (devopsProjects.isEmpty()) {
- return new NotifyDescriptor.QuickPick("", Bundle.NoDevopsProjects(), Collections.emptyList(), false);
- }
- throw new IllegalStateException("No data to create input"); // NOI18N
- }
-
- @Override
- public boolean onlyOneChoice() {
- return devopsProjects.size() == 1;
- }
-
- @Override
- public Step getNext() {
- NextStepProvider nsProvider = lookup.lookup(NextStepProvider.class);
- if (nsProvider != null) {
- Step ns = nsProvider.nextStepFor(this);
- if (ns != null) {
- return ns.prepare(getValue(), lookup);
- }
- }
- return null;
- }
-
- @Override
- public void setValue(String projectName) {
- item.project = devopsProjects.get(projectName);
- }
-
- @Override
- public Result getValue() {
- return item;
- }
- }
-
- static final class Result {
- VaultItem vault;
- KeyItem key;
- String datasourceName;
- String password;
- DevopsProjectItem project;
- private boolean update;
- }
@Override
public void actionPerformed(ActionEvent e) {
NextStepProvider nsProvider = NextStepProvider.builder()
- .stepForClass(Steps.CompartmentStep.class, (s) -> new VaultStep())
+ .stepForClass(CompartmentStep.class, (s) -> new VaultStep())
+ .stepForClass(VaultStep.class, (s) -> new KeyStep())
+ .stepForClass(KeyStep.class, (s) -> new DatasourceNameStep())
+ .stepForClass(DatasourceNameStep.class, (s) -> new OverwriteStep())
+ .stepForClass(OverwriteStep.class, (s) -> new PasswordStep(context.getPassword(), context.getUser()))
+ .stepForClass(PasswordStep.class, (s) -> new DevopsStep())
.stepForClass(DevopsStep.class, (s) -> new ProjectStep())
.build();
Lookup lookup = Lookups.fixed(nsProvider);
- Steps.getDefault().executeMultistep(new TenancyStep(), lookup).thenAccept(r -> {
- Result result = ((Pair) r).second();
- Project project = ((Pair) r).first();
- if (result.datasourceName == null || result.datasourceName.isEmpty()) {
+ Steps.getDefault().executeMultistep(new TenancyStep(), lookup).thenAccept(vals -> {
+ Project project = vals.getValueForStep(ProjectStep.class);
+ DevopsProjectItem devopsProject = vals.getValueForStep(DevopsStep.class);
+ String datasourceName = vals.getValueForStep(DatasourceNameStep.class);
+ VaultItem vault = vals.getValueForStep(VaultStep.class);
+ KeyItem key = vals.getValueForStep(KeyStep.class);
+ String password = vals.getValueForStep(PasswordStep.class);
+ if (datasourceName == null || datasourceName.isEmpty()) {
NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.DatasourceEmpty());
DialogDisplayer.getDefault().notify(msg);
return;
}
- addDbConnectionToVault(result, project);
+ addDbConnectionToVault(vault, key, project, devopsProject, datasourceName, password);
});
}
- private void addDbConnectionToVault(Result item, Project project) {
- ProgressHandle h = ProgressHandle.createHandle(Bundle.UpdatingVault(item.vault.getName()));
+ private void addDbConnectionToVault(VaultItem vault, KeyItem key, Project project, DevopsProjectItem devopsProject, String datasourceName, String password) {
+ ProgressHandle h = ProgressHandle.createHandle(Bundle.UpdatingVault(vault.getName()));
h.start();
h.progress(Bundle.ReadingSecrets());
@@ -504,20 +158,20 @@ private void addDbConnectionToVault(Result item, Project project) {
VaultsClient client = VaultsClient.builder().build(getDefault().getActiveProfile().getConfigProvider());
ListSecretsRequest listSecretsRequest = ListSecretsRequest.builder()
- .compartmentId(item.vault.getCompartmentId())
- .vaultId(item.vault.getKey().getValue())
+ .compartmentId(vault.getCompartmentId())
+ .vaultId(vault.getKey().getValue())
.limit(88)
.build();
ListSecretsResponse secrets = client.listSecrets(listSecretsRequest);
- Map existingSecrets = secrets.getItems().stream()
- .collect(Collectors.toMap(s -> s.getSecretName(), s -> s.getId()));
+ Map existingSecrets = secrets.getItems().stream()
+ .collect(Collectors.toMap(s -> s.getSecretName(), s -> s.getId()));
Map values = new HashMap() {
{
put("Username", context.getUser()); //NOI18N
- put("Password", item.password); //NOI18N
+ put("Password", password); //NOI18N
put("OCID", (String) context.getConnectionProperties().get("OCID")); //NOI18N
put("CompartmentOCID", (String) context.getConnectionProperties().get("CompartmentOCID")); //NOI18N
put("wallet_Password", UUID.randomUUID().toString()); //NOI18N
@@ -525,7 +179,7 @@ private void addDbConnectionToVault(Result item, Project project) {
};
for (Entry entry : values.entrySet()) {
- String secretName = "DATASOURCES_" + item.datasourceName + "_" + entry.getKey().toUpperCase(); //NOI18N
+ String secretName = "DATASOURCES_" + datasourceName + "_" + entry.getKey().toUpperCase(); //NOI18N
String base64Content = Base64.getEncoder().encodeToString(entry.getValue().getBytes(StandardCharsets.UTF_8));
SecretContentDetails contentDetails = Base64SecretContentDetails.builder()
@@ -553,9 +207,9 @@ private void addDbConnectionToVault(Result item, Project project) {
.secretContent(contentDetails)
.secretRules(new ArrayList<>(Arrays.asList(SecretReuseRule.builder()
.isEnforcedOnDeletedSecretVersions(false).build())))
- .compartmentId(item.vault.getCompartmentId())
- .vaultId(item.vault.getKey().getValue())
- .keyId(item.key.getKey().getValue())
+ .compartmentId(vault.getCompartmentId())
+ .vaultId(vault.getKey().getValue())
+ .keyId(key.getKey().getValue())
.build();
CreateSecretRequest request = CreateSecretRequest
.builder()
@@ -575,13 +229,13 @@ private void addDbConnectionToVault(Result item, Project project) {
// Add Vault to the ConfigMap artifact
DevopsClient devopsClient = DevopsClient.builder().build(OCIManager.getDefault().getActiveProfile().getConfigProvider());
ListDeployArtifactsRequest request = ListDeployArtifactsRequest.builder()
- .projectId(item.project.getKey().getValue()).build();
+ .projectId(devopsProject.getKey().getValue()).build();
ListDeployArtifactsResponse response = devopsClient.listDeployArtifacts(request);
List artifacts = response.getDeployArtifactCollection().getItems();
boolean found = false;
for (DeployArtifactSummary artifact : artifacts) {
- if ((item.project.getName() + "_oke_configmap").equals(artifact.getDisplayName())) { //NOI18N
- h.progress("updating " + item.project.getName() + "_oke_configmap"); //NOI18N
+ if ((devopsProject.getName() + "_oke_configmap").equals(artifact.getDisplayName())) { //NOI18N
+ h.progress("updating " + devopsProject.getName() + "_oke_configmap"); //NOI18N
found = true;
GetDeployArtifactRequest artRequest = GetDeployArtifactRequest.builder().deployArtifactId(artifact.getId()).build();
GetDeployArtifactResponse artResponse = devopsClient.getDeployArtifact(artRequest);
@@ -589,7 +243,7 @@ private void addDbConnectionToVault(Result item, Project project) {
if (source instanceof InlineDeployArtifactSource) {
byte[] content = ((InlineDeployArtifactSource) source).getBase64EncodedContent();
String srcString = updateProperties(new String(content, StandardCharsets.UTF_8),
- item.vault.getCompartmentId(), item.vault.getKey().getValue(), item.datasourceName);
+ vault.getCompartmentId(), vault.getKey().getValue(), datasourceName);
byte[] base64Content = Base64.getEncoder().encode(srcString.getBytes(StandardCharsets.UTF_8));
DeployArtifactSource updatedSource = InlineDeployArtifactSource.builder()
.base64EncodedContent(base64Content).build();
@@ -605,7 +259,7 @@ private void addDbConnectionToVault(Result item, Project project) {
}
}
if (!found) {
- NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.NoConfigMap(item.project.getName()), NotifyDescriptor.WARNING_MESSAGE);
+ NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.NoConfigMap(devopsProject.getName()), NotifyDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().notify(msg);
}
NotifyDescriptor.Message msg = new NotifyDescriptor.Message(Bundle.SecretsCreated());
@@ -644,7 +298,7 @@ protected static String updateProperties(String configmap, String compartmentOci
path.entrySet().removeIf(entry -> entry.getKey() >= f);
if (propertiesName != null) {
int propIndent = previousIndent;
- if (properties.size() == 0) {
+ if (properties.isEmpty()) {
propIndent = indent + 2;
}
output.append(
@@ -716,63 +370,4 @@ private static String formatProperties(String proprtiesName, Map
return output.toString();
}
- private static NotifyDescriptor.QuickPick createQuickPick(Map ociItems, String title) {
-
- List items = ociItems.entrySet().stream()
- .map(entry -> new NotifyDescriptor.QuickPick.Item(entry.getKey(), entry.getValue().getDescription()))
- .collect(Collectors.toList());
- return new NotifyDescriptor.QuickPick(title, title, items, false);
- }
-
- protected static Map getDevopsProjects(String compartmentId) {
- try (DevopsClient client = new DevopsClient(OCIManager.getDefault().getConfigProvider());) {
- ListProjectsRequest request = ListProjectsRequest.builder().compartmentId(compartmentId).build();
- ListProjectsResponse response = client.listProjects(request);
-
- List projects = response.getProjectCollection().getItems();
- for (ProjectSummary project : projects) {
- project.getNotificationConfig().getTopicId();
-
- }
- return projects.stream()
- .map(p -> new DevopsProjectItem(OCID.of(p.getId(), "DevopsProject"), // NOI18N
- compartmentId,
- p.getName()))
- .collect(Collectors.toMap(DevopsProjectItem::getName, Function.identity()));
- }
- }
-
- protected static Map getVaults(OCIItem parent) {
- Map items = new HashMap<>();
- try {
- if (parent instanceof CompartmentItem) {
- VaultNode.getVaults().apply((CompartmentItem) parent).forEach((db) -> items.put(db.getName(), db));
- }
- } catch (BmcException e) {
- LOG.log(Level.SEVERE, "Unable to load vault list", e); //NOI18N
- }
- return items;
- }
-
- protected static Map getKeys(OCIItem parent) {
- Map items = new HashMap<>();
- try {
- if (parent instanceof VaultItem) {
- KeyNode.getKeys().apply((VaultItem) parent).forEach(key -> items.put(key.getName(), key));
- }
- } catch (BmcException e) {
- LOG.log(Level.SEVERE, "Unable to load key list", e); //NOI18N
- }
- return items;
- }
-
- static Pattern p = Pattern.compile("[A-Z]*_([a-zA-Z0-9]*)_[A-Z]*"); //NOI18N
-
- protected static String extractDatasourceName(String value) {
- Matcher m = p.matcher(value);
- if (m.matches()) {
- return m.group(1);
- }
- return null;
- }
}
diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java
new file mode 100644
index 000000000000..7348bd14963f
--- /dev/null
+++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/ConfigMapCommand.java
@@ -0,0 +1,379 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.cloud.oracle.actions;
+
+import com.oracle.bmc.devops.DevopsClient;
+import com.oracle.bmc.devops.model.DeployArtifactSource;
+import com.oracle.bmc.devops.model.DeployArtifactSummary;
+import com.oracle.bmc.devops.model.InlineDeployArtifactSource;
+import com.oracle.bmc.devops.model.UpdateDeployArtifactDetails;
+import com.oracle.bmc.devops.requests.GetDeployArtifactRequest;
+import com.oracle.bmc.devops.requests.ListDeployArtifactsRequest;
+import com.oracle.bmc.devops.requests.UpdateDeployArtifactRequest;
+import com.oracle.bmc.devops.responses.GetDeployArtifactResponse;
+import com.oracle.bmc.devops.responses.ListDeployArtifactsResponse;
+import com.oracle.bmc.model.BmcException;
+import com.oracle.bmc.vault.VaultsClient;
+import com.oracle.bmc.vault.model.Base64SecretContentDetails;
+import com.oracle.bmc.vault.model.CreateSecretDetails;
+import com.oracle.bmc.vault.model.SecretContentDetails;
+import com.oracle.bmc.vault.model.SecretReuseRule;
+import com.oracle.bmc.vault.model.UpdateSecretDetails;
+import com.oracle.bmc.vault.requests.CreateSecretRequest;
+import com.oracle.bmc.vault.requests.ListSecretsRequest;
+import com.oracle.bmc.vault.requests.UpdateSecretRequest;
+import com.oracle.bmc.vault.responses.ListSecretsResponse;
+import com.oracle.bmc.vault.responses.UpdateSecretResponse;
+import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import org.netbeans.modules.cloud.oracle.steps.DevopsStep;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import org.netbeans.api.db.explorer.ConnectionManager;
+import org.netbeans.api.db.explorer.DatabaseConnection;
+import org.netbeans.api.progress.ProgressHandle;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.cloud.oracle.OCIManager;
+import static org.netbeans.modules.cloud.oracle.OCIManager.getDefault;
+import org.netbeans.modules.cloud.oracle.assets.CloudAssets;
+import org.netbeans.modules.cloud.oracle.assets.DependencyUtils;
+import org.netbeans.modules.cloud.oracle.assets.PropertiesGenerator;
+import org.netbeans.modules.cloud.oracle.assets.Steps;
+import org.netbeans.modules.cloud.oracle.database.DatabaseItem;
+import org.netbeans.modules.cloud.oracle.devops.DevopsProjectItem;
+import org.netbeans.modules.cloud.oracle.steps.DatasourceNameStep;
+import org.netbeans.modules.cloud.oracle.steps.KeyStep;
+import org.netbeans.modules.cloud.oracle.steps.OverwriteStep;
+import org.netbeans.modules.cloud.oracle.steps.PasswordStep;
+import org.netbeans.modules.cloud.oracle.steps.ProjectStep;
+import org.netbeans.modules.cloud.oracle.items.OCIItem;
+import org.netbeans.modules.cloud.oracle.steps.CompartmentStep;
+import org.netbeans.modules.cloud.oracle.steps.TenancyStep;
+import org.netbeans.modules.cloud.oracle.vault.KeyItem;
+import org.netbeans.modules.cloud.oracle.vault.VaultItem;
+import org.netbeans.spi.lsp.CommandProvider;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openide.util.lookup.Lookups;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ * Command that updates a ConfigMap with the current properties generated from the contents of {@link CloudAssets}.
+ *
+ * @author Jan Horvath
+ */
+@NbBundle.Messages({
+ "SuggestVault=For better security when using Autonomous Database, be sure to also add OCI Vault.",
+ "UpdatingConfigMap=Updating Config Map",
+ "CMUpdated=ConfigMap in \"{0}\" project was updated"
+})
+@ServiceProvider(service = CommandProvider.class)
+public class ConfigMapCommand implements CommandProvider {
+
+ private static final Logger LOG = Logger.getLogger(ConfigMapCommand.class.getName());
+
+ private static final String COMMAND_UPLOAD_TO_CONFIGMAP = "nbls.cloud.assets.configmap.upload"; //NOI18N
+
+ private static final Set COMMANDS = new HashSet<>(Arrays.asList(
+ COMMAND_UPLOAD_TO_CONFIGMAP
+ ));
+
+ @Override
+ public Set getCommands() {
+ return Collections.unmodifiableSet(COMMANDS);
+ }
+
+ @Override
+ public CompletableFuture