Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to build java jar (shadowjar) ?

  1. #1
    Junior Member
    Join Date
    Feb 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to build java jar (shadowjar) ?

    Hello, I am a beginner in Java and wanna ask a question.

    So, I have Java Project with this structure :

    - project_name
    -- build
    -- gradle
    -- lib
    --- *.jar
    -- src
    --- main
    ---- java
    ----- com.company.division
    ------ common
    ------- *.java
    ------ data
    ------- *.java
    ------ dofn
    ------- *.java
    ------ Main.java
    ---- resources
    ----- list.json

    How to build the jar that contain /src and /lib ya and with the dependencies but I need it to be clean. The case is when i try to build with /.gradlew clean shadowjar, many things include and openssl and Iampermissionlist.

    My dependencies list:
    dependencies {
    implementation fileTree(dir: 'lib', include: ['*.jar'])
    implementation 'org.slf4j:slf4j-api:1.7.33'
    implementation 'org.slf4j:slf4j-jdk14:1.7.33'
    implementation 'org.apache.beam:beam-sdks-java-core:2.34.0'
    implementation 'org.apache.beam:beam-runners-google-cloud-dataflow-java:2.34.0'
    implementation 'org.apache.beam:beam-sdks-java-io-google-cloud-platform:2.34.0'
    implementation 'com.google.cloud:google-cloud-storage:2.3.0'
    implementation 'org.reflections:reflections:0.10.2'
    runtimeOnly 'org.apache.beam:beam-runners-direct-java:2.34.0'
    }

    Your answer will help me so much. Thank you.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to build java jar (shadowjar) ?

    Is this a question about how to use the jar command to build a jar file?
    If not about using the jar command, what command are you using?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Difference between Maven Build and Eclipse Build
    By Beginner2java in forum Java IDEs
    Replies: 2
    Last Post: October 14th, 2013, 10:13 AM
  2. Difference between Maven Build and Eclipse Build
    By Beginner2java in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 14th, 2013, 10:13 AM
  3. Difference between Maven Build and Eclipse Build
    By Beginner2java in forum Java IDEs
    Replies: 1
    Last Post: October 14th, 2013, 10:09 AM
  4. Difference between Maven Build and Eclipse Build
    By Beginner2java in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 14th, 2013, 10:09 AM