Git Product home page Git Product logo

Comments (4)

sebastienvermeille avatar sebastienvermeille commented on June 21, 2024 1

@bmuschko good to know. Thank for your explanations.

I thought the application plugin's role was to embed other libraries but in fact it is done in the shadowJar plugin. So effectively -> no need of application plugin.

After that I had to change some things that way:

def mainClassName = "com.company.project.MyMainClass"
jar {
    manifest {
        attributes 'Main-Class': mainClassName
    }
}

jar {
    manifest {
        attributes 'Main-Class': mainClassName
    }
}

shadowJar {
    mergeServiceFiles()
    configurations = [project.configurations.compile]
    classifier = null
}

artifacts {
    archives shadowJar
}

And now when I run :

gradle install or gradle uploadArchives

I get my javadoc, sources, tests, and fatjar uploaded to nexus like a charm :) It's beautifull

Thank you for your help ben !

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 21, 2024

The reason this is happen is that the application plugin and the shadow plugin both create a JAR without a classifier. I'd need to further understand the use case you are trying to solve.

  • Why do you need the Shadow plugin exactly?
  • Why do you need the application plugin?
  • What is it you want to achieve?

from gradle-nexus-plugin.

sebastienvermeille avatar sebastienvermeille commented on June 21, 2024

@bmuschko my goal is to host our "fat" jars on a nexus repository. These are basically servers, or utilities that need to be versioned.

We use application plugin because we build some executables jar (hosted too on nexus) I created a maven registry extra for releases-stable releases-snapshot and so on

We use shadowJar because we want only one jar for our release. We start our rules-engine simply with java -jar rules-engine.jar . No need to place some libs somewhere and so on (easier to deploy/use).

Of course everything can be discussed but I think it's not wrong to want this :/

Do you mean application plugin and shadowjar are conflicting each others?

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 21, 2024

We use application plugin because we build some executables jar (hosted too on nexus) I created a maven registry extra for releases-stable releases-snapshot and so on

The application plugin doesn't build executable JARs. It just creates distributions (bundled as ZIP or TAR files) that contain shell/batch scripts plus the JAR of your project and external dependencies. The JAR you are creating is still the plain JAR you'd get when applying the Java plugin.

We use shadowJar because we want only one jar for our release. We start our rules-engine simply with java -jar rules-engine.jar . No need to place some libs somewhere and so on (easier to deploy/use).

Then I don't get why you need the application plugin.

Do you mean application plugin and shadowjar are conflicting each others?

They are conflicting in the way you configured them for publishing. You removed the classifier from the JAR created by the Shadow plugin. In turn the JAR files from the application plugin and the Shadow plugin will have the same name and publishing attributes.

from gradle-nexus-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.