Search code examples
javamavenauthentication-flows

How to solve "Could not find artifact com.ohadr:authentication-flows"?


I've tried a:
mvn clean install -DskipTests -DdownloadSources=true
for building https://github.com/OhadR/Authentication-Flows.git
and I'm having:

...Failed to execute goal on project client: Could not resolve dependencies for project com.ohadr.auth-flows:client:war:1.0.0-SNAPSHOT: Could not find artifact com.ohadr:authentication-flows:jar:1.6.2-SNAPSHOT... The POM for com.ohadr:authentication-flows:jar:1.6.2-SNAPSHOT is missing, no dependency information available...


Next, I tried adding this repository:

     <repository>
       <id>central-maven</id>
       <name>Central Maven</name>
       <url>http://central.maven.org/maven2</url>
     </repository>

as well as downloading the jar (http://central.maven.org/maven2/com/ohadr/authentication-flows/1.6.0-RELEASE/authentication-flows-1.6.2-RELEASE.jar) and installing it manually:

 mvn install:install-file -DgroupId=com.ohadr \
   -DartifactId=authentication-flows \
   -Dversion=1.6.2-SNAPSHOT \
   -Dpackaging=jar -Dfile=authentication-flows-1.6.2-RELEASE.jar

Now I have:

...Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project client: Compilation failure: Compilation failure:...impl/CustomCreateAccountEndpoint.java:[6,38] package com.ohadr.auth_flows.endpoints does not exist

What am I doing wrong? Thank you.


Solution

  • The latest version (master branch) of the client-app depends on the "latest" version - the SNAPSHOT version - of authentication-flows JAR. SNAPSHOTs do not exist in maven-repository, and this is why you get the error.

    You can either clone authentication-flows project as well and build it locally, or change the dependency in the client-pom to version 1.6.1-RELEASE.

    HTH