Comments (4)
@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.
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.
@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.
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)
- Multiple GPG key passphase questions in multi-project builds HOT 2
- uploadArchives task fails with Gradle 2.3+ when distZip and distTar are not enabled HOT 4
- How to set classifier for archives HOT 4
- how to add additional archives to publish HOT 3
- "Must specify a repository for deployment" error HOT 4
- Cycle detected HOT 2
- Encrypt credentials in properties file HOT 1
- Make authorization error more user-friendly HOT 3
- gradle
- uploadArchives logging needed HOT 1
- How can I manually say upload to snapshot or stable repository ? HOT 6
- How force project version on Nexus HOT 2
- BOM support HOT 2
- Gradle 4.10.1 breaks modifyPom HOT 4
- uploadArchives fails with "Cannot invoke method readPassword() on null object" HOT 1
- Gradle Kotli-Dsl example HOT 3
- MavenPlugin is deprecated and scheduled to be removed in Gradle 7.0 HOT 2
- How to use in Multi-module project?
- Publish to Gradle Plugins repo HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-nexus-plugin.