GithubHelp home page GithubHelp logo

Could not find any version :) about gretty HOT 29 CLOSED

akhikhl avatar akhikhl commented on August 21, 2024
Could not find any version :)

from gretty.

Comments (29)

akhikhl avatar akhikhl commented on August 21, 2024 1

I just fixed it - please try again.
It seems jcenter does not understand '+' notation for the latest version of the component. I will ask.
Thank you for reporting!

from gretty.

Aung2 avatar Aung2 commented on August 21, 2024 1

Hi akhikhl ,

I have some problem about below error.

Execution failed for task 'appRunDebug'
org.gretty.jacocoHelper cannot be cast to org.gradle.api.task

Please help me...

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

There is another error (maybe it's related to previous):
In IntelliJ, if I change

apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty9-0.0.20.plugin'
to
apply plugin: 'org.akhikhl.gretty'
the following error pops up when trying to refresh gradle project (build project files):
Error:Cause: groovy.lang.MissingMethodException: No signature of method: org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.eachDependency() is applicable for argument types: (org.akhikhl.gretty.SpringBootResolutionStrategy$_resolveDependencyVersions_closure3_closure4) values: [org.akhikhl.gretty.SpringBootResolutionStrategy$_resolveDependencyVersions_closure3_closure4@6087b587]
Possible solutions: eachDependency(org.gradle.api.Action)
No signature of method: org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.eachDependency() is applicable for argument types: (org.akhikhl.gretty.SpringBootResolutionStrategy$_resolveDependencyVersions_closure3_closure4) values: [org.akhikhl.gretty.SpringBootResolutionStrategy$_resolveDependencyVersions_closure3_closure4@6087b587]
Possible solutions: eachDependency(org.gradle.api.Action)

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Which version of gradle and IntelliJ IDEA?

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I've tried gradle version 1.11, 1.12 on IntelliJ IDEA 13.1.3
Currently falling back on

apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty9-0.0.20.plugin'

because it works.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

OK, I'll have a look at the problem.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

Thanks!

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

I just tried importing helloGretty project into IntelliJ IDEA 13.1.3 with Gradle 2.0. It imports compiles and runs without errors.
Is upgrade to Gradle 2.0 not a good option for you?

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Any new information on this?

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

When upgrading to gradle 2 I get the following error in IDEA 13.1.3:

Error:Cause: org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver cannot be cast to org.gradle.api.internal.file.copy.CopySpecInternal

It seems like there's an error caused by the ide. (http://forums.gradle.org/gradle/topics/gradle_v2_0_fails_to_refresh_projects_using_intellij)
Maybe an update in IDEA will fix this.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I've updated the IDEA to 13.1.4, now it's working with gradle-2.0. Great!

Now I get another exception when trying to run the app:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':appRun'.
> Unable to find a single main class from the following candidates [ ... classnames with main function ... ]

why is it happening?

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

On 07/29/2014 11:42 AM, Gabor Bota wrote:

I've updated the IDEA to 13.1.4, now it's working with gradle-2.0. Great!

Now I get another exception when trying to run the app:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':appRun'.

    Unable to find a single main class from the following candidates [ ... classnames with main function ... ]

why is it happening?


Reply to this email directly or view it on GitHub
#32 (comment).

Could you, please, run it with --stacktrace flag and provide the
resulting stack trace?

Best regards,
Andrey Hihlovskiy.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I've uploaded the stctrace to pastebin: http://pastebin.com/Jug0HgLe

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

The error is apparently caused by multiple main classes seen by spring-boot:

Unable to find a single main class from the following candidates [com.gravit
yrd.receng.cp2.util.PasswordGenerator, com.gravityrd.receng.cp2.startembedded.StartApp]
        at org.springframework.boot.loader.tools.MainClassFinder$MainClassesCallback.getMainClass(MainClassFinder.java:3
41)

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

You can specify conrete main class (for spring boot) via:

gretty {
  springBootMainClass = 'package.ClassName'
}

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

So I should define the jetty main class there?
I would like to run the jetty and deploy the project there, use only with servlets. I don't want to use any of the main classes in the project. That was not an issue in an earlier version.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

do you have springBoot=true in your configuration? then you need spring-boot main class - either automatically detected or explicitly specified.
jetty main class is not needed anyway.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I don't have a spring-boot enabled project. I have not modified anything at all besides changing to apply plugin: 'org.akhikhl.gretty' from gretty9-0.0.20.plugin.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I've defined springBoot=false in gretty config (in the build file).
Still getting the error. I think in the task appRun, there should be no search for startable main class in the project.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Please have a look at this line: https://github.com/akhikhl/gretty/blob/master/libs/gretty/src/main/groovy/org/akhikhl/gretty/StartBaseTask.groovy#L36

This is the only place where SpringBootLauncher is instantiated, and it is clearly instantiated in your case, judging from stacktrace.

Take a look at the condition there: SpringBootLauncher is only used if function ProjectUtils.anyWebAppUsesSpringBoot returns true.

Now take a look at these lines:
https://github.com/akhikhl/gretty/blob/master/libs/gretty/src/main/groovy/org/akhikhl/gretty/ProjectUtils.groovy#L26
and
https://github.com/akhikhl/gretty/blob/master/libs/gretty/src/main/groovy/org/akhikhl/gretty/ProjectUtils.groovy#L179

As you see, gretty assumes you are using spring boot as soon as your project depends on artifacts of group 'org.springframework.boot'.

Now, the main question: if you do gradle dependencies --configuration compile, do you see there that your project depends on anything from 'org.springframework.boot' group?

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I've created a pastebin for the output: http://pastebin.com/F6ZFcGzF

It seems like the jsonrpc4j lib is using springboot, but I don't think this should be a problem.
I think using springboot should be configurable by the springBoot parameter. Now it's set to false, but the error still occurs.

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I think I should learn some more Groovy and fix some errors by myself shortly :)

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Very good that you found it :)

