You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mi...@swissre.com on 2004/05/17 11:24:49 UTC

Again about the POM Parser in Maven 1

Thanks for the hint to point to MavenUtils, I played around a bit with that
class, using a know working project.xml. I wrote a small test

public class PomParserTest extends TestCase {

  public void setUp() throws Exception {

  }

  public void testPomParserDoesStuff() throws Exception {


    String s = "./test_src/project.xml";
    File f=new File(s);
    if (f.exists()){
            Project p=MavenUtils.getProject(f);
            System.out.println("OK");
    }
      else{
            System.out.println("no file present");
      }

  }

}

but unfortunately I always get the same error :

    5779|ERROR|[main      ]|      |org.apache.commons.digester.Digester
- Body event threw exception
java.lang.IllegalStateException: either id or (groupId and artifactId) must
be provided for a dependency
      at org.apache.maven.project.Dependency.getId(Dependency.java:116)
      at org.apache.maven.project.Dependency.toString(Dependency.java:313)
      at java.lang.String.valueOf(String.java:2177)
      at java.lang.StringBuffer.append(StringBuffer.java:361)
      at
org.apache.commons.betwixt.expression.MethodUpdater.update(MethodUpdater.java:135)
      at
org.apache.commons.betwixt.io.BeanCreateRule$1.body(BeanCreateRule.java:584)
      at org.apache.commons.digester.Rule.body(Rule.java:240)
      at
org.apache.commons.digester.Digester.endElement(Digester.java:1034)

the corresponding POM Dependency is

      <dependency>
            <groupId>sje</groupId>
            <artifactId>sje-config</artifactId>
            <version>1.0.0</version>
            <properties>
                      <ejb.manifest.classpath>true</ejb.manifest.classpath>
                      <war.bundle>false</war.bundle>
                  <war.manifest.classpath>true</war.manifest.classpath>
                     <ear.bundle>false</ear.bundle>
             </properties>
      </dependency>

That one exists in my local and remote repository,
I tried to change project.xml but always fails at the first dependency.  I
also tried to change maven.jar to an older version but I always got the
same problem.

 Is there something I am doing wrong ?  do I need to set something before ?
is that not the correct way to use the API ?

Any help is welcome

Regards

Michele



|---------+-------------------------------->
|         |           Trygve Laugstøl      |
|         |           <trygvela@student.mat|
|         |           nat.uio.no>          |
|         |                                |
|         |                                |
|         |           14/05/2004 13:49     |
|         |           Please respond to    |
|         |           "Maven Users List"   |
|         |                                |
|---------+-------------------------------->
  >------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                              |
  |                                                                                                                              |
  |                                                                                                                              |
  |                                                                                                                              |
  |                                                                                                                              |
  |        To:                                         Maven Users List <us...@maven.apache.org>                                 |
  |        cc:                                         (bcc: Michele Forte/SwissRe)                                              |
  |        bcc:                                        Michele Forte/SwissRe                                                     |
  |        Subject:                                    Re: POM Parser                                                            |
  >------------------------------------------------------------------------------------------------------------------------------|




This is the one that maven itself uses:

  http://maven.apache.org/xref/org/apache/maven/MavenUtils.html#106

On Fri, 14 May 2004 13:37:01 +0200, <Mi...@swissre.com> wrote:

> Thanks for the quick answer, Michal. In reality I just wanted to use the
> same parser as it is used now by the rc2, I have the impression that this
> done using a sax approach, but I am not sure which one is the class you
> are
> using in the current maven module. in particular in the bootstrap
> directory
> there is something like
> BootstrapPOMParser, but looking into the code I am not sure that it
> supports POM inheritance, that is in reality my doubt, and consequent
> question.
>
> Regards
>
> Michele
>
>
> |---------+---------------------------->
> |         |           Maczka Michal    |
> |         |           <michal.maczka@im|
> |         |           tf.ch>           |
> |         |                            |
> |         |                            |
> |         |           14/05/2004 13:22 |
> |         |           Please respond to|
> |         |           "Maven Users     |
> |         |           List"            |
> |         |                            |
> |---------+---------------------------->
>   >
------------------------------------------------------------------------------------------------------------------------------|

>   |

> |
>   |

> |
>   |

> |
>   |

> |
>   |

> |
>   |        To:                                         "'Maven Users
> List'" <us...@maven.apache.org>                             |
>   |        cc:                                         (bcc: Michele
> Forte/SwissRe)                                              |
>   |        bcc:                                        Michele
> Forte/SwissRe                                                     |
>   |        Subject:                                    RE: POM
> Parser                                                            |
>   >
------------------------------------------------------------------------------------------------------------------------------|

>
>
>
>
> The code you are refering to is a part of maven2 code base.
> It hasn't yet even reached alpha stage and it is not ready for public
> consumption
> (everyday there are some changes in the api).
>
> What you are trying to do (perstist POMs in the database) is also in our
> plans.
>
> So we cannot offer any direct help at the moment...
>
> regrads
>
> Michal
>
>> -----Original Message-----
>> From: Michele_Forte@swissre.com [mailto:Michele_Forte@swissre.com]
>> Sent: Friday, May 14, 2004 1:15 PM
>> To: users@maven.apache.org; dev@maven.apache.org
>> Subject: POM Parser
>>
>>
>> For my project in order to make it persistent the information
>> gathered by
>> the POM of an application we want to store that in a
>> database. Being the
>> POM Parser a fundamental part of that concept, instead of
>> writing my own
>> one, I noticed that there is already a POM parser  and the
>> corresponding
>> Model to populate in maven-components and in particular in the
>>
>> maven-project module.
>>
>> I noticed that  those classes are not distributed with the
>> maven.jar that
>> normally comes with the public distribution.
>>
>> In the maven repository at ibiblio I could only find
>> maven-model-2.0-ARTIFACT.jar
>>
>> Is there anyone who could shed some light on that arguments
>> and in case
>> point me to a location where I could get the
>> maven-project-version.jar ?
>>
>> Any help is welcome
>>
>>
>> Michele
>>
>>
>> This e-mail, including attachments, is intended for the person(s) or
>> company named and may contain confidential and/or legally privileged
>> information. Unauthorized disclosure, copying or use of this
>> information
>> may be unlawful and is prohibited. If you are not the
>> intended recipient,
>> please delete this message and notify the sender
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
>
>
> This e-mail, including attachments, is intended for the person(s) or
> company named and may contain confidential and/or legally privileged
> information. Unauthorized disclosure, copying or use of this information
> may be unlawful and is prohibited. If you are not the intended recipient,
> please delete this message and notify the sender
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



--
Trygve

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







This e-mail, including attachments, is intended for the person(s) or
company named and may contain confidential and/or legally privileged
information. Unauthorized disclosure, copying or use of this information
may be unlawful and is prohibited. If you are not the intended recipient,
please delete this message and notify the sender




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