Uploading SWC to Maven Repo

Ernesto Morales-Perea's Avatar

Ernesto Morales-Perea

15 Nov, 2011 07:53 PM

Hi,

How do I go about uploading the resulting swc of the build task to a Maven repository?

If I apply plugin: 'maven' I get the following error:

A problem occurred evaluating root project 'client'.
Cause: Cannot add a configuration with name 'default' as a configuration with that name already exists.

Thanks,
Ernesto

  1. Support Staff 1 Posted by Yennick Trevels on 15 Nov, 2011 10:37 PM

    Yennick Trevels's Avatar

    mmm, looks like we're already using that configuration name in GradleFx, so that's probably the cause of this conflict. I'll try to find a solution for this (probably during the weekend).

  2. 2 Posted by Ernesto Morales... on 16 Nov, 2011 05:50 PM

    Ernesto Morales-Perea's Avatar

    Yennick,

    Thanks -- sounds good.

    Ernesto

  3. Support Staff 3 Posted by Yennick Trevels on 20 Nov, 2011 05:51 PM

    Yennick Trevels's Avatar

    It's more complicated then I thought it would be. Apparently the maven plugin makes use of the java plugin and that's why it pulls in those configurations and tasks, so I'm afraid those two are somewhat bound to each other. I've opened a topic on the Gradle forum to ask if there's a solution for this: http://forums.gradle.org/gradle/topics/maven_plugin_imports_java_pl...

  4. 4 Posted by Ernesto Morales... on 21 Nov, 2011 08:12 PM

    Ernesto Morales-Perea's Avatar

    Hi Yennick,

    Thanks for the update. From the forum link, looks like you've found a solution. Please keep me posted.

    Regards,
    Ernesto

  5. Support Staff 5 Posted by Yennick Trevels on 21 Nov, 2011 08:30 PM

    Yennick Trevels's Avatar

    Well, only for part of the problem :)
    I got the problem fixed that you encountered with the duplicate 'default' configuration, but when applying the maven plugin it doesn't add the install task because the maven plugin only configures the install task when the java plugin is present.
    So hopefully they can come up with a solution.

  6. Support Staff 6 Posted by Yennick Trevels on 26 Nov, 2011 01:33 PM

    Yennick Trevels's Avatar

    I've opened an improvement request on the Gradle bugtracker: http://issues.gradle.org/browse/GRADLE-1963

    I'm 99% sure this is something they need to fix in the Gradle plugin, because it shouldn't depend on the java plugin to add the install task.
    I've put everything in place so that GradleFx should be compatible with the Maven plugin once they fix the issue, so these changes will be in the next GradleFx release (probably in one of the following days).

  7. Support Staff 7 Posted by Maxime Cowez on 05 Mar, 2012 10:09 AM

    Maxime Cowez's Avatar

    Hi Yennick,

    It seems your improvement request isn't getting the love it deserves (though I registered especially to vote for it). Can you think of a workaround? This is close to a blocking issue for me :(

    I'm currently working around it by using a 'flatDir' repository, but that requires a local path. I'd much rather upload to the local maven cache.

  8. Support Staff 8 Posted by Yennick Trevels on 05 Mar, 2012 10:22 AM

    Yennick Trevels's Avatar

    Maybe I'll have to implement the install task myself or fix that change request myself. In the meantime, can you try the following:

    userHome = System.getProperty("user.home")
    
    uploadArchives {
        repositories {
            mavenDeployer {
                repository(url: "file://{userHome}/.m2/repository/") 
            }
        }
    }
    

    I think this should do somewhat the same thing. Then you can install them to your local repository with "gradle uploadArchives". Hope this works :)

  9. Support Staff 9 Posted by Maxime Cowez on 05 Mar, 2012 11:03 AM

    Maxime Cowez's Avatar

    Success!!
    Definitly a better workaround.
    Thanks a lot for your quick reply.

  10. Yennick Trevels closed this discussion on 11 Jun, 2012 06:36 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

07 May, 2023 04:17 PM
28 Apr, 2023 11:22 PM
23 Apr, 2023 09:43 AM
03 Nov, 2022 01:22 AM
29 Jun, 2022 05:39 PM

 

04 Aug, 2021 12:50 PM
15 Apr, 2021 06:10 PM
15 Jan, 2021 06:56 PM
09 Mar, 2020 11:11 PM
09 Mar, 2020 11:09 PM
17 Apr, 2019 02:51 PM