Package org.wso2.maven.libraries
Class ConnectorConfigReader
- java.lang.Object
-
- org.wso2.maven.libraries.ConnectorConfigReader
-
public class ConnectorConfigReader extends Object
Reads and queriesconnector-config.jsonfrom the project source tree.Expected location:
src/main/wso2mi/resources/connectors/connector-config.jsonrelative to the project base directory.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DependencyOverridefindOverride(ConnectorConfig config, String connectorArtifactId, String connectionType, String groupId, String artifactId)Finds the best-matchingDependencyOverridefor the given dependency.static ConnectorConfigread(String projectBasePath)Reads and parsesconnector-config.jsonfrom the given project base directory.
-
-
-
Method Detail
-
read
public static ConnectorConfig read(String projectBasePath)
Reads and parsesconnector-config.jsonfrom the given project base directory.- Parameters:
projectBasePath- absolute path to the Maven project root (where pom.xml lives)- Returns:
- parsed
ConnectorConfig, ornullif the file does not exist or cannot be parsed
-
findOverride
public static DependencyOverride findOverride(ConnectorConfig config, String connectorArtifactId, String connectionType, String groupId, String artifactId)
Finds the best-matchingDependencyOverridefor the given dependency.Matching priority:
- Match by
connectionTypeif non-null and the override has a matching connectionType. - Match by
groupId + artifactIdif the override has no connectionType but coordinates match.
- Parameters:
config- the parsed connector config (may be null)connectorArtifactId- Maven artifactId of the connector ZIP (e.g. "mi-connector-file")connectionType- connectionType from descriptor.yml (may be null)groupId- dependency groupId from descriptor.ymlartifactId- dependency artifactId from descriptor.yml- Returns:
- the matching override, or
nullif none found
- Match by
-
-