ncsu-csc326 / iTrust2

The iTrust2 project is used to teach Software Engineering at NC State University
https://www.csc.ncsu.edu/
Eclipse Public License 2.0
7 stars 10 forks source link

Maven Build Failure #15

Closed woojunro closed 11 months ago

woojunro commented 1 year ago

I'm trying to follow the Developer's Guide to build and execute this application, but the build fails.

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< edu.ncsu.csc:iTrust2 >------------------------
[INFO] Building iTrust2 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> spring-boot:2.3.7.BUILD-SNAPSHOT:run (default-cli) > test-compile @ iTrust2 >>>
[WARNING] The artifact org.hibernate:hibernate-validator:jar:6.1.5.Final has been relocated to org.hibernate.validator:hibernate-validator:jar:6.1.5.Final
[INFO] 
[INFO] --- jacoco:0.8.4:prepare-agent (pre-unit-test) @ iTrust2 ---
[INFO] surefireArgLine set to -javaagent:/Users/woojunro/.m2/repository/org/jacoco/org.jacoco.agent/0.8.4/org.jacoco.agent-0.8.4-runtime.jar=destfile=/Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/target/coverage-reports/jacoco-ut.exec
[INFO] 
[INFO] --- resources:3.1.0:resources (default-resources) @ iTrust2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 29 resources
[INFO] 
[INFO] --- build-helper:3.1.0:reserve-network-port (reserve-container-port) @ iTrust2 ---
[INFO] Reserved port 50186 for 8080
[INFO] 
[INFO] --- compiler:3.8.1:compile (default-compile) @ iTrust2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 102 source files to /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/target/classes
[INFO] /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/src/main/java/edu/ncsu/csc/itrust2/services/HospitalService.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/src/main/java/edu/ncsu/csc/itrust2/services/HospitalService.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- resources:3.1.0:testResources (default-testResources) @ iTrust2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 40 resources
[INFO] 
[INFO] --- compiler:3.8.1:testCompile (default-testCompile) @ iTrust2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 34 source files to /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/target/test-classes
[INFO] /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/src/test/java/edu/ncsu/csc/itrust2/api/APIAppointmentRequestTest.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/woojunro/Documents/yonsei/2023-2/software-engineering/team_project/itrust2/iTrust2/iTrust2/src/test/java/edu/ncsu/csc/itrust2/api/APIAppointmentRequestTest.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] <<< spring-boot:2.3.7.BUILD-SNAPSHOT:run (default-cli) < test-compile @ iTrust2 <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot:2.3.7.BUILD-SNAPSHOT:run (default-cli) @ iTrust2 ---
[INFO] Attaching agents: []
Error: Could not find or load main class edu.ncsu.csc.itrust2.ITrust2Application
Caused by: java.lang.NoClassDefFoundError: edu/ncsu/csc/iTrust2/ITrust2Application (wrong name: edu/ncsu/csc/itrust2/ITrust2Application)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.137 s
[INFO] Finished at: 2023-10-22T12:43:09+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.7.BUILD-SNAPSHOT:run (default-cli) on project iTrust2: Application finished with exit code: 1 -> [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/MojoExecutionException

Also, my Eclipse complains about the name of the packages.

The declared package "edu.ncsu.csc.iTrust2" does not match the expected package "edu.ncsu.csc.itrust2"

So I tried to close and re-open Eclipse(this did not work), and change every name of the package (from "iTrust2" to "itrust2") but Maven build still fails.