Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable Maven plugin in Gradle build
diff --git a/0015-Disable-maven-plugin.patch b/0015-Disable-maven-plugin.patch
index bf6ede4..f1fa3c4 100644
--- a/0015-Disable-maven-plugin.patch
+++ b/0015-Disable-maven-plugin.patch
@@ -4,50 +4,10 @@ Date: Sat, 28 Jul 2012 20:20:08 +0200
Subject: [PATCH 15/25] Disable maven plugin
---
- build.gradle | 2 +-
- gradle/publish.gradle | 2 +-
- settings.gradle | 2 +-
subprojects/code-quality/code-quality.gradle | 8 ++++----
- subprojects/cpp/cpp.gradle | 2 +-
subprojects/plugins/plugins.gradle | 4 ++--
- 6 files changed, 10 insertions(+), 10 deletions(-)
+ 2 files changed, 6 insertions(+), 6 deletions(-)
-diff --git a/build.gradle b/build.gradle
-index 4a6af4d..8a6c497 100644
---- a/build.gradle
-+++ b/build.gradle
-@@ -496,7 +496,7 @@ def publishedProjects() {
- }
-
- def pluginProjects() {
-- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'sonar', 'signing', 'cpp', 'ear'].collect {
-+ ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'sonar', 'signing', 'cpp', 'ear'].collect {
- project(it)
- }
- }
-diff --git a/gradle/publish.gradle b/gradle/publish.gradle
-index 0f6e9ae..cd01bbd 100644
---- a/gradle/publish.gradle
-+++ b/gradle/publish.gradle
-@@ -1,4 +1,4 @@
--apply plugin: 'maven'
-+//apply plugin: 'maven'
-
- configurations {
- publishCompile
-diff --git a/settings.gradle b/settings.gradle
-index 2e16d21..4f092e6 100644
---- a/settings.gradle
-+++ b/settings.gradle
-@@ -23,7 +23,7 @@ include 'plugins'
- include 'scala'
- include 'ide'
- include 'osgi'
--include 'maven'
-+//include 'maven'
- include 'announce'
- include 'jetty'
- include 'codeQuality'
diff --git a/subprojects/code-quality/code-quality.gradle b/subprojects/code-quality/code-quality.gradle
index 509652d..71702ea 100644
--- a/subprojects/code-quality/code-quality.gradle
@@ -67,19 +27,6 @@ index 509652d..71702ea 100644
}
useTestFixtures()
-diff --git a/subprojects/cpp/cpp.gradle b/subprojects/cpp/cpp.gradle
-index b2b4296..86802cd 100644
---- a/subprojects/cpp/cpp.gradle
-+++ b/subprojects/cpp/cpp.gradle
-@@ -19,7 +19,7 @@ dependencies {
- compile project(':core')
- compile project(":plugins")
- compile project(":ide")
-- integTestRuntime project(":maven")
-+// integTestRuntime project(":maven")
- }
-
- useTestFixtures()
diff --git a/subprojects/plugins/plugins.gradle b/subprojects/plugins/plugins.gradle
index 5a4ee68..a88722a 100644
--- a/subprojects/plugins/plugins.gradle
diff --git a/0016-Disable-signing-plugin.patch b/0016-Disable-signing-plugin.patch
index d9798f8..0c25ecc 100644
--- a/0016-Disable-signing-plugin.patch
+++ b/0016-Disable-signing-plugin.patch
@@ -16,8 +16,8 @@ index 8a6c497..6d81d52 100644
}
def pluginProjects() {
-- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'sonar', 'signing', 'cpp', 'ear'].collect {
-+ ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'sonar', 'cpp', 'ear'].collect {
+- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'sonar', 'signing', 'cpp', 'ear'].collect {
++ ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'sonar', 'cpp', 'ear'].collect {
project(it)
}
}
diff --git a/0017-Disable-sonar-plugin.patch b/0017-Disable-sonar-plugin.patch
index c6c7ff9..b801e6e 100644
--- a/0017-Disable-sonar-plugin.patch
+++ b/0017-Disable-sonar-plugin.patch
@@ -16,8 +16,8 @@ index 6d81d52..1a5aada 100644
}
def pluginProjects() {
-- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'sonar', 'cpp', 'ear'].collect {
-+ ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'cpp', 'ear'].collect {
+- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'sonar', 'cpp', 'ear'].collect {
++ ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'cpp', 'ear'].collect {
project(it)
}
}
diff --git a/0026-Disable-jetty-plugin.patch b/0026-Disable-jetty-plugin.patch
index 546a9de..f30f017 100644
--- a/0026-Disable-jetty-plugin.patch
+++ b/0026-Disable-jetty-plugin.patch
@@ -5,7 +5,7 @@ diff -Nru gradle-1.0/build.gradle gradle-1.0-gil/build.gradle
}
def pluginProjects() {
-- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'cpp', 'ear'].collect {
+- ['plugins', 'codeQuality', 'jetty', 'antlr', 'wrapper', 'osgi', 'maven', 'ide', 'announce', 'scala', 'cpp', 'ear'].collect {
+ ['plugins', 'codeQuality', 'antlr', 'wrapper', 'osgi', 'ide', 'announce', 'scala', 'cpp', 'ear'].collect {
project(it)
}
@@ -15,7 +15,7 @@ diff -Nru gradle-1.0/settings.gradle gradle-1.0-gil/settings.gradle
+++ gradle-1.0-gil/settings.gradle 2012-08-01 10:38:17.745472738 +0200
@@ -25,7 +25,7 @@
include 'osgi'
- //include 'maven'
+ include 'maven'
include 'announce'
-include 'jetty'
+//include 'jetty'
diff --git a/gradle-1.0-build.xml b/gradle-1.0-build.xml
index 7e31ce9..fae8744 100644
--- a/gradle-1.0-build.xml
+++ b/gradle-1.0-build.xml
@@ -320,7 +320,7 @@
<fileset dir="/usr/share/java" includes="maven/maven-compat.jar"/>
<fileset dir="/usr/share/java" includes="maven/maven-artifact.jar"/>
<!--fileset dir="/usr/share/java" includes="maven2/maven-artifact-manager.jar"/-->
- <fileset dir="/usr/share/java" includes="maven2/maven-error-diagnostics.jar"/>
+ <fileset dir="/usr/share/java" includes="maven/maven-error-diagnostics.jar"/>
<fileset dir="/usr/share/java" includes="maven/maven-model.jar"/>
<!--fileset dir="/usr/share/java" includes="maven2/maven-project.jar"/-->
<fileset dir="/usr/share/java" includes="maven/maven-core.jar"/>
@@ -331,6 +331,7 @@
<fileset dir="/usr/share/java" includes="plexus/containers-container-default.jar"/>
<fileset dir="/usr/share/java" includes="plexus/classworlds.jar"/>
<fileset dir="/usr/share/java" includes="plexus/interpolation.jar"/>
+ <fileset dir="/usr/share/java" includes="plexus/utils.jar"/>
</path>
<path id="native.classpath">
@@ -467,7 +468,7 @@
<!--FIXME see GRADLE-2210 build.maven, depend on gradle maven plugin,build.signing-->
<!--FIXME ,build.signing depend on gradle maven plugin-->
<target name="build"
- depends="build.open-api,build.cli,build.base-services,build.native,build.core,build.wrapper,build.core-impl,build.ui,build.tooling-api,build.plugins,build.launcher,build.antlr,build.code-quality,build.announce,build.scala,build.ear,build.ide,build.cpp" description="Compile the sources">
+ depends="build.open-api,build.cli,build.base-services,build.native,build.core,build.wrapper,build.core-impl,build.ui,build.tooling-api,build.plugins,build.launcher,build.antlr,build.code-quality,build.announce,build.scala,build.ear,build.ide,build.maven,build.cpp" description="Compile the sources">
</target>
<target name="build.announce" description="Build Gradle announce">
@@ -614,7 +615,7 @@
<!-- gradle-maven,gradle-sonar,gradle-jetty -->
<propertyfile file="${core.build.dir}/gradle-plugins.properties" comment="module definition">
- <entry key="plugins" value="gradle-plugins,gradle-code-quality,gradle-antlr,gradle-wrapper,gradle-osgi,gradle-ide,gradle-announce,gradle-scala,gradle-signing,gradle-cpp,gradle-ear"/>
+ <entry key="plugins" value="gradle-plugins,gradle-code-quality,gradle-antlr,gradle-wrapper,gradle-osgi,gradle-maven,gradle-ide,gradle-announce,gradle-scala,gradle-signing,gradle-cpp,gradle-ear"/>
</propertyfile>
<jar-and-manifest
@@ -775,7 +776,7 @@
<set-propertyfile
destfile="${maven.build.dir}/gradle-maven-classpath.properties"
projects="gradle-core,gradle-core-impl,gradle-plugins"
- runtime="slf4j-api-1.6.4.jar,maven-ant-tasks-2.1.3.jar,plexus-component-annotations-1.5.2.jar,groovy-all-1.8.6.jar,commons-cli-1.2.jar,antlr-2.7.7.jar,asm-all-3.3.1.jar,ant-1.8.2.jar,aether-api.jar,aether-util.jar,maven-compat.jar,maven-core.jar,maven-artifact.jar,maven-error-diagnostics.jar,maven-model.jar,maven-settings.jar,maven-settings-builder.jar,wagon-provider-api.jar,plexus-component-api.jar,plexus-container-default.jar,plexus-classworlds.jar,plexus-interpolation.jar" />
+ runtime="slf4j-api-1.6.4.jar,maven-ant-tasks-2.1.3.jar,plexus-component-annotations-1.5.2.jar,groovy-all-1.8.6.jar,commons-cli-1.2.jar,antlr-2.7.7.jar,asm-all-3.3.1.jar,ant-1.8.2.jar,aether-api.jar,aether-util.jar,maven-compat.jar,maven-core.jar,maven-artifact.jar,maven-error-diagnostics.jar,maven-model.jar,maven-settings.jar,maven-settings-builder.jar,wagon-provider-api.jar,plexus-component-api.jar,plexus-container-default.jar,plexus-classworlds.jar,plexus-interpolation.jar,plexus-utils.jar" />
<jar-and-manifest
basedir="${maven.build.dir}"
diff --git a/gradle.spec b/gradle.spec
index 876a225..bbbdc7b 100644
--- a/gradle.spec
+++ b/gradle.spec
@@ -78,7 +78,7 @@ Patch12: 0013-Add-proper-checkstyle-dependencies.patch
Patch13: 0014-Add-proper-codenarc-dependencies.patch
# disable this modules for unavailable build deps
# depend on maven2
-Patch14: 0015-Disable-maven-plugin.patch
+#Patch14: 0015-Disable-maven-plugin.patch
# depend on gradle-maven module
Patch15: 0016-Disable-signing-plugin.patch
# disable. require sonar http://www.sonarsource.org/
@@ -229,16 +229,16 @@ Requires: maven
# BuildRequires: bsh2 already packaged
BuildRequires: maven-ant-tasks
# BuildRequires: maven-artifact-manager
-# BuildRequires: maven-error-diagnostics
+BuildRequires: maven-error-diagnostics
# BuildRequires: maven-model
# BuildRequires: maven-project
-# BuildRequires: maven-wagon
+BuildRequires: maven-wagon
Requires: maven-ant-tasks
# Requires: maven-artifact-manager
-# Requires: maven-error-diagnostics
+Requires: maven-error-diagnostics
# Requires: maven-model
# Requires: maven-project
-# Requires: maven-wagon
+Requires: maven-wagon
Requires: objectweb-asm
Requires: plexus-classworlds
@@ -295,7 +295,7 @@ cat gradlew >> gradle.sh
%patch11 -p1
%patch12 -p1
%patch13 -p1
-%patch14 -p1
+#%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
@@ -354,7 +354,7 @@ sed -i "s|cglib-nodep|cglib|" buildSrc/build.gradle
sed -i "s|bndlib|aqute-bnd|" subprojects/osgi/osgi.gradle
sed -i "s|plexus/container-default|plexus/containers-container-default|" subprojects/core-impl/core-impl.gradle
-gradle --full-stacktrace antlr:jar baseServices:jar cli:jar codeQuality:jar announce:jar core:jar coreImpl:jar cpp:jar ear:jar ide:jar launcher:jar launcher:startScripts native:jar openApi:jar plugins:jar osgi:jar scala:jar toolingApi:jar ui:jar wrapper:jar \
+gradle --full-stacktrace antlr:jar baseServices:jar cli:jar codeQuality:jar announce:jar core:jar coreImpl:jar cpp:jar ear:jar maven:jar ide:jar launcher:jar launcher:startScripts native:jar openApi:jar plugins:jar osgi:jar scala:jar toolingApi:jar ui:jar wrapper:jar \
-g $PWD/gradlehome -b $PWD/build.gradle
%endif
@@ -378,7 +378,7 @@ for m in base-services cli core launcher native open-api tooling-api ui wrapper;
install -pm 644 dist/lib/gradle-${m}-%{namedversion}.jar %{buildroot}%{_datadir}/%{name}/lib/gradle-${m}-%{namedversion}.jar
done
-for m in announce antlr code-quality core-impl cpp ear ide plugins scala; do
+for m in announce antlr code-quality core-impl cpp ear maven ide plugins scala; do
install -pm 644 dist/lib/plugins/gradle-${m}-%{namedversion}.jar %{buildroot}%{_datadir}/%{name}/lib/plugins/gradle-${m}-%{namedversion}.jar
done
@@ -452,6 +452,7 @@ ln -sf $(build-classpath maven/maven-core) %{buildroot}%{_datadir}/%{name}/lib/p
# java.lang.ClassNotFoundException: org.sonatype.aether.* aether-api.jar,aether-util.jar
ln -sf $(build-classpath aether/api) %{buildroot}%{_datadir}/%{name}/lib/plugins/aether-api.jar
ln -sf $(build-classpath aether/util) %{buildroot}%{_datadir}/%{name}/lib/plugins/aether-util.jar
+ln -sf $(build-classpath maven/maven-error-diagnostics) %{buildroot}%{_datadir}/%{name}/lib/plugins/maven-error-diagnostics.jar
ln -sf $(build-classpath maven/maven-model) %{buildroot}%{_datadir}/%{name}/lib/plugins/maven-model.jar
ln -sf $(build-classpath maven/maven-settings) %{buildroot}%{_datadir}/%{name}/lib/plugins/maven-settings.jar
ln -sf $(build-classpath maven/maven-settings-builder) %{buildroot}%{_datadir}/%{name}/lib/plugins/maven-settings-builder.jar
@@ -463,6 +464,7 @@ ln -sf $(build-classpath plexus/containers-component-annotations) %{buildroot}%{
ln -sf $(build-classpath plexus/utils) %{buildroot}%{_datadir}/%{name}/lib/plugins/plexus-utils.jar
ln -sf $(build-classpath snakeyaml) %{buildroot}%{_datadir}/%{name}/lib/plugins/snakeyaml-1.6.jar
ln -sf $(build-classpath testng) %{buildroot}%{_datadir}/%{name}/lib/plugins/testng-6.3.1.jar
+ln -sf $(build-classpath maven-wagon/provider-api.jar) %{buildroot}%{_datadir}/%{name}/lib/plugins/wagon-provider-api.jar
mkdir -p %{buildroot}%{_bindir}
install -pm 755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment