0

Hi I am new in maven technology I am trying to create and run maven project but I am getting an build failure error. while running a project compiler not able to find/load main class. I am not able to find what's the exact error is. please help me out in this.

Thanks in advance.

error:

[ERROR] Failed to execute goal on project Test: Could not resolve dependencies for project com.mavenProject:Test:jar:0.0.1-SNAPSHOT: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:jar:2.8.9 from/to prod (https://example.com/java-proxy/content/repositories/prod/): Access denied to https://example.com/java-proxy/content/repositories/prod/com/fasterxml/jackson/core/jackson-databind/2.8.9/jackson-databind-2.8.9.jar. Error code 403, Requested item is quarantined -> [Help 1]
[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/DependencyResolutionException

pom.xml

<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>com.mavenProject</groupId>
  <artifactId>Test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.6.RELEASE</version>
     </parent>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.9</version>
        </dependency>
        
    </dependencies>
    
    
</project>

Main Calss:

@SpringBootApplication
public class ProxyReportController {
    public static void main(String[] args) 
    {
        SpringApplication.run(com.example.grt.datacomp.proxy.controller.ProxyReportController.class, args);
        InputStream inputStream;
        try {
            inputStream = new FileInputStream("C:\\Desktop\\Files\\report_sample_match_2018-10-19-230920.xls");
            try {
                Workbook wb1 = WorkbookFactory.create(inputStream);
                
                Sheet sheet = wb1.getSheetAt(0);// getting sheet at 0
                System.out.println("Sheet name is:>>>>"+sheet.getSheetName());
                
                Row row1 = sheet.getRow(0);
                Iterator cellIter=row1.cellIterator();
                
                while(cellIter.hasNext()){
                    System.out.println(cellIter.next());
                }
            } catch (InvalidFormatException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }

}
Bilbo
  • 91
  • 3
  • 11
  • https://stackoverflow.com/questions/18649486/error-when-deploying-an-artifact-in-nexus – scigs Feb 07 '19 at 14:53
  • The error is on the first line and is caused by a failure to download a dependency. Try using a newer version of **spring-boot-starter-parent**. – Leonardo Vidal Feb 07 '19 at 15:06

3 Answers3

0

After the url maven is using to retrieve the jackson-databind artifact, I assume that you are using a mirror.

Try to comment out any mirrors tag in your settings.xml. You can find the settings.xml file at one of the following locations on your computer :

${maven.home}/conf/settings.xml
${user.home}/.m2/settings.xml

tartard
  • 71
  • 5
0

in your settings.xml update the credentials for your mirrors

<servers>
...
        <server>
            <id>MY-REPO</id>
            <username>MYREPO-USER</username>
            <password>MYREPO-PASS</password>
        </server>
</servers>

<mirrors>
        <mirror>
            <id>MY-REPO</id>
            <mirrorOf>central</mirrorOf>
            <name>Mirror </name>
            <url>https://example.com/java-proxy/content/repositories/prod/</url>
        </mirror>
...
<mirrors>
 

in this example MY-REPO is the id for example.com mirror the credentials are the same ones you use for open https://example.com/java-proxy/content/repositories/prod/ in a web browser

imperezivan
  • 761
  • 5
  • 13
0

I was facing similar issue. I solved it by changing some configuration in my IDE. I use WebSphere (powered by Eclipse technology). I hope the below steps can help you too.

In the IDE, Please click on Window > Preferences > Java EE > Maven > Maven Repository Initialization. If the settings.xml file does not exist, the page displays the following text: The settings.xml file does not exist. To create this file and configure the IBM Maven repository, click Configure. This action configures the IBM Maven repository in the settings.xml file and registers the URL of the archetype catalog.

The location of the settings.xml file is determined by the value that is set in the Window > Preferences > Maven > User Settings page. (If needed: To change the file location, click the User settings file link to go directly to the preference page.​)

Also when you create a new workspace, Maven repository indexing is turned off by default. Please click Window > Preferences > Maven and select Download repository index updates on startup.

Hope this helps!