Giter Site home page Giter Site logo

Comments (15)

bmuschko avatar bmuschko commented on August 10, 2024

I just copy/pasted your code into a brand-new build script and ran it with Gradle 1.2. Works fine for me. The plugin gets downloaded correctly. BTW: Version 0.3 of the plugin is pretty old. I'd recommend using the latest version.

Some questions for you:

  • Is your project part of a multi-project build?
  • Are you sitting behind a proxy?
  • Do you have the project available on GitHub by any chance so I can try it out?

from gradle-cargo-plugin.

zacharycarter avatar zacharycarter commented on August 10, 2024

No matter which version of the plugin I use, I experience the same issue.

  1. I've tried this on several projects none of which have been multi-project / module and they all fail.
  2. I am sitting behind a company proxy.
  3. I don't have the project available on github however even if I dump the contents of the script above into a build.gradle file sitting in an empty directory the result is the same.

If I delete my gradle caches folder from my home folder I can see that the jar file is being downloaded, however it's never placed into my gradlehome/lib/plugins directory and I'm guessing it's not being loaded into the classpath either.

Thanks for the quick response / help!

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

I assume you have the proxy configured correctly in your gradle.properties. Otherwise, the plugin wouldn't have been downloaded. At the moment I can't see what the issue would be. Can you do me a favor and send me a sample project including the Gradle Wrapper as email? I'd like to try it out on my machine.

from gradle-cargo-plugin.

zacharycarter avatar zacharycarter commented on August 10, 2024

I don't have any proxy configuration set up in my gradle.properties file however I've never struggled with pulling down external dependencies. I'm not even sure if the information I would need to configure those properties is available to me, however no other developer has complained about proxy issues and I see other scripts in our source repository referencing plugins authored by you so I must be doing something wrong.

I'll work on getting a sample project put together and in the mean time I'll examine the existing build.gradle files to see if I can find any discrepancies between them and mine.

Thanks for the help!

-Zach

from gradle-cargo-plugin.

zacharycarter avatar zacharycarter commented on August 10, 2024

I'm still working on the sample project Ben but this is confounding the crap out of me...

I downloaded the latest release of the plugin project and built it with gradle 1.2

I then took the jar from the projectdir/build/libs folder (bmuschko-gradle-cargo-plugin-5b3cbdd-0.5.6.jar) and placed it inside my gradlehome/lib/plugins folder

I then ran gradle tasks inside the same folder that the above build.gradle sample is located in (this is just an empty directory, no source files or anything, I simply want the plugin jar to be included in the classpath so that the apply plugin: 'cargo' directive resolves.

I still get the error - The plugin with id 'cargo' not found.

Even with a much simpler build.gradle script -

apply plugin: 'cargo'

cargo {
    containerId = 'tomcat6x'
    port = 8080
    context = "mycontext"
    remote {
        hostname = "192.168.1.101"
        username = "tomcat"
        password = "tomcat"
    }
}

dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5'
    cargo 'org.codehaus.cargo:cargo-core-uberjar:1.1.1',
          'org.codehaus.cargo:cargo-ant:1.1.1',
          'jaxen:jaxen:1.1.1'
}

I get the same error. Something is just off here, I've installed the plugin as any plugin should be installed when not running the wrapper, and the plugin is still not loaded. Any ideas? If not I'll go ahead and escalate this on the gradle forums and we can close this up on here as it really doesn't seem an issue with your plugin, and seems to be related to my gradle install / configuration.

Thanks again Ben!

-Zach

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

I am getting a little confused about why you are copying the downloaded plugin JAR to a different location. You won't need to do any manual copying. The buildscript closure tells your script to automatically download the JAR file from GitHub and add it to the classpath of your script. That's it - no manual steps needed from your side.

from gradle-cargo-plugin.

zacharycarter avatar zacharycarter commented on August 10, 2024

I understand that the buildscript closure is supposed to take care of that for me. I figured for now, just so I could get started with the plugin I'd try a manual installation since the buildscript closure doesn't seem to be working in my environment for whatever reason. It's not just this plugin, all plugins seem to have this deficiency.

from gradle-cargo-plugin.

zacharycarter avatar zacharycarter commented on August 10, 2024

Hi Ben,

I've uploaded a sample project using your tomcat plugin to github - https://github.com/carterza/GradlePluginIssue

I've commented out the offending line - "apply plugin: 'tomcat'" in the build.gradle file. If I uncomment this line I receive the "Plugin with id 'tomcat' not found" error.

Thanks,

-Zachary Carter

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

Thanks, I just un-commented the line and tried it out. Works fine for me when I run ./gradlew tasks. I'd recommend you try out this project outside of your enterprise network e.g. from home. I don't think it's a problem with Gradle per se.

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

I don't think this is a problem with the plugin as this issue occurs with every community plugin you are trying to use. As it is not reproducible I am going to close this ticket. Please let me know if you need additional help.

from gradle-cargo-plugin.

chrisisbeef avatar chrisisbeef commented on August 10, 2024

I am experiencing this same problem attempting to add cargo to the spring-security project. My use case right now is just to get the plugin loading - which it will not. You can see the simple changes I made to the spring-security project in my fork here --> Contrast-Security-OSS/spring-security@74d235d

I have tried this both on my Mac and Windows environments (different systems) so I don't think it is something environmental. Is this a result of the spring-security project using v1.12 of Gradle for the gradlew?

$ ./gradlew --version


Gradle 1.12

Build time: 2014-04-29 09:24:31 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421

Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Ivy: 2.2.0
JVM: 1.6.0_20 (Sun Microsystems Inc. 16.3-b01)
OS: Windows 7 6.1 amd64

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

@chrisisbeef You are running into two issues here.

  1. The latest version of the plugin is not compatible with Gradle 1.12 anymore. You will need to use at least Gradle 2.0. I'd urge you to upgrade to the latest Gradle version rather sooner than later. I won't release any more versions of the plugin for Gradle 1.12.
  2. If you a apply a binary plugin from a script plugin, you cannot use the plugin identifier when applying the plugin. You will need to use the fully-qualified classname. It's a known limitation of Gradle at the moment.

Here's your solution.

If you are using Gradle 2.x:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.bmuschko:gradle-cargo-plugin:2.0.1'
    }
}

apply plugin: com.bmuschko.gradle.cargo.CargoPlugin

If you are using Gradle 1.12:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'org.gradle.api.plugins:gradle-cargo-plugin:1.5.2'
    }
}

apply plugin: org.gradle.api.plugins.cargo.CargoPlugin

from gradle-cargo-plugin.

chrisisbeef avatar chrisisbeef commented on August 10, 2024

Awesome! That took care of it, thanks for your help!

I know the spring team is planning to upgrade to gradle 2, so when it gets there we will migrate the plugin to the latest version.

from gradle-cargo-plugin.

bmuschko avatar bmuschko commented on August 10, 2024

@chrisisbeef Cool. BTW: Similar mechanics apply to the Tomcat plugin. I saw that the project also uses that one.

from gradle-cargo-plugin.

chrisisbeef avatar chrisisbeef commented on August 10, 2024

Since the Tomcat plugin won't fork the JVM that is the reason to move to Cargo so we can instrument the sample apps with the Contrast Security Java Agent - so I don't think it will be a huge issue for Tomcat. Also Rob has Tomcat working already across the project, so I'm not sure if he did something differently or not. Thanks!

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.