0
votes

I have a sonatype nexus 3.19.01 setup with maven-proxy repository. We are behind corp proxy and I think thats the issue. I have proxy configured and it is working because some of the artificats are downloaded

For eg : I used this repo : Github repo

The settings.xml I used is below. Reference Nexus website.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
   <mirrors>
    <mirror>
     <id>NexusRepository</id>
     <url>http://lndevopsnx:8080/repository/maven-public/</url>
     <mirrorOf>*</mirrorOf>
    </mirror>
   </mirrors>
   <proxies>
    <proxy>
      <id>http</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy</host>
      <port>8080</port>
      <username>svc-user</username>
      <password>****</password>
      <nonProxyHosts>*.mycomp.com|127.0.0.1|</nonProxyHosts>
    </proxy>
    <proxy>
      <id>https</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>proxy</host>
      <port>8080</port>
      <username>svc-user</username>
      <password>***</password>
      <nonProxyHosts>*.mycomp.com|127.0.0.1|</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

maven-config

I compiled project using mvn clean package. Any idea whats going wrong.

The build log says

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.072 s
[INFO] Finished at: 2019-11-01T17:34:41+11:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dailytaskcreator: Could not resolve dependencies for project com.vishnu.automation:dailytaskcreator:jar:1.0: The following artifacts could not be resolved: com.atlassian.jira:jira-rest-java-client-api:jar:3.0.0, com.atlassian.jira:jira-rest-java-client-core:jar:5.1.6: Could not find artifact com.atlassian.jira:jira-rest-java-client-api:jar:3.0.0 in NexusRepository (http://lndevopsnx:8080/repository/maven-public/) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project dailytaskcreator: Could not resolve dependencies for project com.vishnu.automation:dailytaskcreator:jar:1.0: The following artifacts could not be resolved: com.atlassian.jira:jira-rest-java-client-api:jar:3.0.0, com.atlassian.jira:jira-rest-java-client-core:jar:5.1.6: Could not find artifact com.atlassian.jira:jira-rest-java-client-api:jar:3.0.0 in NexusRepository (http://lndevopsnx:8080/repository/maven-public/)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

PS: I compiled the project on a AWS instance outside our corp proxy environment and project works fine. Just to make sure project pom file works

1
The proxy config in nexus you are showing is for maven central, but the jira client is not found there, it is hosted in the atlassian public repository; have you got a proxy config for it in nexus?guido
Thanks @guido.I added an atlassian proxy. Some atlassian jars r getting downloaded now. I am seeing this error "Failed to collect dependencies at com.atlassian.jira:jira-rest-java-client-core:jar:3.0.0 -> com.atlassian.httpclient:atlassian-httpclient-apache-httpcomponents:jar:0.13.2 -> com.atlassian.event:atlassian-event:jar:2.2.0 -> org.slf4j:slf4j-api:jar:1.5.8: Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.5.8: Failure to find org.slf4j:slf4j-parent:pom:1.5.8 in myrepo/repository/maven-public ".. maven-public is a group which had maven-central & atlassian-proxy.VVP

1 Answers

0
votes

You could totally bypass Nexus if you want to, like so, and perhaps straight into ~/.m2/repository . I say this, not because it is the right answer, but because I am certain this would unblock you in the short-term :

<plugin>
    <groupId>com.googlecode.maven-download-plugin</groupId>
    <artifactId>download-maven-plugin</artifactId>
    <version>1.6.0</version>
    <executions>
      <execution>
        <phase>process-resources</phase>
        <goals>
          <goal>wget</goal>
        </goals>
        <configuration>
          <unpack>false</unpack>
          <url>URL_HERE/com.ibm.mqjms-5.3.jar</url>
          <outputFileName>com.ibm.mqjms-5.3.jar</outputFileName> 
          <outputDirectory>${project.basedir}/libs</outputDirectory>
        </configuration>
      </execution>
   </executions>
 </plugin>