Bug 685 - Unable to import log4j package when running build
Summary: Unable to import log4j package when running build
Status: RESOLVED FIXED
Alias: None
Product: Chess Game - Group 24
Classification: Unclassified
Component: Chess (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: Normal major
Assignee: gsalter2-c
URL:
Depends on:
Blocks:
 
Reported: 2022-11-02 21:33 HKT by sskawle2-c
Modified: 2022-11-02 21:48 HKT (History)
2 users (show)

See Also:


Attachments
Error Message (653 bytes, text/plain)
2022-11-02 21:33 HKT, sskawle2-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sskawle2-c 2022-11-02 21:33:54 HKT
Created attachment 117 [details]
Error Message

Steps to Reproduce: 
Build jar file: mvn package 
Run jar file: java -cp target/chess-0.0.1-SNAPSHOT.jar chess.chess.App 
 
Expected Results:  
import log4j successfully
 
Actual Results: 
ClassNotFoundException on org.apache.log4j during compilation of jar file.
Comment 1 gsalter2-c 2022-11-02 21:38:50 HKT
And run the following code to build using the following commands: 
1. mvn assembly:assembly -DdescriptorId=jar-with-dependencies 
2. java -jar target/chess-1.0.jar
Comment 3 gsalter2-c 2022-11-02 21:48:49 HKT
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <archive>
            <manifest>
                <mainClass>chess.chess.App</mainClass>
            </manifest>
        </archive>
        <appendAssemblyId>false</appendAssemblyId>
    </configuration>
</plugin>