Git Product home page Git Product logo

Comments (11)

dmoebius avatar dmoebius commented on June 7, 2024

Found a workaround:

allProjects {
    afterEvaluate {
        signing {
            project.gradle.taskGraph.whenReady {
                def uploadTasks = project.tasks.withType(Upload).matching { it.path.endsWith(":uploadArchives") }
                uploadTasks.each { task ->
                    task.repositories.mavenDeployer() {
                        beforeDeployment { MavenDeployment deployment ->
                            project.signing.signPom(deployment)
                        }
                    }
                }
            }
        }
    }
}

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 7, 2024

Would you might sending a pull request that reproduces this issue as integration test (see tests under src/integTest/groovy)?

from gradle-nexus-plugin.

dmoebius avatar dmoebius commented on June 7, 2024

Hmmm... difficult... I don't know that much Groovy. I'll give it a try, but it'll take some time, because I don't have that much time right now.

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 7, 2024

What version of the plugin did you use? Not sure when I'll get to it but feel free to send me a pull request.

from gradle-nexus-plugin.

dmoebius avatar dmoebius commented on June 7, 2024

org.gradle.api.plugins:gradle-nexus-plugin:0.6.1

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 7, 2024

OK, thanks. How do you apply/configure the plugin at the moment? In a subprojects or allprojects in your root project?

from gradle-nexus-plugin.

dmoebius avatar dmoebius commented on June 7, 2024

allprojects only contains:

allprojects {
  apply plugin: 'maven'
  apply plugin: 'signing'
}

Then I have a closure to configure all subprojects with a src/main/java folder:

configure(subprojects.findAll { new File(it.projectDir, 'src/main/java').directory }) {
  apply plugin: 'java'
  compileJava.options.encoding = 'utf-8'
  compileJava.sourceCompatibility = JavaVersion.VERSION_1_6
  compileJava.targetCompatibility = JavaVersion.VERSION_1_6
  ...
  apply plugin: 'nexus'
  nexus {
    attachTests = true
    sign = true
  }
  ...
}

All subprojects are in a common folder called "projects", ie.:
projects/subprojectA
projects/subprojectB/subprojectB1
projects/subprojectB/subprojectB2
etc.

The subprojects don't have any gradle build files; everything is in the monolithic build.gradle in the root dir.

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 7, 2024

Alright. Sounds like I will need to set up a test case to see what's going on.

BTW: The Maven and Signing plugins are applied internally by the Nexus plugin so you don't need to do that. To figure out the Java projects you might also rather check if the Java plugin is applied.

from gradle-nexus-plugin.

dmoebius avatar dmoebius commented on June 7, 2024

I got errors when I omitted the maven and signing plugin, but I cannot recall whether it boiled down to the Nexus plugin or any other instruction I have in my build file.

How do I check if the Java plugin is applied? Note: I don't want to apply the Java plugin in allprojects, and I don't want to add it to every subproject manually.

Btw. you can see our project here, it's actually on GitHub, too:
https://github.com/copper-engine/copper-engine

from gradle-nexus-plugin.

bmuschko avatar bmuschko commented on June 7, 2024

That makes sense. That would be project.plugins.hasPlugin('java'). I will have a look at your project when I get the time.

from gradle-nexus-plugin.

dmoebius avatar dmoebius commented on June 7, 2024

Verified, works. Many thanks!

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.