1 Reply Latest reply on Aug 28, 2009 12:30 PM by Leo van den berg

    Error: Import a Mavenized Seam Project to Eclipse !

    Prathamesh Gaddam Novice
      Dear Team,

      I have followed the step as http://www.glxn.net/seam-maven-refimpl/doc/tutorial/02-eclipse.html

      However towards step 'Import a Mavenized Seam Project to Eclipse'
      at
      'mvn clean -Punexplode'

      is throwing exceptions:Failed to resolve artifact.

      Please assist as how to resolve it. Thank you in advance.

      Error Details:

      Missing:
      ----------
      1) no.company.seam:seam-tutorial-war:war:0.1-SNAPSHOT

        Try downloading the file manually from the project website.

        Then, install it using the command:
            mvn install:install-file -DgroupId=no.company.seam -DartifactId=seam-tutorial-war -Dversion=0.1-SNAPSHOT -Dpackagi
      ng=war -Dfile=/path/to/file

        Alternatively, if you host your own repository you can deploy the file there:
            mvn deploy:deploy-file -DgroupId=no.company.seam -DartifactId=seam-tutorial-war -Dversion=0.1-SNAPSHOT -Dpackaging
      =war -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

        Path to dependency:
              1) no.company.seam:seam-tutorial-ear:ear:0.1-SNAPSHOT
              2) no.company.seam:seam-tutorial-war:war:0.1-SNAPSHOT

      2) no.company.seam:seam-tutorial-ejb:ejb:0.1-SNAPSHOT

        Try downloading the file manually from the project website.

        Then, install it using the command:
            mvn install:install-file -DgroupId=no.company.seam -DartifactId=seam-tutorial-ejb -Dversion=0.1-SNAPSHOT -Dpackagi
      ng=ejb -Dfile=/path/to/file

        Alternatively, if you host your own repository you can deploy the file there:
            mvn deploy:deploy-file -DgroupId=no.company.seam -DartifactId=seam-tutorial-ejb -Dversion=0.1-SNAPSHOT -Dpackaging
      =ejb -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

        Path to dependency:
              1) no.company.seam:seam-tutorial-ear:ear:0.1-SNAPSHOT
              2) no.company.seam:seam-tutorial-ejb:ejb:0.1-SNAPSHOT

      ----------
        • 1. Re: Error: Import a Mavenized Seam Project to Eclipse !
          Leo van den berg Master

          Hi,


          this is a basic MAVEN problem. maven needs all artifacts (or just jar/war/ear etc. files) to be in the local or global repository before it's able to compile source code which references those artifacts.


          I haven't used the mentioned tutorial, so i don't know if it contains steps toe create both the war and ear. However I can help you a bit with Maven (which is my favorite for Seam builds) if you have the files.


          Because the artifacts aren't on your local computer or at the global (maven) repository maven advices you to install them manually. You can do it the maven-way or use a simple (but very effective) trick.


          Under you user-diretory you will find the maven-directory .m2 which has a directory repository. Each artifact's structure is completely mirrorred under that directory.


          if you create  a directory structure


          no-->company--seam-->seam-tutorial-{xxx}-->0.1-SNAPSHOT 





          the x stands for ear or ejb (meaning you have to create two subdirectoris under ./seam) and drop your ear and jar there, the next time you start the build, maven will find the artifacts and compile without problems.


          NOTE: If you HAVE the build files for these artifacts, build them first with Maven, because that's the most logic sequence.


          If you want to know more from Maven, buy the Maven: definitive guide from O'Reilly as far as I know the best guide.