Announcement Announcement Module
No announcement yet.
Help with Maven Dependency Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Maven Dependency

    Using STS 2.8.1

    I have several projects that depend on a jar from another project.

    The jar project is managed by maven and Run As Maven Install publishes the jar file to the local repository and has been doing fine until now.

    The war projects that depend on the jar project have dependencies with the group id, artifact id and version number.

    When I update the jar project I increment the version number in the jar project pom and run as maven install.

    but this last version, the pom manager in the war projects shows a folder icon instead of the jar icon when I change the version number from 1.1 to 1.2 and the war projects won't build because there is no dependency reference to the jar file.

    However the /1.2/ folder DOES have the artifact-1.2.jar in it.

    The only difference between the /1.1/ folder contents and the /1.2/ folder contents is the /1.2/ is missing the file

    Here is the latest Maven Install console log.

    Tests run: 15, Failures: 0, Errors: 0, Skipped: 0
    [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ myjar ---
    [INFO] Building jar: C:\Users\Ollie\Documents\workspace-sts-2.8.0ML\MyJarProject-1.2\target\myjar-1.2.jar
    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ myjar ---
    [INFO] Installing C:\...\workspace-sts-2.8.0ML\MyJarProject-1.2\target\myjar-1.2.jar to C:\...\.m2\repository\com\...\myjar\1.2\myjar-1.2.jar
    [INFO] Installing C:\...\workspace-sts-2.8.0ML\MyJarProject-1.2\pom.xml to C:\...\.m2\repository\com\...\myjar\1.2\myjar-1.2.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 7:36.180s
    [INFO] Finished at: Sun Dec 04 09:03:22 CST 2011
    [INFO] Final Memory: 8M/244M
    [INFO] ------------------------------------------------------------------------
    But when I add the dependency in one of the war file projects in the Pom editor, the search for the artifact finds the myjar-1.2 jar file ok, but after adding it, the icon shows a folder not the jar file and the project build path shows a folder and not the jar file in the maven dependencies

    What am I missing?

  • #2
    Some additional information and a guess.

    My people showed me that when the myjar-1.2 project was open in the same workspace that has the projects that depend on it, the maven dependencies shows an open folder and not the jar file, but if the myjar-1.2 project is closed the projects that depend on it show the jar file in the maven dependencies. This is with or without the myjar-1.2 project in the build path Projects tab.

    My guess is that with the myjar-1.2 in the pom, if that jar file is in an open project in the workspace and exported, then it gets detected and shows as a folder in the maven dependencies.

    If someone knows why and what implications that might have, please reply.