geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet" <gno...@gmail.com>
Subject Re: Car plugin
Date Tue, 22 Aug 2006 14:38:15 GMT
Here is my diff, so that hopefully if will make things clearer.
But i really think this is more of a hack than a clean way to solve the
differences between the schemas ;)

Index: src/main/java/org/apache/geronimo/plugin/car/PlanProcessorMojo.java
===================================================================
--- src/main/java/org/apache/geronimo/plugin/car/PlanProcessorMojo.java
(revision 432624)
+++ src/main/java/org/apache/geronimo/plugin/car/PlanProcessorMojo.java
(working copy)
@@ -61,7 +61,7 @@
{
     private static final String ENVIRONMENT_LOCAL_NAME = "environment";

-    private static final QName ENVIRONMENT_QNAME = new QName("
http://geronimo.apache.org/xml/ns/deployment-1.2", "environment");
+    private static final String ENVIRONMENT_URI_PREFIX = "
http://geronimo.apache.org/xml/ns/deployment-";

     /**
      * @parameter expression="${basedir}/src/plan"
@@ -86,7 +86,13 @@
      * @required
      */
     private File targetFile;
-
+
+    /**
+     * @parameter expression="1.2"
+     * @required
+     */
+    private String geronimoVersion;
+
     private VelocityContext createContext() {
         VelocityContext context = new VelocityContext();

@@ -157,9 +163,11 @@
         xmlCursor.toFirstChild();
         QName childName = xmlCursor.getName();
         Environment oldEnvironment;
+
+        QName environmentQName = new QName(ENVIRONMENT_URI_PREFIX +
geronimoVersion, ENVIRONMENT_LOCAL_NAME);

         if (childName != null &&
childName.getLocalPart().equals(ENVIRONMENT_LOCAL_NAME))
{
-            convertElement(xmlCursor, ENVIRONMENT_QNAME.getNamespaceURI());
+            convertElement(xmlCursor, environmentQName.getNamespaceURI());
             XmlObject xmlObject = xmlCursor.getObject();
             EnvironmentType environmentType = (EnvironmentType)
xmlObject.copy().changeType(EnvironmentType.type);
             oldEnvironment = EnvironmentBuilder.buildEnvironment
(environmentType);
@@ -176,7 +184,7 @@
         EnvironmentBuilder.mergeEnvironments(oldEnvironment,
newEnvironment);
         EnvironmentType environmentType =
EnvironmentBuilder.buildEnvironmentType(oldEnvironment);

-        xmlCursor.beginElement(ENVIRONMENT_QNAME);
+        xmlCursor.beginElement(environmentQName);
         XmlCursor element = environmentType.newCursor();

         try {


On 8/22/06, ian.d.stewart@jpmchase.com <ian.d.stewart@jpmchase.com> wrote:
> If the only difference is the target version of the build, I'm not seeing
a
> need to fork.  You should be able to use profiles
> (http://maven.apache.org/guides/introduction/introduction-to-profiles.html
)
> to specify version-specific dependencies without the need to modify the
> source.  I see this as being analagous to building with different JDK
> versions.
>
> I apologize if there is something I'm missing that makes this more complex
> than it seems.
>
>
> Ian
>
> It's better to be hated for who you are
> than loved for who you're not
>
> Ian D. Stewart
> Distributed Computing Engineer II
> DSS eCommerce Engineering
> JPMorganChase Global Technology Infrastructure
> Phone: (614) 244-2564
>
>
>
>              "Guillaume Nodet"
>              <gnodet@gmail.com
>              >                                                          To
>                                        dev@geronimo.apache.org
>              08/22/2006 10:08                                           cc
>              AM
>                                                                    Subject
>                                        Re: Car plugin
>              Please respond to
>              dev@geronimo.apac
>                   he.org
>
>
>
>
>
>
>
> On 8/22/06, Aaron Mulder <ammulder@alumni.princeton.edu> wrote:
> > On 8/22/06, David Jencks <david_jencks@yahoo.com> wrote:
> > > I'm not sure anyone thought of this use case: I certainly didn't.
> > > Did you find that a small change makes the trunk car plugin work with
> > > 1.1?  If so I'm certainly willing to consider trying to maintain
> > > compatibility.
> >
> > They certainly have -- I've asked about this before.  I specifically
> > asked to have a working car-maven-plugin along with any reuqired G
> > libs saved as a new version so we could refer to that version
> > eternally and not have to worry about upgrades causing problems.
> > Jason said he couldn't do it but he was going to publish a new
> > snapshot...
> >
> > > We could also maybe put a tiny m2 project in branches/1.1 with a
> > > version of this plugin that works with 1.1
> >
> > I think the problem is not so much the plugin itself, as the fact that
> > the plugin is built against G 1.2 JARs (for the kernel and system
> > modules, etc.).
>
> Yeah, I know, but is there any other way to deal with that, but forking
> the plugin and build one version against G 1.1 jars ?
>
> >
> > I think any problem with the deployer can be avoided by specifying the
> > correct set of dependencies and configuration info in the project POM
> > (to force it to use only 1.1 JARs/CARs and the 1.1 deployer GBean).
> > But if any of the kernel/system interfaces changed, that would
> > probably stop working.
>
> Actually, that' s the main problem.
>
> Maybe it would be wiser to fork it.
> This would also allow to release one version of the m2 plugin for 1.1asap.
>
> >
> > Thanks,
> >      Aaron
> >
> > > >
> > > >>
> > > >> Adding a property to specify the target geronimo version seems to
> > > >> do the trick.
> > > >> So i can now have:
> > > >>
> > > >> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
> > > >>   <environment>
> > > >>
> > > >> instead of
> > > >>
> > > >> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
> > > >>   <environment xmlns="http://geronimo.apache.org/xml/ns/
> > > >> deployment-1.2">
> > > >>
> > > >> Btw, I' m wondering why the PlanProcessorMojo only overrides the
> > > >> environmnet
> > > >> tag, and not the module one.
> > > >>
> > > >>
> > > >> On 8/22/06, Jacek Laskowski <jacek@laskowski.net.pl> wrote:
> > > >> > On 8/22/06, Guillaume Nodet <gnodet@gmail.com> wrote:
> > > >> > > I recently experienced some problems [1] when building
> > > >> Geronimo 1.1
> > > >> > > plugins using
> > > >> > > the car-maven-plugin.
> > > >> >
> > > >> > I think a solution may be to build the maven plugin locally from
> > > >> 1.1
> > > >> > sources and build Geronimo 1.1 then. It seems you've been trying
> to
> > > >> > run the build online and thus all the deps (the maven plugin
> > > >> > including) is pulled down too. For it's an incompatible version,
> > > >> the
> > > >> > build blows up.
> > > >> >
> > > >> > Just a wild guess, but may be of help. Report back! ;-)
> > > >> >
> > > >> > Jacek
> > > >> >
> > > >> > --
> > > >> > Jacek Laskowski
> > > >> > http://www.laskowski.net.pl
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> Cheers,
> > > >> Guillaume Nodet
> > > >>
> > > >
> > > >
> > > > --
> > > > Cheers,
> > > > Guillaume Nodet
> > >
> > >
> >
>
>
> --
> Cheers,
> Guillaume Nodet
>
>
>
> -----------------------------------------
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law.  If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED.  Although this transmission and
> any attachments are believed to be free of any virus or other
> defect that might affect any computer system into which it is
> received and opened, it is the responsibility of the recipient to
> ensure that it is virus free and no responsibility is accepted by
> JPMorgan Chase & Co., its subsidiaries and affiliates, as
> applicable, for any loss or damage arising in any way from its use.
> If you received this transmission in error, please immediately
> contact the sender and destroy the material in its entirety,
> whether in electronic or hard copy format. Thank you.
>
>


-- 
Cheers,
Guillaume Nodet

Mime
View raw message