I want to skip demo-api (Which is another module) during build. Setting optional true doesn't work. Any suggestions on how to skip it but not delete the dependency from pom.xml?
Failed to execute goal on project [36mdemo-web[m: [1;31mCould not resolve dependencies for project demo-web:demo-web:war:1.0-SNAPSHOT: Failed to collect dependencies at demo-api:demo-api:jar:1.0-SNAPSHOT[m: Failed to read artifact descriptor for demo-api:demo-api:jar:1.0-SNAPSHOT: Could not find artifact demo-spring-boot:demo-spring-boot:pom:1.0-SNAPSHOT
<dependency>
<artifactId>demo-api</artifactId>
<groupId>demo-api</groupId>
<version>1.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
You can put that dependency in a profile:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.foo</groupId>
<artifactId>foo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<organization>
<name>Example Company</name>
<url>http://www.example.com/</url>
</organization>
<name>foo</name>
<profiles>
<profile>
<id>includeBadDependency</id>
<dependencies>
<dependency>
<artifactId>demo-api</artifactId>
<groupId>demo-api</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>
</profiles>
<!-- Normal dependencies go here-->
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.2.5.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
When you build this project:
$ mvn verify # this will succeed
$ mvn verify -PincludeBadDependency
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< org.foo:foo >-----------------------------
[INFO] Building foo 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from maven-atlassian-com: https://packages.atlassian.com/maven/repository/internal/demo-api/demo-api/1.0-SNAPSHOT/maven-metadata.xml
Downloading from maven-atlassian-com: https://packages.atlassian.com/maven/repository/internal/demo-api/demo-api/1.0-SNAPSHOT/demo-api-1.0-SNAPSHOT.pom
[WARNING] The POM for demo-api:demo-api:jar:1.0-SNAPSHOT is missing, no dependency information available
Downloading from maven-atlassian-com: https://packages.atlassian.com/maven/repository/internal/demo-api/demo-api/1.0-SNAPSHOT/demo-api-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.434 s
[INFO] Finished at: 2021-09-21T18:24:24+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project foo: Could not resolve dependencies for project org.foo:foo:jar:1.0.0-SNAPSHOT: Could not find artifact demo-api:demo-api:jar:1.0-SNAPSHOT in maven-atlassian-com (https://packages.atlassian.com/maven/repository/internal) -> [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
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
Maybe this can give you a hint or two.
<scope>runtime</scope>
I think this will do the trick
Related
This question already has answers here:
Find Oracle JDBC driver in Maven repository
(21 answers)
Closed 3 years ago.
I am having problems trying to build my project with maven, more specifically when a dependency is required, that of Oracle JDBC 7, I have been looking for a solution for hours and nothing, even consult some of the questions raised regarding that here but nothing
C:\Users\E10697\Desktop\Contenedores\oracle_contenedores\Entorno-Oracle-sobre-Docker-master\4. Consumo de la Oracle DB a través de un API Rest\4.1. Elaboración del API Rest\4.1.2. Implementación de una API Rest\OpenwebinarDockerAPI - RESUELTO\OPENWE~1>mvn clean install
error: [ERROR] Failed to execute goal on project app-rest-api: Could not resolve dependencies for project openwebinar.marvel.app:app-rest-api:war:0.1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0 in spring-milestones (https://repo.spring.io/milestone)
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] rest-api [pom]
[INFO] app-rest-api [war]
[INFO] app-web [war]
[INFO]
[INFO] ---------------------< openwebinar.marvel.app:app >---------------------
[INFO] Building rest-api 0.1.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) # app ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # app ---
[INFO] Installing C:\Users\E10697\Desktop\Contenedores\oracle_contenedores\Entorno-Oracle-sobre-Docker-master\4. Consumo de la Oracle DB a través de un API Rest\4.1. Elaboración del API Rest\4.1.2. Implementación de una API Rest\OpenwebinarDockerAPI - RESUELTO\OPENWE~1\pom.xml to C:\Users\E10697\.m2\repository\openwebinar\marvel\app\app\0.1.0-SNAPSHOT\app-0.1.0-SNAPSHOT.pom
[INFO]
[INFO] ----------------< openwebinar.marvel.app:app-rest-api >-----------------
[INFO] Building app-rest-api 0.1.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ war ]---------------------------------
Downloading from spring-milestones: https://repo.spring.io/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from repository.springframework.maven.release: http://maven.springframework.org/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from org.springframework: http://maven.springframework.org/snapshot/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from spring-milestone: http://repo.spring.io/libs-milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from spring-release: http://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
[WARNING] The POM for com.oracle:ojdbc7:jar:12.1.0 is missing, no dependency information available
Downloading from spring-milestones: https://repo.spring.io/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from repository.springframework.maven.release: http://maven.springframework.org/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from org.springframework: http://maven.springframework.org/snapshot/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from spring-milestone: http://repo.spring.io/libs-milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from spring-release: http://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for rest-api 0.1.0-SNAPSHOT:
[INFO]
[INFO] rest-api ........................................... SUCCESS [ 0.590 s]
[INFO] app-rest-api ....................................... FAILURE [ 3.732 s]
[INFO] app-web ............................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.762 s
[INFO] Finished at: 2020-01-03T15:36:54-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project app-rest-api: Could not resolve dependencies for project openwebinar.marvel.app:app-rest-api:war:0.1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0 in spring-milestones (https://repo.spring.io/milestone) -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :app-rest-api
The app-rest-api pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<artifactId>app-rest-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>openwebinar.marvel.app</groupId>
<artifactId>app</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
My project structure, in this case I am running the mvn clean install command in the operwebinar_mavel folder:
What is in the maven route:
C: \ Users \ E10697 \ .m2 \ repository \ com \ oracle \ ojdbc7 \ 12.1.0
Add the Repository to your POM and it will work:
<repositories>
<repository>
<id>hand-china-repo</id>
<name>HandChinaRepo</name>
<url>http://nexus.saas.hand-china.com/content/repositories/rdc/</url>
</repository>
</repositories>
The repo is listed on the Maven Repository page:
https://mvnrepository.com/artifact/com.oracle/ojdbc7/12.1.0.2
Maven Central is reporting a similar dependency at version 12.1.0.2. Try changing your POM to match:
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc7 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
</dependency>
I tested and this combination of adding the repo and the exact version works for me.
I'm studying "Cloud-Native Applications in Java" and I'm doing the exercise in this book. This 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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.RELEASE</version>
</parent>
<groupId>com.mycompany.petstore</groupId>
<artifactId>product</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I set up the settings of Maven on a specific path: C:\Users\Sam.m2\settings.xml
The only information that I set up on my settings.xml is the following:
...
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>localhost:8080</host>
<nonProxyHosts>localhost,127.0.0.1</nonProxyHosts>
<port>8080</port>
</proxy>
</proxies>
When I try to run this program (a simple program with three java classes), in my console there is:
--- maven-surefire-plugin:2.18.1:test (default-test) # product ---
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.18.1/maven-surefire-common-2.18.1.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.18.1/surefire-api-2.18.1.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.873 s
[INFO] Finished at: 2019-07-21T15:32:13+02:00
[INFO] Final Memory: 18M/224M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project product: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.18.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:2.18.1 -> org.apache.maven.surefire:maven-surefire-common:jar:2.18.1: Failed to read artifact descriptor for org.apache.maven.surefire:maven-surefire-common:jar:2.18.1: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:pom:2.18.1 from/to central (https://repo.maven.apache.org/maven2): localhost:8080 -> [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/PluginResolutionException
How can I solve the problem?
I followed a tutorial and get this dependency file in maven project in intelliJ IDEA 2018.3
My pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>kafka.sample.firstProject</groupId>
<artifactId>kafka-first-sample</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<kafka.version>2.1.0</kafka.version>
</properties>
<build>
<plug
ins>
<!-- Maven Compiler Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Apache Kafka Clients-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Kafka Streams-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>2.0.0</version>
</dependency>
<!-- Apache Log4J2 binding for SLF4J -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.0</version>
</dependency>
<!-- JUnit5 Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<!-- JUnit 5 Jupiter Parameterized Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
but whenever i try to run my build it throws this:
Error:(3, 41) java: package org.apache.kafka.clients.producer does not
exist and so on ...
Even after trying to run maven build still the problem persist.
Believe it or not i have get stuck in this problem from last many days.
Edit:
As #Parsecer asked to show maven build log, i found that there is an error as well
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building kafka-first-sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.329 s
[INFO] Finished at: 2019-02-20T09:10:30+05:00
[INFO] Final Memory: 7M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): No such host is known (repo.maven.apache.org) -> [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/PluginResolutionException
Process finished with exit code 1
1) Check settings of IntelliJ by Ctrl-Alt-S. Type 'Maven' and see if you have proper Maven distribution (not the bundled one).
2) Refresh your Maven project from the right hand side of IntelliJ window.
This happens due to several issues which normally fixed after an IDE restart. Well you can try several things,
Do a maven reimport
Do a maven Download sources and documentation
And restart the JIdea IDE
You can try to use a latest maven version and see also.
My System was behind a Proxy which not allowing me to get these packages. I remove the proxy and now it is working fine.
I am using custom dependencies in my project, hosted on Heroku, and when I push my changes via Git, the server throws this log (Maven tries to download from public repositories):
... Remote repositories download ...
[INFO] Downloading: https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar //Example of correct file
[INFO] Downloading: file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo/com/example/functions/17.0/functions-17.0.jar
[INFO] Downloading: file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo/com/example/routines/17.0/routines-17.0.jar
... More downloads ...
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/example/routines/17.0/routines-17.0.jar
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/example/functions/17.0/functions-17.0.jar
... More downloads ...
[INFO] Downloaded: https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar (3 KB at 7.6 KB/sec) //Correct file downloaded
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.755 s
[INFO] Finished at: 2015-12-04T09:19:40+00:00
[INFO] Final Memory: 14M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project example-project: Could not resolve dependencies for project example-project:example-project:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.example:functions:jar:17.0, com.example:routines:jar:17.0: in project.local (file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo) -> [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
I followed this guide and I don't use settings.xml file. My pom.xml is this:
<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>example-project</groupId>
<artifactId>example-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>My example project</name>
<description>Example of Maven Project</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>project.local</id>
<name>project</name>
<url>file:${project.basedir}/repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>functions</artifactId>
<version>17.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>routines</artifactId>
<version>17.0</version>
</dependency>
... More dependencies ...
</dependencies>
... Plugins ...
</project>
How can I upload my custom JARs to Heroku?
I solved it adding Maven plugin for Heroku and uploading the project with the Maven command.
I am new to Maven and would love some help with an issue I've been having. I am not able to compile one of my projects due to an Illegal Argument Exception for one of the dependency URLs. Here is my pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="https://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>
<name>MDM-Map-Reduce</name>
<groupId>com.cardinalhealth</groupId>
<artifactId>MDM-Map-Reduce</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<repositories>
<repository>
<id>hortonworks</id>
<url>
http://repo.hortonworks.com/content/repositories/releases/
</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.hcatalog</groupId>
<artifactId>hcatalog-core</artifactId>
<version>0.5.0.21</version>
</dependency>
</dependencies>
</project>
And here is the last few lines of the output from mvn clean install:
Downloading: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog-core/0.5.0.21/hcatalog-core-0.5.0.21.pom
4/4 KB
Downloaded: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog-core/0.5.0.21/hcatalog-core-0.5.0.21.pom (4 KB at 28.4 KB/sec)
Downloading: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.895 s
[INFO] Finished at: 2014-05-13T17:52:15-05:00
[INFO] Final Memory: 5M/12M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MDM-Map-Reduce: Could not resolve dependencies for project com.cardinalhealth:MDM-Map-Reduce:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.apache.hcatalog:hcatalog-core:jar:0.5.0.21: Failed to read artifact descriptor for org.apache.hcatalog:hcatalog-core:jar:0.5.0.21: Could not transfer artifact org.apache.hcatalog:hcatalog:pom:${hcatalog.version} from/to hortonworks (http://repo.hortonworks.com/content/repositories/releases/): IllegalArgumentException: Illegal character in path at index 88: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom -> [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
(I had to break the urls after http:// with a space for SO to allow me to post)
If you notice it seems like it is trying to pull the same dependency twice, I have no clue why it would do that, or why it would fail to resolve parameters correctly.
I have attached relevant files here, I am a complete Maven novice so I have included the directory layout (in list), the pom and the output of mvn clean install, both standard and extended (i.e. with -e for stack trace).
https://drive.google.com/folderview?id=0B_G2bKn27T9raFVoMkl0LUQyT28&usp=sharing
use pluginrepo instead repository
e.g.
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<url>http://repository.apache.org/snapshots/</url>
</pluginRepository>
</pluginRepositories>