Skip to content

Commit

Permalink
Bump SNAPSHOT release + code from PR wso2#120
Browse files Browse the repository at this point in the history
  • Loading branch information
guidospadotto-profesia committed Apr 22, 2024
1 parent 69535d4 commit 864c490
Show file tree
Hide file tree
Showing 42 changed files with 123 additions and 97 deletions.
2 changes: 1 addition & 1 deletion carbon-p2-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ License. -->
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class P2Constants {
"org.eclipse.equinox:org.eclipse.equinox.ds",
"org.eclipse.equinox:org.eclipse.equinox.launcher",
"org.eclipse.equinox:org.eclipse.equinox.util",
"org.eclipse.osgi:org.eclipse.osgi.services",
"org.eclipse.osgi:org.eclipse.osgi",
"org.eclipse.platform:org.eclipse.osgi.services",
"org.eclipse.platform:org.eclipse.osgi",
"org.eclipse.equinox:org.eclipse.equinox.app",
"org.eclipse.equinox:org.eclipse.equinox.concurrent",
"org.eclipse.equinox:org.eclipse.equinox.frameworkadmin",
Expand Down
2 changes: 1 addition & 1 deletion humantask-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion maven-car-deploy-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ additional
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>car-maven-plugin</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion maven-car-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ additional
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>car-maven-plugin</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<extensions>true</extensions>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion maven-carbon-ui-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion maven-dataservice-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion maven-datasource-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion maven-library-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion maven-synapse-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>maven-common-tools</artifactId>
<groupId>org.wso2.maven</groupId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion org.wso2.maven.capp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package org.wso2.maven.capp.utils;

public class WSO2MavenPluginConstants {
public static final String MAVEN_CARBON_UI_PLUGIN_VERSION="5.2.50-SNAPSHOT";
public static final String MAVEN_CAR_PLUGIN_VERSION="5.2.50-SNAPSHOT";
public static final String WSO2_GENERAL_PROJECT_VERSION = "5.2.50-SNAPSHOT";
public static final String MAVEN_CAR_DEPLOY_PLUGIN_VERSION="5.2.50-SNAPSHOT";
public static final String MAVEN_REGISTRY_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String MAVEN_DATA_SERVICE_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String MAVEN_SYNAPSE_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_API_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_CONNECTOR_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_TASK_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_TEMPLATE_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_MESSAGE_STORE_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_MESSAGE_PROCESSOR_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_ENDPOINT_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_INBOUND_ENDPOINT_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_LOCAL_ENTRY_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_PROXY_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_SEQUENCE_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_SYNAPSE_VERSION = "5.2.50-SNAPSHOT";
public static final String WSO2_ESB_METADATA_PLUGIN_VERSION = "5.2.50-SNAPSHOT";
public static final String MAVEN_CARBON_UI_PLUGIN_VERSION="5.2.52-SNAPSHOT";
public static final String MAVEN_CAR_PLUGIN_VERSION="5.2.52-SNAPSHOT";
public static final String WSO2_GENERAL_PROJECT_VERSION = "5.2.52-SNAPSHOT";
public static final String MAVEN_CAR_DEPLOY_PLUGIN_VERSION="5.2.52-SNAPSHOT";
public static final String MAVEN_REGISTRY_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
public static final String MAVEN_DATA_SERVICE_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
public static final String MAVEN_SYNAPSE_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_API_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_CONNECTOR_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_TASK_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_TEMPLATE_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_MESSAGE_STORE_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_MESSAGE_PROCESSOR_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_ENDPOINT_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_INBOUND_ENDPOINT_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_LOCAL_ENTRY_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_PROXY_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_SEQUENCE_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_SYNAPSE_VERSION = "5.2.52-SNAPSHOT";
public static final String WSO2_ESB_METADATA_PLUGIN_VERSION = "5.2.52-SNAPSHOT";
}
2 changes: 1 addition & 1 deletion org.wso2.maven.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion org.wso2.maven.general/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion org.wso2.maven.utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ additional
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<packaging>pom</packaging>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<name>Maven Commons Tools Aggregator Pom</name>
<url>http://wso2.org</url>
<repositories>
Expand Down Expand Up @@ -375,16 +375,16 @@ additional
<org.wso2.securevault.version>1.0.0</org.wso2.securevault.version>
<org.wso2.carbon.authenticator.stub.version>3.2.0</org.wso2.carbon.authenticator.stub.version>
<org.wso2.carbon.roles.mgt.stub.version>3.2.0</org.wso2.carbon.roles.mgt.stub.version>
<org.wso2.maven.synapse.plugin.version>5.2.50-SNAPSHOT</org.wso2.maven.synapse.plugin.version>
<org.wso2.maven.synapse.plugin.version>5.2.52-SNAPSHOT</org.wso2.maven.synapse.plugin.version>
<!-- This is a dependency from 9 years ago:
https://github.com/wso2/maven-tools/blob/v5.0.0/maven-stratos-plugin/pom.xml#L23
-->
<!--org.wso2.maven.stratos.plugin.version>2.1.0</org.wso2.maven.stratos.plugin.version-->
<org.wso2.maven.capp.version>5.2.50-SNAPSHOT</org.wso2.maven.capp.version>
<org.wso2.maven.core.version>5.2.50-SNAPSHOT</org.wso2.maven.core.version>
<org.wso2.maven.capp.version>5.2.52-SNAPSHOT</org.wso2.maven.capp.version>
<org.wso2.maven.core.version>5.2.52-SNAPSHOT</org.wso2.maven.core.version>
<org.wso2.maven.esb.version>2.1.0</org.wso2.maven.esb.version>
<org.wso2.maven.utils.version>5.2.50-SNAPSHOT</org.wso2.maven.utils.version>
<org.wso2.maven.registry.version>5.2.50-SNAPSHOT</org.wso2.maven.registry.version>
<org.wso2.maven.utils.version>5.2.52-SNAPSHOT</org.wso2.maven.utils.version>
<org.wso2.maven.registry.version>5.2.52-SNAPSHOT</org.wso2.maven.registry.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gson.version>2.8.5</gson.version>
<testng.version>6.11</testng.version>
Expand Down
2 changes: 1 addition & 1 deletion vscode-car-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-common-tools</artifactId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vscode-car-plugin</artifactId>
Expand Down
86 changes: 55 additions & 31 deletions vscode-car-plugin/src/main/java/org/wso2/maven/CAppHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import java.util.*;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;

Expand Down Expand Up @@ -223,20 +219,55 @@ void processRegistryResources(File resourcesFolder, String archiveDirectory, Lis
for (OMElement artifact : artifactChildElements) {
String name = artifact.getAttributeValue(new QName(Constants.NAME));
String version = artifact.getAttributeValue(new QName(Constants.VERSION));
OMElement item = getFirstChildWithName(artifact, Constants.ITEM);
String fileName = item.getFirstChildWithName(new QName(Constants.FILE)).getText();
String path = item.getFirstChildWithName(new QName(Constants.PATH)).getText();
File registryResource;
if (path.startsWith(Constants.GOV_REG_PREFIX)) {
path = path.substring(Constants.GOV_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.GOV_FOLDER + path + "/" + fileName);
} else {
path = path.substring(Constants.CONF_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.CONF_FOLDER + path + "/" + fileName);
}
if (!registryResource.exists()) {
mojoInstance.logError("Registry resource " + path + "/" + fileName + " does not exist");
continue;
String commonPath = Paths.get(archiveDirectory, name + "_" + version).toString();
if (artifact.getFirstChildWithName(new QName(Constants.ITEM)) != null) {
OMElement item = getFirstChildWithName(artifact, Constants.ITEM);
String fileName = item.getFirstChildWithName(new QName(Constants.FILE)).getText();
String path = item.getFirstChildWithName(new QName(Constants.PATH)).getText();
File registryResource;
if (path.startsWith(Constants.GOV_REG_PREFIX)) {
path = path.substring(Constants.GOV_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.GOV_FOLDER + path + "/" + fileName);
} else {
path = path.substring(Constants.CONF_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.CONF_FOLDER + path + "/" + fileName);
}
if (!registryResource.exists()) {
mojoInstance.logError("Registry resource " + path + "/" + fileName + " does not exist");
continue;
}
org.wso2.developerstudio.eclipse.utils.file.FileUtils.copy(registryResource,
new File(Paths.get(archiveDirectory, name + "_" + version, Constants.RESOURCES,
fileName).toString()));
OMElement infoElement = getElement(Constants.RESOURCES, Constants.EMPTY_STRING);
infoElement.addChild(item);
org.wso2.developerstudio.eclipse.utils.file.FileUtils.createFile(
new File(commonPath, Constants.REG_INFO_FILE), serialize(infoElement));
} else if (artifact.getFirstChildWithName(new QName(Constants.COLLECTION)) != null) {
OMElement collection = getFirstChildWithName(artifact, Constants.COLLECTION);
String directory = collection.getFirstChildWithName(new QName(Constants.DIRECTORY)).getText();
String path = collection.getFirstChildWithName(new QName(Constants.PATH)).getText();
File registryResource;
if (path.startsWith(Constants.GOV_REG_PREFIX)) {
path = path.substring(Constants.GOV_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.GOV_FOLDER + path);
} else {
path = path.substring(Constants.CONF_REG_PREFIX.length());
registryResource = new File(registryFolder, Constants.CONF_FOLDER + path);
}
if (!registryResource.exists()) {
mojoInstance.logError("Registry resource " + path + " does not exist");
continue;
}

File destFile = new File(Paths.get(archiveDirectory, name + "_" + version, Constants.RESOURCES,
directory).toString());
destFile.mkdirs();
FileUtils.copyDirectory(registryResource, destFile);
OMElement infoElement = getElement(Constants.RESOURCES, Constants.EMPTY_STRING);
infoElement.addChild(collection);
org.wso2.developerstudio.eclipse.utils.file.FileUtils.createFile(
new File(commonPath, Constants.REG_INFO_FILE), serialize(infoElement));
}
dependencies.add(new ArtifactDependency(name, version, Constants.SERVER_ROLE_EI, true));
Artifact artifactObject = new Artifact();
Expand All @@ -247,16 +278,9 @@ void processRegistryResources(File resourcesFolder, String archiveDirectory, Lis
artifactObject.setFile(Constants.REG_INFO_FILE);

String artifactDataAsString = createArtifactData(artifactObject);
String commonPath = Paths.get(archiveDirectory, name + "_" + version).toString();
org.wso2.developerstudio.eclipse.utils.file.FileUtils.createFile(
new File(commonPath, Constants.ARTIFACT_XML), artifactDataAsString);
org.wso2.developerstudio.eclipse.utils.file.FileUtils.copy(registryResource,
new File(Paths.get(archiveDirectory, name + "_" + version, Constants.RESOURCES,
fileName).toString()));
OMElement infoElement = getElement(Constants.RESOURCES, Constants.EMPTY_STRING);
infoElement.addChild(item);
org.wso2.developerstudio.eclipse.utils.file.FileUtils.createFile(
new File(commonPath, Constants.REG_INFO_FILE), serialize(infoElement));

}
} catch (IOException | XMLStreamException | MojoExecutionException e) {
mojoInstance.logError("Error occurred while processing registry resources");
Expand Down Expand Up @@ -469,8 +493,8 @@ void createDependencyArtifactsXmlFile(String archiveDirectory, List<ArtifactDepe
/**
* Method to process class mediators in the project and create corresponding files in the archive directory.
*
* @param dependencies list of dependencies to be added to artifacts.xml file
* @param project VSCode maven project
* @param dependencies list of dependencies to be added to artifacts.xml file
* @param project VSCode maven project
*/
void processClassMediators(List<ArtifactDependency> dependencies, MavenProject project) {
String jarName = project.getArtifactId() + "-" + project.getVersion() + ".jar";
Expand Down Expand Up @@ -511,4 +535,4 @@ private String serialize(OMElement element) throws MojoExecutionException {
protected String getDefaultName() {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class Constants {
static final String NAME = "name";
static final String FILE = "file";
static final String ITEM = "item";
static final String COLLECTION = "collection";
static final String DIRECTORY = "directory";
static final String PATH = "path";
static final String DEPENDENCY = "dependency";
static final String INCLUDE = "include";
Expand All @@ -86,4 +88,4 @@ class Constants {

private Constants() {
}
}
}
2 changes: 1 addition & 1 deletion wso2-esb-api-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>maven-common-tools</artifactId>
<groupId>org.wso2.maven</groupId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion wso2-esb-connector-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>maven-common-tools</artifactId>
<groupId>org.wso2.maven</groupId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion wso2-esb-endpoint-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>maven-common-tools</artifactId>
<groupId>org.wso2.maven</groupId>
<version>5.2.50-SNAPSHOT</version>
<version>5.2.52-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 864c490

Please sign in to comment.