commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukas Theussl (JIRA)" <commons-...@jakarta.apache.org>
Subject [jira] Commented: (JELLY-230) Problem with default namespace in imported scripts
Date Wed, 21 Jun 2006 22:47:31 GMT
    [ http://issues.apache.org/jira/browse/JELLY-230?page=comments#action_12417207 ] 

Lukas Theussl commented on JELLY-230:
-------------------------------------

Ok, I have to correct myself twice :(

First, the dummy namespace does have a special treatment in maven, it gets excluded in the
startPrefixMapping() method of PluginScriptParser.java.
Second, I did get the replaceNamespace tag to work: I had to wrap it around the j:import:

<j:file name="build.xml" prettyPrint="true">
  <x:replaceNamespace fromURI="dummy" toURI="">
    <j:import file="templates/build.jelly" inherit="true"/>
  </x:replaceNamespace>
</j:file>

That means that this looks like its doable for us, even though not very convenient. We'd have
to republish a number of plugins that we just released recently, with only minor modifications
and dependency upgrades, and they will all be incompatible with Maven 1.0. Prerequisite for
all that is that you get me a new release of jelly-core and taglib-xml out ASAP. :)

Playing around with it today, I found another issue: the xml:parse tag doesn't seem to work
properly if the parsed xml has a namespace declaration in it's top element. I didn't investigate
any further for now, just wanted to know if this is a known issue or if I'm missing something
again.

> Problem with default namespace in imported scripts
> --------------------------------------------------
>
>          Key: JELLY-230
>          URL: http://issues.apache.org/jira/browse/JELLY-230
>      Project: Commons Jelly
>         Type: Bug

>   Components: core / taglib.core
>     Versions: 1.1
>  Environment: jelly-1.1-SNAPSHOT
>     Reporter: Lukas Theussl
>     Assignee: james strachan
>     Priority: Critical

>
> I am trying to build Maven with jelly-1.1-SNAPSHOT from svn trunk because it contains
a fix for a regression that has blocked us for a long time, see
> http://jira.codehaus.org/browse/MAVEN-1691 (gee, I wish I'd checked the svn archives
earlier!).
> However, even though jelly-1.1-SNAPSHOT solves the above issue, it also leads to a whole
bunch of test failures in several of our plugins.
> After some investigation I found that they all turn out to be due to the same cause,
an apparent backwards incompatibility introduced in the fix for JELLY-213.
> I am not sure actually if this is a bug or the intended behavior, but it certainly breaks
backwards compatibility.
> To illustrate the problem: in the ant plugin we use the following snippet to generate
an ant build.xml file from a template:
> <j:file name="build.xml" prettyPrint="true">
>   <j:import file="templates/build.jelly" inherit="true"/>
> </j:file>
> where the template file build.jelly looks like this (simplified):
> <j:jelly
>   xmlns:ant="jelly:ant"
>   xmlns:j="jelly:core" 
>   xmlns="dummy">
>   <project name="${pom.artifactId}" default="jar" basedir=".">
>       <target name="clean" description="Clean up">
>         <delete dir="$${defaulttargetdir}"/>
>         <delete dir="$${distdir}"/>
>       </target>
>   </project>
> </j:jelly>
> Note the xmlns="dummy" namespace declaration which is necessary to distinguish the default
namespace of the template script from Maven's default namespace. Now with jelly-1.0, this
works as expected, but with the current jelly-1.1-SNAPSHOT, I get:
> <project xmlns="dummy" name="test-maven-ant-plugin" default="jar" basedir=".">
>   <target description="Clean up" name="clean">
>     <delete dir="${defaulttargetdir}">
>     </delete>
>     <delete dir="${distdir}">
>     </delete>
>   </target>
> <project>
> ie the dummy namespace declaration makes it into the top-level element of the generated
file. This makes ant very unhappy when invoked on this build file...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message