0

I am able to successfully upload my jar to custom nexus repository. Now when i try to use this jar as dependency in another project, i see its downloaded but not able to import classes from it. As i type the name of class, it gives suggestion but as soon as it auto populates it gives error in red as below.

enter image description here

enter image description here

CurrencyExchange entity class which is downloaded, i can see it in maven jars. Attaching screenshot below for reference.

enter image description here

Below is 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>org.example</groupId>
    <artifactId>TestIstio</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.intelliswift</groupId>
            <artifactId>currency-exchange-service</artifactId>
            <version>1.0.4</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>nexus-deployment-repo</id>
            <url>http://localhost:8081/repository/currency-exchange-release/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

</project>

Below is my settings.xml

<?xml version="1.0" encoding="UTF-8"?>


<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  
  <proxies>
   
  </proxies>

  <servers>    
    <server>
      <id>nexus-deployment-repo</id>
      <username>admin</username>
      <password>admin</password>
    </server>
  </servers>


  <mirrors>
   
  </mirrors>

  <profiles>
   
    <profile>
    <id>currency-exchange-release</id>
    <repositories>
    <repository>
        <id>nexus-deployment-repo</id>
        <url>http://localhost:8081/repository/currency-exchange-release/</url>
    </repository>
    </repositories>
    </profile>

  </profiles>

</settings>

I am new to nexus and not able to understand what am i doing wrong here. Can anyone please help in resolving this error. Thank you.

Ankit Ostwal
  • 1,033
  • 3
  • 14
  • 32

0 Answers0