Giter Site home page Giter Site logo

Comments (12)

bmuschko avatar bmuschko commented on September 14, 2024

At the moment I can't see a problem with your configuration. How do you call the task? Does the task depend on another task?

Do you have the project available on a repository or can you create a sample project for me that re-produces the error?

from gradle-cargo-plugin.

hwolf avatar hwolf commented on September 14, 2024

The build file in the issue is part of a multi project. But I can reproduce the problem with a very simple project consists only of a build file:

def TOMCAT_URL = "http://apache.mirror.iphh.net/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.zip"

apply plugin: 'cargo'

dependencies {
    def CARGO = '1.3.1'
    classpath "org.codehaus.cargo:cargo-core-uberjar:$CARGO",
              "org.codehaus.cargo:cargo-ant:$CARGO"
}

buildscript {
    repositories { 
        add(new org.apache.ivy.plugins.resolver.URLResolver()) {
            name = 'GitHub'
            addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
        }
    }
    dependencies { 
        classpath 'bmuschko:gradle-cargo-plugin:0.5.6'
    }
}

cargo {
    containerId = 'tomcat6x'
    port = 8090

    deployable {
        file = file('xxxx.war')
        context = 'xxxx'
    }

    local {
        installer {
            installUrl = TOMCAT_URL
            downloadDir = file("$projectDir/download")
            extractDir = file("$buildDir/extract")
        }
        output = file('build/output.log')
    }
}

I call the build file with

gradle tasks

The error occurs no matter which tasks I choose.
The result is always the error

Container ID was not defined.

I tested it with Gradle 1.3, 1.2 and 1.1 under Ubuntu 12.4 with Java 1.6.0_26 (Sun Microsystems Inc. 20.1-b02).

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on September 14, 2024

Found the problem. You didn't use the specific configuration defined by the Cargo plugin: cargo. This is the correct way of declaring it.

dependencies {
    def CARGO = '1.3.1'
    cargo "org.codehaus.cargo:cargo-core-uberjar:$CARGO",
          "org.codehaus.cargo:cargo-ant:$CARGO"
}

However, the error message is misleading and not the actual root cause. I will have to put in some validation code that checks if the configuration was set correctly. Leaving this open until fixed. Please let me know if you run into other issues.

from gradle-cargo-plugin.

hwolf avatar hwolf commented on September 14, 2024

Thanks
That was the mistake.

from gradle-cargo-plugin.

davidkoch avatar davidkoch commented on September 14, 2024

I have a similar phenomenon. When using the the cargo plugin lots of real other errors are hidden by the "Container ID was not defined" error message especially if there are exceptions in task configurations.

What I have observed is that the cargo plugin adds its task quite late so I guess there is a afterEvaluation hook and probably this one catches those exceptions silently and goes on with checking the cargo config. It seems to checks first for the containerID which is unfortunately never set if an previous exception prevented the cargo config closure to be run at all.

Thus is just a suspection I derived from my observations with the cargo plugin. But fact is that the "Container ID was not defined" error message hides lots of other error cause.

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on September 14, 2024

@davidkoch Your issue will be fixed with Issue #29.

from gradle-cargo-plugin.

abirmingham avatar abirmingham commented on September 14, 2024

I was able to reproduce this issue with 0.5.6, and can say that it is resolved for me with 0.5.7.

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on September 14, 2024

Resolving this issue. Thanks for the feedback.

from gradle-cargo-plugin.

eddgrant avatar eddgrant commented on September 14, 2024

I'm keen to try 0.5.7 but it doesn't seem to be available in maven central or on the GitHib download URL http://cloud.github.com/downloads/bmuschko/gradle-cargo-plugin/gradle-cargo-plugin-0.5.6.jar. Are there any plans to rectify this soon or do I need to build the jar locally for now?

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on September 14, 2024

It won't be available in the download section of Github anymore as you can't upload new files anymore. What's your issue with getting it from Maven Central? I can see the files here.

from gradle-cargo-plugin.

eddgrant avatar eddgrant commented on September 14, 2024

Weird, I was checking http://mvnrepository.com/artifact/org.gradle.api.plugins/gradle-cargo-plugin (which doesn't list it) and had my project configured to download the artefact from Github. Have now switched project over to use Maven Central and have obtained 0.5.7 successfully. Can also confirm it resolved my 'Container ID was not defined' issue. many thanks!

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on September 14, 2024

Awesome!

I think http://mvnrepository.com is some sort of third-party service. The direct search to Maven Central is this URL: http://search.maven.org/#search%7Cga%7C1%7C.

from gradle-cargo-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.