How to have Maven pick up the project jars from Local Repositories->Workspace Projects, than from any remote repository?

StackOverflow https://stackoverflow.com/questions/22155699

  •  19-10-2022
  •  | 
  •  

Question

I am new to Maven and I have seen many similar posts as mine, but I could not get my problem resolved. I have a Maven project which has Maven Dependencies on other Maven Projects. However, while carrying out Maven Build on the project with the goal being 'package' I get the following trace.

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building docsvcs 1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.idiginfo.docsvc:models:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:apisvc:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:repositories:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:views:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:wok_v3:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:harvest:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:controllers:jar:1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.270s
[INFO] Finished at: Mon Mar 03 14:23:34 EST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project docsvcs: Could not resolve dependencies for project org.idiginfo.docsvc:docsvcs:war:1: The following artifacts could not be resolved: org.idiginfo.docsvc:models:jar:1, org.idiginfo.docsvc:apisvc:jar:1, org.idiginfo.docsvc:repositories:jar:1, org.idiginfo.docsvc:views:jar:1, org.idiginfo.docsvc:wok_v3:jar:1, org.idiginfo.docsvc:harvest:jar:1, org.idiginfo.docsvc:controllers:jar:1: Failure to find org.idiginfo.docsvc:models:jar:1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

I carried out the Maven clean followed by Maven Update Project. Here is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.idiginfo.docsvc</groupId>
    <artifactId>docsvcs</artifactId>

    <packaging>war</packaging>
    <parent>
        <groupId>org.idiginfo.docservice</groupId>
        <artifactId>service</artifactId>
        <version>1</version>
        <relativePath>../service</relativePath>
    </parent>
    <build>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <warName>docsvcs</warName>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <dependentWarExcludes>WEB-INF/web.xml,**/**.class</dependentWarExcludes>
                    <webResources>
                        <resource>
                            <!-- change if necessary -->
                            <directory>src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF</targetPath>
                        </resource>
                        <resource>
                            <directory>../repositories/src/META-INF</directory>
                            <!-- override the destination directory for this resource -->
                            <targetPath>WEB-INF/classes/META-INF</targetPath>
                            <includes>
                                <include>persistence.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>models</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>apisvc</artifactId>
            <version>1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>repositories</artifactId>
            <version>1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>views</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>wok_v3</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>harvest</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>org.idiginfo.docsvc</groupId>
            <artifactId>controllers</artifactId>
            <version>1</version>
        </dependency>
    </dependencies>
    <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
      <url>http://repo.maven.apache.org/maven2</url>
    </repository>
  </repositories>
</project>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top