In Maven, my dependencies are set up but I get a ClassNotFoundException when I run generated jar

后端 未结 2 1720
闹比i
闹比i 2020-12-22 06:29

I was following along with the maven tutorial at http://www.youtube.com/watch?v=IRKu8_l5YiQ.

I created a maven project with the default archetype. Then I added the

2条回答
  •  不思量自难忘°
    2020-12-22 07:29

    Consider using maven shade plugin to create an Uber Jar.

    When using slf4j-api you need to add an API implementation dependency at runtime, e.g. slf4j-simple or logback:

    ...
    
        1.7.7
    
    
        
            org.slf4j
            slf4j-api
            ${slf4j.version}
        
        
            org.slf4j
            slf4j-simple
            ${slf4j.version}
            runtime
        
    
    

提交回复
热议问题