Could you, please, try excluding spring-boot dependency like this:

configurations {
    compile.exclude group: 'org.springframework.boot'
}

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

It's working now, but it does not seem like a solution, it's rather a hack in my opinion... Am I wrong with this?

Anyway this configuration will stay in the buildfile as long as the project doesn't need sprint-boot...

Thanks for the help!

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Well, if your project depends on spring-boot, that should normally mean you are building spring-boot application.
As a compromise (so that both you and me are happy, you - with simplicity, me - with purity) I can suggest the following: springBoot property could support not only true/false, but also special value 'suppress'. The meaning of all three values:

  • springBoot=true : you convert your application to spring-boot. Gretty automatically adds spring-boot dependencies and uses special launcher for it.
  • springBoot=false (the default) : your application is not spring-boot, if it does not have spring-boot dependencies. If you add spring-boot dependencies, then you know what you are doing and it is still spring-boot application.
  • springBoot='suppress' : your application is 100% not spring-boot. If there were spring-boot dependencies, they will be excluded. Some things might not work in this case (you excluded dependencies, thats why)

Your opinion?

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

I think that it should ony test for first level dependencies for springboot by default - so a dependency of a library would not be detected. This would be good, because build won't break on gretty version upgrade. (Is it unavoidable to scan in the whole dependency tree, not just in the first level? Answering my question, in a multi-project build testing the first level would be a problem, because what if the root project's first dependencies doesn't contain spring boot)

If scanning only first level dependencies couldn't work, the method you wrote is a good solution imho.
Thanks for your help again.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Where did you get com.github.briandilley.jsonrpc4j:jsonrpc4j:1.2.1 ?
It seems not to be available via jcenter or maven central.

from gretty.

myowintun avatar myowintun commented on August 21, 2024

Hi akhikhl,

I have same problem that

Execution failed for task 'appRunDebug'
org.gretty.jacocoHelper cannot be cast to org.gradle.api.task

Please help me too

from gretty.

saladinkzn avatar saladinkzn commented on August 21, 2024

Do you use gradle-2.14? Revert to 2.13 if you do. I need some time to port jacocoHelper to version that is compatible with gradle 2.14

from gretty.

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.