facebook

"Missing artifact" errors in pom.xml

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

    cusdx
    Member

    I’m just trying Maven4MyEclipse for the first time. I’ve just set up a straightforward test project (called testMavenProject) based on the tutorial:

    “Creating a Maven Project using Maven4MyEclipse”.

    The pom is created with a red cross and the following 5 errors are listed under problems – please can you advise? (I’ve also appended pom.xml):

    Missing artifact javax.activation:activation:jar:1.0.2:provided
    Missing artifact javax.mail:mail:jar:1.3.1:provided
    Missing artifact javax.xml:namespace:jar:1.1.0:provided
    Project ‘testMavenProject’ is missing required library: “C:\Users\zoe james\.m2\repository\javax\activation\activation

    Here is the pom.xml:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <project xmlns=”http://maven.apache.org/POM/4.0.0&#8243; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”&gt;
    <modelVersion>4.0.0</modelVersion>
    <groupId>uk.ac.warwick</groupId>
    <artifactId>testMavenProject</artifactId>
    <packaging>war</packaging>
    <name />
    <version>0.0.1-SNAPSHOT</version>
    <description />
    <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory>
    <resources>
    <resource>
    <directory>${basedir}/src</directory>
    <excludes>
    <exclude>**/*.java</exclude>
    </excludes>
    </resource>
    </resources>
    <plugins>
    <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
    <webappDirectory>${basedir}/WebRoot</webappDirectory>
    <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory>
    </configuration>
    </plugin>
    </plugins>
    </build>
    <dependencies>
    <dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.0.2</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.4</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>jboss</groupId>
    <artifactId>jboss-j2ee</artifactId>
    <version>4.0.0</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.xml</groupId>
    <artifactId>jaxrpc-api</artifactId>
    <version>1.1</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>jboss</groupId>
    <artifactId>jboss-jsr77</artifactId>
    <version>3.2.3</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>axis</groupId>
    <artifactId>axis-saaj</artifactId>
    <version>1.3</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.3.1</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>javax.xml</groupId>
    <artifactId>namespace</artifactId>
    <version>1.0.1</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>xerces</groupId>
    <artifactId>xmlParserAPIs</artifactId>
    <version>2.6.2</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>1.1.1</version>
    </dependency>
    </dependencies>
    </project>

    #295125 Reply

    Loyal Water
    Member

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.

    Also, can you switch to new workspace, create a new maven project and check if you are able to reproduce this issue.

    Let me know what result you get.

    #295217 Reply

    cusdx
    Member

    Thanks for your reply. I’ve pasted the Installation Details below. I also tried recreating the problem in a new workspace as you suggested, and did reproduce the error.

    *** Date:
    24 February 2009 14:19:18 o’clock GMT

    ** System properties:
    OS=WindowsVista
    OS version=6.0.0
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 7.0
    Build id: 7.0-20081201

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 7.0
    Build id: 7.0-20081201

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\apps\Genuitec\MyEclipse 7.0\myeclipse.exe
    -name
    Myeclipse
    –launcher.library
    C:\apps\Genuitec\MyEclipse 7.0\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
    -startup
    C:\apps\Genuitec\MyEclipse 7.0\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
    -clean
    -configuration
    configuration
    -vm
    C:\apps\Genuitec\Common\binary\com.sun.java.jre.win32.x86_1.5.0.011\bin\client\jvm.dll

    #295462 Reply

    It’s a confusing workflow. MyEclipse should’ve initialized your repository when you created your web project but due to some Maven problem it didn’t. Can your workstation access Internet and/or some Maven repository in your network? Note: MyEclipse uses core Maven tasks and if they were not downloaded Maven will not work.

    To make MyEclipse do another attempt at initializing the repository:
    1. Restart MyEclipse.
    2. Create dummy web project with Maven support. You may delete it right after you created it.
    3. Right-click your original web project and select Maven4MyEclipse -> Update Dependencies

    #295496 Reply

    cusdx
    Member

    Yes, my workstation definitely has internet access. I can even access the internet from within myEclipse.

    As soon as I set up the dummy web maven project, I get the following error message – I noticed it in the online demo so assume it doesn’t matter:

    “Some Maven goals may require a JDIK to execute properly; Please make sure that MavenJDK preference is pointing to a JDK…”

    Behind that are flashing a lot of “BUILD FAILED” messages. I just managed to copy the end of one below, hope this gives a clue:

    this strategy = org.codehaus.plexus.classworlds.strategy.DefaultStrategy
    Number of imports: 6
    import: Entry[import org/codehaus/plexus/util/xml/pull from realm ClassRealm[plexus.core, parent: null]]
    import: Entry[import org/codehaus/plexus/util/xml/Xpp3Dom from realm ClassRealm[plexus.core, parent: null]]
    import: Entry[import org.codehaus.plexus.util.xml.pull from realm ClassRealm[plexus.core, parent: null]]
    import: Entry[import org.codehaus.plexus.util.xml.Xpp3Dom from realm ClassRealm[plexus.core, parent: null]]
    import: Entry[import /default-report/xml from realm ClassRealm[plexus.core, parent: null]]
    import: Entry[import /default-report.xml from realm ClassRealm[plexus.core, parent: null]]

    —————————————————–
    [ERROR]

    Maven encountered an error while looking up the following Mojo:
    Group-Id: org.apache.maven.plugins
    Artifact-Id: maven-install-plugin
    Version: 2.2
    Mojo: install-file
    brought in via: Direct invocation

    Referenced from project:
    Group-Id: dummy
    Artifact-Id: dummy
    Version: 0.0.1-SNAPSHOT
    From file: C:\Workspaces\MyEclipse 7.0\dummy\pom.xml
    Reason: Unable to lookup component ‘org.apache.maven.plugin.Mojo’, it could not be created.
    role: org.apache.maven.plugin.Mojo
    roleHint: org.apache.maven.plugins:maven-install-plugin:2.2:install-file
    classRealm: /plugins/org.apache.maven.plugins:maven-install-plugin:2.2@48/thread:main

    Root cause: org/codehaus/plexus/digest/DigesterException

    [INFO] ————————————————————————
    [INFO] For more information, run with the -e flag
    [INFO] ————————————————————————
    [INFO] BUILD FAILED
    [INFO] ————————————————————————
    [INFO] Total time: < 1 second
    [INFO] Finished at: Wed Mar 04 10:11:57 GMT 2009

    #295498 Reply

    It looks like you have corrupted Maven local repository. Can you rename ~/.m2 folder so the Maven tries to recreate it?

    #295499 Reply

    @cusdx wrote:

    As soon as I set up the dummy web maven project, I get the following error message – I noticed it in the online demo so assume it doesn’t matter:

    “Some Maven goals may require a JDIK to execute properly; Please make sure that MavenJDK preference is pointing to a JDK…”

    Note: Maven goals like compile will not execute unless you select proper JDK on the Maven preference page. MyEclipse build will still work though.

    I tried – import goal works on JRE so this is not a cause of the problem you see. Did you use some other Maven version on your workstation?

    #295503 Reply

    cusdx
    Member

    Eugene,

    Thanks for your work on this. This is looking better. Through recreating the maven repository I have discovered that I had a J2EE specification level/ compiler compliance clash – I’d selected J2EE spec of EE 5.0 but hadn’t changed the compiler compliance. Now a lot more good things are happening.

    The complaint about the JDK for maven appears to be because although I had selected a JDK for maven (jdk1.6.0_12), I needed to change the default selected JRE to match – I did this and that warning has gone.

    I am still getting some “missing artifact” messages though, both in the initial build and when I do “update dependencies”. They are in red:

    04/03/09 14:03:14 GMT: Missing artifact javax.activation:activation:jar:1.0.2:provided
    04/03/09 14:03:14 GMT: Missing artifact javax.mail:mail:jar:1.3.1:provided
    04/03/09 14:03:14 GMT: Missing artifact javax.xml:namespace:jar:1.0.1:provided

    Although it says “provided”, if I update dependencies again they come up again.

    Is this an issue?

    Zoe

    #295504 Reply

    Did you try to create web project after you redid Maven local repository? Note: you need to restart MyEclipse before doing this 🙁

    #295520 Reply

    cusdx
    Member

    Looks like I might be in business now. I tried again and got some bits in red (below), but when I updated the dependencies on the existing project – no red! Many thanks for your help.

    04/03/09 16:33:12 GMT: Missing artifact javax.faces:jsf-api:jar:1.2_04:provided
    04/03/09 16:33:12 GMT: Missing artifact javax.faces:jsf-impl:jar:1.2_04:provided

    and

    04/03/09 16:37:04 GMT: Error on removing indexing context local; Cannot delete C:\Workspaces\MyEclipse 7.0\.metadata\.plugins\org.maven.ide.eclipse\nexus\local\_0.cfs
    04/03/09 16:37:04 GMT: Error on adding indexing context local; Cannot overwrite: C:\Workspaces\MyEclipse 7.0\.metadata\.plugins\org.maven.ide.eclipse\nexus\local\_0.cfs

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: "Missing artifact" errors in pom.xml

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

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