PacktPublishing / Learn-Java-17-Programming

Learn Java 17 Programming, published by Packt
MIT License
68 stars 65 forks source link

mvn clean package error #1

Open kirmiziorman opened 1 year ago

kirmiziorman commented 1 year ago

Hi, I've followed your instructions exactly, but when I get to page 22 and run mvn clean package I get the following error:

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< com.packt.learnjava:examples >--------------------
[INFO] Building examples 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.packt.learnjava:database:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.245 s
[INFO] Finished at: 2022-11-26T21:25:58Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project examples: Could not resolve dependencies for project com.packt.learnjava:examples:jar:1.0-SNAPSHOT: Could not find artifact com.packt.learnjava:database:jar:1.0-SNAPSHOT -> [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

I've don't know what's going on here and it's preventing me from progressing with the book. Do you know how I can fix this?

Thanks!

kirmiziorman commented 1 year ago

I've found a temporary solution in commenting out the following in the examples pom file:

<!--<dependency>
          <groupId>com.packt.learnjava</groupId>
          <artifactId>database</artifactId>
          <version>1.0-SNAPSHOT</version>
      </dependency>-->

And also removing the ch_10 folder completely. But I'll obviously want it back in when I get to that point in the book. So still hoping for a solution.

amarchese96 commented 1 year ago

You should execute a mvn install command inside the database folder to install the database project on your local maven repository.