From bd0ce6b9485067934e8632396f073146df0a9510 Mon Sep 17 00:00:00 2001
From: Marek Goldmann <goldmann@fedoraproject.org>
Date: Mon, 30 Jul 2012 13:05:04 +0200
Subject: [PATCH 02/25] Disabled polyglot maven support

---
 .../api/publication/maven/internal/CustomModelBuilder.java     | 10 +++++++---
 .../gradle/api/publication/maven/internal/ModelFactory.java    | 10 +++++++---
 .../maven/internal/pombuilder/CustomModelBuilder.java          |  8 +++++++-
 .../publication/maven/internal/pombuilder/ModelFactory.java    | 10 +++++++---
 4 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/CustomModelBuilder.java b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/CustomModelBuilder.java
index 395033a..70244e4 100644
--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/CustomModelBuilder.java
+++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/CustomModelBuilder.java
@@ -20,19 +20,21 @@ import org.apache.maven.model.Model;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.gradle.api.internal.artifacts.PlexusLoggerAdapter;
 import org.slf4j.LoggerFactory;
+/*
 import org.sonatype.maven.polyglot.execute.ExecuteManager;
 import org.sonatype.maven.polyglot.execute.ExecuteManagerImpl;
 import org.sonatype.maven.polyglot.groovy.builder.ModelBuilder;
-
+*/
 import java.lang.reflect.Field;
 import java.util.Map;
 
 /**
  * This is a slightly modified version as shipped with polyglot Maven.
  */
-public class CustomModelBuilder extends ModelBuilder {
-
+//public class CustomModelBuilder extends ModelBuilder {
+public class CustomModelBuilder {
     public CustomModelBuilder(Model model) {
+        /*
         ExecuteManager executeManager = new ExecuteManagerImpl();
         setProp(executeManager.getClass(), executeManager, "log",
                 new PlexusLoggerAdapter(LoggerFactory.getLogger(ExecuteManagerImpl.class)));
@@ -48,6 +50,8 @@ public class CustomModelBuilder extends ModelBuilder {
         factories.remove("project");
         ModelFactory modelFactory = new ModelFactory(model);
         registerFactory(modelFactory.getName(), null, modelFactory);
+        */
+	throw new UnsupportedOperationException("CustomModelBuilder");
     }
 
     public static void setProp(Class c, Object obj, String fieldName, Object value) {
diff --git a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/ModelFactory.java b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/ModelFactory.java
index 06d6fed..2452868 100644
--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/ModelFactory.java
+++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/ModelFactory.java
@@ -17,26 +17,30 @@ package org.gradle.api.publication.maven.internal;
 
 import groovy.util.FactoryBuilderSupport;
 import org.apache.maven.model.Model;
-import org.sonatype.maven.polyglot.groovy.builder.factory.NamedFactory;
+//import org.sonatype.maven.polyglot.groovy.builder.factory.NamedFactory;
 
 import java.util.Map;
 
 /**
  * This is a slightly modified version as shipped with polyglot Maven.
  */
-public class ModelFactory extends NamedFactory {
+//public class ModelFactory extends NamedFactory {
+public class ModelFactory {
     private Model model;
 
     public ModelFactory(Model model) {
+        /*
         super("project");
         this.model = model;
+        */
+        throw new UnsupportedOperationException("ModelFactory");
     }
 
     public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException {
         return model;
     }
 
-    @Override
+    //@Override
     public void onNodeCompleted(FactoryBuilderSupport builder, Object parent, Object node) {
         Model model = (Model)node;
     }
diff --git a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/CustomModelBuilder.java b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/CustomModelBuilder.java
index e5fe98c..d1dc659 100644
--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/CustomModelBuilder.java
+++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/CustomModelBuilder.java
@@ -23,16 +23,20 @@ import groovy.util.FactoryBuilderSupport;
 import org.apache.maven.model.Model;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.slf4j.LoggerFactory;
+/*
 import org.sonatype.maven.polyglot.execute.ExecuteManager;
 import org.sonatype.maven.polyglot.execute.ExecuteManagerImpl;
 import org.sonatype.maven.polyglot.groovy.builder.ModelBuilder;
+*/
 
 /**
 * This is a slightly modified version as shipped with polyglot Maven.
 */
-public class CustomModelBuilder extends ModelBuilder {
+//public class CustomModelBuilder extends ModelBuilder {
+public class CustomModelBuilder {
 
     public CustomModelBuilder(Model model) {
+       /*
         ExecuteManager executeManager = new ExecuteManagerImpl();
         setProp(executeManager.getClass(), executeManager, "log",
                 new PlexusLoggerAdapter(LoggerFactory.getLogger(ExecuteManagerImpl.class)));
@@ -48,6 +52,8 @@ public class CustomModelBuilder extends ModelBuilder {
         factories.remove("project");
         ModelFactory modelFactory = new ModelFactory(model);
         registerFactory(modelFactory.getName(), null, modelFactory);
+       */
+       throw new UnsupportedOperationException("CustomModelBuilder");
     }
 
     public static void setProp(Class c, Object obj, String fieldName, Object value) {
diff --git a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/ModelFactory.java b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/ModelFactory.java
index f1935f8..10e0549 100644
--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/ModelFactory.java
+++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/pombuilder/ModelFactory.java
@@ -20,24 +20,28 @@ import java.util.Map;
 import groovy.util.FactoryBuilderSupport;
 
 import org.apache.maven.model.Model;
-import org.sonatype.maven.polyglot.groovy.builder.factory.NamedFactory;
+//import org.sonatype.maven.polyglot.groovy.builder.factory.NamedFactory;
 
 /**
  * This is a slightly modified version as shipped with polyglot Maven.
  */
-public class ModelFactory extends NamedFactory {
+//public class ModelFactory extends NamedFactory {
+public class ModelFactory {
     private Model model;
 
     public ModelFactory(Model model) {
+        /*
         super("project");
         this.model = model;
+        */
+        throw new UnsupportedOperationException("ModelFactory");
     }
 
     public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException {
         return model;
     }
 
-    @Override
+    //@Override
     public void onNodeCompleted(FactoryBuilderSupport builder, Object parent, Object node) {
         Model model = (Model) node;
     }
-- 
1.7.11.2

