You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien HENRY <he...@yahoo.fr> on 2010/03/08 12:02:55 UTC

Re : How to differentiate between pom.xml and ant's build file

Hi,

You could try an XML validation using Maven XSD (http://maven.apache.org/maven-v4_0_0.xsd). If the validation is ok => this is a valid POM. If the validation is ko... it can be anything else.

Regards,

Julien



----- Message d'origine ----
> De : amaresh mourya <am...@gmail.com>
> À : Maven Users List <us...@maven.apache.org>
> Envoyé le : Lun 8 Mars 2010, 11 h 40 min 05 s
> Objet : How to differentiate between pom.xml and ant's build file
> 
> Hi All,
> I want to write a recognizer class which takes input any xml file and
> returns true or false based on , whether or not the xml is POM.
> 
> Problem : Since Ant's build file and POM both have root element
> with/without Namespace.
> 
> I don't want POM Name to be restricted to just "pom.xml", this could be
> anything say "myproj.xml" etc. Still I want this "myProj.xml" to be
> recognized as POM with above Recognizer class.
> 
> Can same one suggest me the conditions to differentiate between them.



      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re : Re : How to differentiate between pom.xml and ant's build file

Posted by Julien HENRY <he...@yahoo.fr>.
Are you sure namespace is required to perform validation? What are you using?

See http://java.sun.com/developer/technicalArticles/xml/validationxpath/ for an example of XSD validation. There is no namespace in the XML document.


Regards,

Julien


----- Message d'origine ----
> De : amaresh mourya <am...@gmail.com>
> À : Maven Users List <us...@maven.apache.org>
> Envoyé le : Lun 8 Mars 2010, 12 h 18 min 14 s
> Objet : Re: Re : How to differentiate between pom.xml and ant's build file
> 
> Hi All,
> Thanks for your replies.
> I tried validation with XSD(http://maven.apache.org/maven-v4_0_0.xsd).but It
> fails since the namespace is missing.
> 
> I think any xml could still be POM if it doesn't have namespace as I have
> seen many pom.xml without schema.
> 
> thanks
> Amaresh
> 
> On Mon, Mar 8, 2010 at 4:32 PM, Julien HENRY wrote:
> 
> > Hi,
> >
> > You could try an XML validation using Maven XSD (
> > http://maven.apache.org/maven-v4_0_0.xsd). If the validation is ok => this
> > is a valid POM. If the validation is ko... it can be anything else.
> >
> > Regards,
> >
> > Julien
> >
> >
> >
> > ----- Message d'origine ----
> > > De : amaresh mourya 
> > > À : Maven Users List 
> > > Envoyé le : Lun 8 Mars 2010, 11 h 40 min 05 s
> > > Objet : How to differentiate between pom.xml and ant's build file
> > >
> > > Hi All,
> > > I want to write a recognizer class which takes input any xml file and
> > > returns true or false based on , whether or not the xml is POM.
> > >
> > > Problem : Since Ant's build file and POM both have root element
> > > with/without Namespace.
> > >
> > > I don't want POM Name to be restricted to just "pom.xml", this could be
> > > anything say "myproj.xml" etc. Still I want this "myProj.xml" to be
> > > recognized as POM with above Recognizer class.
> > >
> > > Can same one suggest me the conditions to differentiate between them.
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >



      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Re : How to differentiate between pom.xml and ant's build file

Posted by Ryan Connolly <ry...@gmail.com>.
Just a guess but if you arent so much concerned with validation maybe a
successful use of MavenXpp3Reader to get a Model instance from an XML file
would indicate a good pom whereas an unsuccessful attempt may imply an ant
build?

On Mar 8, 2010 6:18 AM, "amaresh mourya" <am...@gmail.com> wrote:

Hi All,
Thanks for your replies.
I tried validation with XSD(http://maven.apache.org/maven-v4_0_0.xsd).but It
fails since the namespace is missing.

I think any xml could still be POM if it doesn't have namespace as I have
seen many pom.xml without schema.

thanks
Amaresh


On Mon, Mar 8, 2010 at 4:32 PM, Julien HENRY <he...@yahoo.fr> wrote:

> Hi,
>
> You could try an ...

Re: Re : How to differentiate between pom.xml and ant's build file

Posted by amaresh mourya <am...@gmail.com>.
Hi All,
Thanks for your replies.
I tried validation with XSD(http://maven.apache.org/maven-v4_0_0.xsd).but It
fails since the namespace is missing.

I think any xml could still be POM if it doesn't have namespace as I have
seen many pom.xml without schema.

thanks
Amaresh

On Mon, Mar 8, 2010 at 4:32 PM, Julien HENRY <he...@yahoo.fr> wrote:

> Hi,
>
> You could try an XML validation using Maven XSD (
> http://maven.apache.org/maven-v4_0_0.xsd). If the validation is ok => this
> is a valid POM. If the validation is ko... it can be anything else.
>
> Regards,
>
> Julien
>
>
>
> ----- Message d'origine ----
> > De : amaresh mourya <am...@gmail.com>
> > À : Maven Users List <us...@maven.apache.org>
> > Envoyé le : Lun 8 Mars 2010, 11 h 40 min 05 s
> > Objet : How to differentiate between pom.xml and ant's build file
> >
> > Hi All,
> > I want to write a recognizer class which takes input any xml file and
> > returns true or false based on , whether or not the xml is POM.
> >
> > Problem : Since Ant's build file and POM both have root element
> > with/without Namespace.
> >
> > I don't want POM Name to be restricted to just "pom.xml", this could be
> > anything say "myproj.xml" etc. Still I want this "myProj.xml" to be
> > recognized as POM with above Recognizer class.
> >
> > Can same one suggest me the conditions to differentiate between them.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>