Search code examples
mavendependenciesnexuscytoscape

maven Could not find artifact org.cytoscape:


I am trying to build this maven project inside my company behind a proxy https://github.com/gsummer/cyNeo4j

The dependencies Listed in the Pom do not exist in Maven Central repo.. They are located here :

<repositories>
    <repository>
        <id>cytoscape_snapshots</id>
        <snapshots>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
        <name>Cytoscape Snapshots</name>
        <url>http://code.cytoscape.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>cytoscape_releases</id>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
        </releases>
        <name>Cytoscape Releases</name>
        <url>http://code.cytoscape.org/nexus/content/repositories/releases/</url>
    </repository>
</repositories>

I receive this error

[ERROR] Failed to execute goal on project cyneo4j: Could not resolve dependencies for project nl.maastrichtuniversity.networklibrary:cyneo4j:bundle:1.3dev: The following artifacts could not be resolved: org.cytoscape:service-api:jar:3.1.1, org.cytoscape:swing-application-api:jar:3.1.1, org.cytoscape:session-api:jar:3.1.1, org.cytoscape:work-api:jar:3.1.1, org.cytoscape:work-swing-api:jar:3.1.1, org.cytoscape:viewmodel-api:jar:3.1.1, org.cytoscape:layout-api:jar:3.1.1: Could not find artifact org.cytoscape:service-api:jar:3.1.1 in nexus (http://our_host_nexus/nexus/content/groups/public/) -> [Help 1]

In my Settings xml,

I have added

<mirrors>
    <!-- mirror | Specifies a repository mirror site to use instead of a given 
        repository. The repository that | this mirror serves has an ID that matches 
        the mirrorOf element of this mirror. IDs are used | for inheritance and direct 
        lookup purposes, and must be unique across the set of mirrors. | -->
    <mirror>
          <id>nexus</id>
                        <mirrorOf>*,!cytoscape_releases,!cytoscape_snapshots</mirrorOf>
          <name>Our Local Nexus Repo</name>

        <url>our_nexus_host/nexus/content/groups/public/</url>

</mirror>

and also the Server tag :

  <server>
        <id>deployment</id>
        <username>admin</username>
        <password>password</password>
    </server>

Then I have another error "Access Denied":

[ERROR] Failed to execute goal on project CyPlugin: Could not resolve dependencies for project GraphSYSBIO:CyPlugin:bundle:1.0-SNAPSHOT: Failed to collect dependencies at org.cytoscape:vizmap-api:jar:3.6.1: Failed to read artifact descriptor for org.cytoscape:vizmap-api:jar:3.6.1: Could not transfer artifact org.cytoscape:vizmap-api:pom:3.6.1 from/to cytoscape_releases (http://code.cytoscape.org/nexus/content/repositories/releases/): Access denied to: http://code.cytoscape.org/nexus/content/repositories/releases/org/cytoscape/vizmap-api/3.6.1/vizmap-api-3.6.1.pom , ReasonPhrase:Forbidden. -> [Help 1]

I am blocked.

The only thing I can think of is adding manually the dependencies..but I would like to avoid that, as we may switch to multiple dependencies versions many times.


Solution

  • The access to the dependency works from the internet. The access denied error therefore means that your company's proxy does not allow maven to pass through.

    You should enable the usage of the company proxy in your settings.xml:

    <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
    </proxy>