Update Pluggable approach for Mappers and Drivers authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM)
...@@ -91,6 +91,7 @@ Key points: ...@@ -91,6 +91,7 @@ Key points:
1. **Avoid Creating a Dependency-Reduced Pom**: 1. **Avoid Creating a Dependency-Reduced Pom**:
- By default, the Maven Shade Plugin produces a dependency-reduced POM file for the Uber jar and deploys it to the Artifactory. - By default, the Maven Shade Plugin produces a dependency-reduced POM file for the Uber jar and deploys it to the Artifactory.
- The Uber jar already contains all the required dependencies, and this step is not necessary when the Uber jar is not used as a project dependency. - The Uber jar already contains all the required dependencies, and this step is not necessary when the Uber jar is not used as a project dependency.
- Disabling the creation of reduced pom will help to use the original not uber jar as we used to, as direct dependency. Consumers of the original jar will be able to download transitive dependencies.
- To disable this feature, add the following configuration: - To disable this feature, add the following configuration:
~~~ ~~~
<createDependencyReducedPom>false</createDependencyReducedPom> <createDependencyReducedPom>false</createDependencyReducedPom>
...@@ -101,7 +102,7 @@ Key points: ...@@ -101,7 +102,7 @@ Key points:
<shadedArtifactAttached>true</shadedArtifactAttached> <shadedArtifactAttached>true</shadedArtifactAttached>
~~~ ~~~
3. **Add a Classifier**: 3. **Add a Classifier**:
- It's a common practice to use classifiers to distinguish jars. T - It's a common practice to use classifiers to distinguish jars.
- To classify the plugin jar, use the shadedClassifierName property. - To classify the plugin jar, use the shadedClassifierName property.
- https://www.baeldung.com/maven-artifact-classifiers - https://www.baeldung.com/maven-artifact-classifiers
- https://maven.apache.org/plugins/maven-jar-plugin/examples/attached-jar.html - https://maven.apache.org/plugins/maven-jar-plugin/examples/attached-jar.html
...@@ -154,9 +155,14 @@ Key points: ...@@ -154,9 +155,14 @@ Key points:
### 6. Using Uber Jars as Plugins ### 6. Using Uber Jars as Plugins
1. **Download them with Maven** 1. **Download them with Maven**
- In order to run OSDU service locally with plugins it is necessary to have compiled uber jars locally.
~~~ - It is also necessary for a Docker image build.
mvn dependency:copy -DrepoUrl=OSM_PACKAGE_REGISTRY_URL -Dartifact="org.opengroup.osdu:os-osm-postgres:OSM_VERSION:jar:CLASSIFIER" -Dtransitive=false -DoutputDirectory="./tmp" - It's not necessary to upload them into the repository of the project, ci-cd runner will be able to download them as needed during the build.
~~~
mvn dependency:copy \
-DrepoUrl=OSM_PACKAGE_REGISTRY_URL \
-Dartifact="org.opengroup.osdu:os-osm-postgres:OSM_VERSION:jar:CLASSIFIER" \
-Dtransitive=false -DoutputDirectory="./tmp"
~~~ ~~~
2. **Configure for running service locally**. 2. **Configure for running service locally**.
... ...
......