facebook

Unjustified validation error in pom.xml

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #330733 Reply

    pierre.henry
    Member

    I have a workspoace containing various (around 20) maven modules / maven abilitated MyEclipse projects. The is one parent project that all other projects inherit from.

    Some of the projects in the LIS workspace are not Java projects. THerer are projects that have been created to match Maven modules that either contain resources needed by other projects and to make the final build, or that are responsible to build some special artifacts.

    These projects have the packaging set to pom in pom.xml :

    
    <packaging>pom</packaging>
    

    In Maven terms this means that the project will not produce any JAR file, or at leat that a JAR file should not be expected (maybe one can be built e.g. by the with the assembly plugin but it is not the default artefact).

    Examples for these non-java projects : documentation, a set of scripts for launching and updating a client app, sets of configuration files, etc.

    The Maven built execution runs smoothly whether in command line or executing it inside MyEclipse using run as…

    However there are validation errors on some projects in MyEclipse using Maven4MyEclipse. For example there is one project that builds a small website to be included in the finalt distribution, It depends on the documentation project :

    
    <dependency>
      <groupId>my.domain</groupId>
      <artifactId>My_Doc</artifactId>
      <version>${project.version}</version>
    </dependency>
    

    At this point, the MyEclipse validation raises an error, saying “Missing artifact my.domain:My_Doc:jar:5.0-SNAPSHOT”

    This error should not exist, since LIS_Doc is a project with pom packaging and no JAR should be expected.

    Disclaimer : I am relatively new tro Maven, so maybe there is something else that I missed. But the fact that the build execution works fine tends to show otherwise.

    I am currently using MyEclipse 10.6, but I have been having this problem for some times now, previoulsy also using ME 9.x

    #330739 Reply

    support-swapna
    Moderator

    pierre.henry,

    When you are including the project as a dependency , the default packaging is jar. Maven assumes that the packing is jar and raises a validation error.

    If the packaging is different than JAR, then you must specify it using the <type> element when specifing dependency.

    For example :

    <dependency>
    <groupId>my.domain</groupId>
    <artifactId>My_Doc</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
    </dependency>

    Let us know how it works for you.

    #330749 Reply

    pierre.henry
    Member

    Yes, this solved the problem. Thank you so much.

    #330773 Reply

    support-swapna
    Moderator

    pierre.henry,

    Glad that it is working.
    Do let us know if you see any issues.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Unjustified validation error in pom.xml

You must be logged in to post in the forum log in