0

I'm trying to run java program with maven but when i compiled using the command mvn -U compile he shows me the following error

[root@onePK-EFT1 tutorials]# mvn -U compile
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building onePK Java Tutorials 0.6.0.5
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-core-rel
/0.6.0.5/libonep-core-rel-0.6.0.5.pom
[WARNING] The POM for com.cisco.onep:libonep-core-rel:jar:0.6.0.5 is missing, no 
dependency information available
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-
core-rel/0.6.0.5/libonep-core-rel-0.6.0.5.jar
[INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.517s
[INFO] Finished at: Tue Jul 09 07:28:28 PDT 2013
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project java-tutorials: Could not resolve 
dependencies for project com.cisco.onep:java-tutorials:jar:0.6.0.5: Could not find 
artifact com.cisco.onep:libonep-core-rel:jar:0.6.0.5 in central 
(http://repo.maven.apache.org/maven2) -> [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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read
 the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN   
/DependencyResolutionException

and this is my pom.xml file

 <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>com.cisco.onep</groupId>
<artifactId>hello-network-app</artifactId>
<version>0.1-SNAPSHOT</version>
<name>The onePK Hello Network Example Application</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12</version>
            <configuration>
                <forkMode>always</forkMode>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.8</version>
            <configuration>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>com.cisco.onep</groupId>
        <artifactId>libonep-core-rel</artifactId>
        <version>0.6.0.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.thrift</groupId>
        <artifactId>libthrift</artifactId>
        <version>0.6.1</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>
</dependencies>

<developers>
    <developer>
        <name>onePK Team</name>
        <email>[email protected]</email>
        <organization>Cisco.com</organization>
    </developer>
</developers>

I think it's because he can't find libonep-core-rel.jar which i have it included please any help

2 Answers 2

2

The simple solution is to use the appropriate maven repository for the artifacts com.cisco.onep* which are not located in Maven central.

Sign up to request clarification or add additional context in comments.

2 Comments

how can i tell maven to not download the jar that he can find it in a file on my disk
Start using a repository manager and deploy the artifact manually into the repository manager. This is the simplest and most reliable solution.
0

As an immediate solution, but not a recommendation, you can use system dependencies to resolve artifacts on your local filesystem.

As @khmarbaise implied, try to publish those corporate artifacts to your corporate Maven repository (Nexus, Artifactory, Archiva, etc.), even an FTP/HTTP server would do...

Once you publish those corporate artifacts to your "corporate" repository(hopefully it's already in place), you just need a new repository declaration in your Maven POM.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.