From 01737b9599af35f531e88a6efd58d2cd59f7a953 Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Wed, 10 Jun 2020 11:11:23 +0000 Subject: [PATCH] Experimenting with maven-shade-plugin to create a fat-jar of the postgres dependency. Will have to do this for all plugins. Currently, it's not registering the plugin with the SpringPluginManager --- .../mongoPlugin/plugin.properties | 5 ++ .../appsmith-plugins/mongoPlugin/pom.xml | 56 +++++++++++-------- .../postgresPlugin/plugin.properties | 5 ++ .../appsmith-plugins/postgresPlugin/pom.xml | 44 +++++++++------ .../rapidApiPlugin/plugin.properties | 5 ++ .../appsmith-plugins/rapidApiPlugin/pom.xml | 29 +++++++--- .../restApiPlugin/plugin.properties | 5 ++ .../appsmith-plugins/restApiPlugin/pom.xml | 21 ++++--- app/server/appsmith-server/pom.xml | 5 -- app/server/build.sh | 3 +- 10 files changed, 119 insertions(+), 59 deletions(-) create mode 100644 app/server/appsmith-plugins/mongoPlugin/plugin.properties create mode 100644 app/server/appsmith-plugins/postgresPlugin/plugin.properties create mode 100644 app/server/appsmith-plugins/rapidApiPlugin/plugin.properties create mode 100644 app/server/appsmith-plugins/restApiPlugin/plugin.properties diff --git a/app/server/appsmith-plugins/mongoPlugin/plugin.properties b/app/server/appsmith-plugins/mongoPlugin/plugin.properties new file mode 100644 index 0000000000..d9575483c0 --- /dev/null +++ b/app/server/appsmith-plugins/mongoPlugin/plugin.properties @@ -0,0 +1,5 @@ +plugin.id=mongo-plugin +plugin.class=com.external.plugins.MongoPlugin +plugin.version=1.0-SNAPSHOT +plugin.provider=tech@appsmith.com +plugin.dependencies= \ No newline at end of file diff --git a/app/server/appsmith-plugins/mongoPlugin/pom.xml b/app/server/appsmith-plugins/mongoPlugin/pom.xml index 6fb1791e43..52925e9cc8 100644 --- a/app/server/appsmith-plugins/mongoPlugin/pom.xml +++ b/app/server/appsmith-plugins/mongoPlugin/pom.xml @@ -23,23 +23,19 @@ - - junit - junit - 4.11 - test - org.pf4j pf4j-spring - 0.5.0 + 0.6.0 + provided com.appsmith interfaces 1.0-SNAPSHOT + provided @@ -54,6 +50,14 @@ 3.11.1 + + + junit + junit + 4.11 + test + + io.projectreactor reactor-test @@ -74,28 +78,34 @@ - + - - maven-compiler-plugin - 3.8.1 - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 + maven-shade-plugin + 3.2.4 - - - ${plugin.id} - ${plugin.class} - ${plugin.version} - ${plugin.provider} - ${plugin.dependencies} - - + false + + + + ${plugin.id} + ${plugin.class} + ${plugin.version} + ${plugin.provider} + + + + + + package + + shade + + + diff --git a/app/server/appsmith-plugins/postgresPlugin/plugin.properties b/app/server/appsmith-plugins/postgresPlugin/plugin.properties new file mode 100644 index 0000000000..bfb0b59873 --- /dev/null +++ b/app/server/appsmith-plugins/postgresPlugin/plugin.properties @@ -0,0 +1,5 @@ +plugin.id=postgres-plugin +plugin.class=com.external.plugins.PostgresPlugin +plugin.version=1.0-SNAPSHOT +plugin.provider=tech@appsmith.com +plugin.dependencies= \ No newline at end of file diff --git a/app/server/appsmith-plugins/postgresPlugin/pom.xml b/app/server/appsmith-plugins/postgresPlugin/pom.xml index 5b6cfa4602..359193b386 100644 --- a/app/server/appsmith-plugins/postgresPlugin/pom.xml +++ b/app/server/appsmith-plugins/postgresPlugin/pom.xml @@ -23,23 +23,19 @@ - - junit - junit - 4.11 - test - org.pf4j pf4j-spring - 0.5.0 + 0.6.0 + provided com.appsmith interfaces 1.0-SNAPSHOT + provided @@ -53,6 +49,15 @@ org.postgresql postgresql 42.2.12 + runtime + + + + + junit + junit + 4.11 + test @@ -78,30 +83,37 @@ org.mockito mockito-core 3.1.0 + test - - maven-compiler-plugin - 3.8.1 - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 + maven-shade-plugin + 3.2.4 - + false + + ${plugin.id} ${plugin.class} ${plugin.version} ${plugin.provider} - ${plugin.dependencies} - + + + + + package + + shade + + + diff --git a/app/server/appsmith-plugins/rapidApiPlugin/plugin.properties b/app/server/appsmith-plugins/rapidApiPlugin/plugin.properties new file mode 100644 index 0000000000..0cbda26980 --- /dev/null +++ b/app/server/appsmith-plugins/rapidApiPlugin/plugin.properties @@ -0,0 +1,5 @@ +plugin.id=rapidapi-plugin +plugin.class=com.external.plugins.RapidApiPlugin +plugin.version=1.0-SNAPSHOT +plugin.provider=tech@appsmith.com +plugin.dependencies= \ No newline at end of file diff --git a/app/server/appsmith-plugins/rapidApiPlugin/pom.xml b/app/server/appsmith-plugins/rapidApiPlugin/pom.xml index 32621c6e67..53b788e079 100644 --- a/app/server/appsmith-plugins/rapidApiPlugin/pom.xml +++ b/app/server/appsmith-plugins/rapidApiPlugin/pom.xml @@ -4,6 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.2.RELEASE + + + com.external.plugins rapidApiPlugin 1.0-SNAPSHOT @@ -23,23 +30,19 @@ - - junit - junit - 4.11 - test - org.pf4j pf4j-spring - 0.5.0 + 0.6.0 + provided com.appsmith interfaces 1.0-SNAPSHOT + provided @@ -55,8 +58,20 @@ provided + + + junit + junit + 4.11 + test + + + diff --git a/app/server/appsmith-plugins/restApiPlugin/plugin.properties b/app/server/appsmith-plugins/restApiPlugin/plugin.properties new file mode 100644 index 0000000000..0d4b9e0aa8 --- /dev/null +++ b/app/server/appsmith-plugins/restApiPlugin/plugin.properties @@ -0,0 +1,5 @@ +plugin.id=restapi-plugin +plugin.class=com.external.plugins.RestApiPlugin +plugin.version=1.0-SNAPSHOT +plugin.provider=tech@appsmith.com +plugin.dependencies= \ No newline at end of file diff --git a/app/server/appsmith-plugins/restApiPlugin/pom.xml b/app/server/appsmith-plugins/restApiPlugin/pom.xml index bc166ba399..84f6cda457 100644 --- a/app/server/appsmith-plugins/restApiPlugin/pom.xml +++ b/app/server/appsmith-plugins/restApiPlugin/pom.xml @@ -30,23 +30,19 @@ - - junit - junit - 4.11 - test - org.pf4j pf4j-spring - 0.5.0 + 0.6.0 + provided com.appsmith interfaces 1.0-SNAPSHOT + provided @@ -68,6 +64,13 @@ + + junit + junit + 4.11 + test + + io.projectreactor reactor-test @@ -84,6 +87,10 @@ + diff --git a/app/server/appsmith-server/pom.xml b/app/server/appsmith-server/pom.xml index 6bd5e430c1..c5cbb9ad0b 100644 --- a/app/server/appsmith-server/pom.xml +++ b/app/server/appsmith-server/pom.xml @@ -114,11 +114,6 @@ de.flapdoodle.embed.mongo test - - org.postgresql - postgresql - runtime - com.google.guava guava diff --git a/app/server/build.sh b/app/server/build.sh index b3c0cbf5f4..442f4a482e 100755 --- a/app/server/build.sh +++ b/app/server/build.sh @@ -1,6 +1,7 @@ #!/bin/bash # Remove previous dist directory +rm -rf dist/ # Build the code. $@ accepts all the parameters from the input command line and uses it in the maven build command mvn clean package "$@" @@ -12,7 +13,7 @@ mkdir -p dist/plugins cp ./appsmith-server/target/server-1.0-SNAPSHOT.jar dist/ # Copy all the plugins -cp ./appsmith-plugins/*/target/*.jar dist/plugins/ +rsync -av --exclude "original-*.jar" ./appsmith-plugins/*/target/*.jar dist/plugins/