Building Openhab2 when using a local Maven Repo

Hi,

I’m looking to start porting my bindings from Openhab1 to Openhab2. I’m trying to setup my development environment. I am running behind a local nexus repo which is set to mirror *. It proxies the maven central repository but I think I also need to add some new repositories to it.

Has anyone done this? At the moment I’m getting issues finding artifacts:

[ERROR] from the specified remote repositories:
[ERROR] nexus (https://mylocalnexus/repository/maven-public/, releases=true, snapshots=true),
[ERROR] p2-smarthome (https://openhab.jfrog.io/openhab/eclipse-smarthome-stable, releases=false, snapshots=false),
[ERROR] p2-openhab-deps-repo (https://dl.bintray.com/openhab/p2/openhab-deps-repo/1.0.11, releases=false, snapshots=false)
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve project dependencies
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:164)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Could not resolve project dependencies
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:276)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:204)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:271)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
… 11 more
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:

  1. org.openhab.core:org.openhab.core:jar:2.1.0-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.openhab.core -DartifactId=org.openhab.core -Dversion=2.1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.openhab.core -DartifactId=org.openhab.core -Dversion=2.1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.openhab.io:org.openhab.io.openhabcloud:pom:2.1.0-SNAPSHOT
2) org.openhab.core:org.openhab.core:jar:2.1.0-SNAPSHOT


1 required artifact is missing.

for artifact:
org.openhab.io:org.openhab.io.openhabcloud:pom:2.1.0-SNAPSHOT

from the specified remote repositories:
nexus (https://mylocalnexus/repository/maven-public/, releases=true, snapshots=true),
p2-smarthome (https://openhab.jfrog.io/openhab/eclipse-smarthome-stable, releases=false, snapshots=false),
p2-openhab-deps-repo (https://dl.bintray.com/openhab/p2/openhab-deps-repo/1.0.11, releases=false, snapshots=false)

    at org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71)
    at org.apache.maven.DefaultProjectDependenciesResolver.resolveImpl(DefaultProjectDependenciesResolver.java:162)
    at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:75)
    at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:59)
    at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:263)
    ... 16 more

[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/InternalErrorException