Comments (29)
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.
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.
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.
Which version of gradle and IntelliJ IDEA?
from gretty.
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.
OK, I'll have a look at the problem.
from gretty.
Thanks!
from gretty.
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.
Any new information on this?
from gretty.
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.
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.
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.
I've uploaded the stctrace to pastebin: http://pastebin.com/Jug0HgLe
from gretty.
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.
You can specify conrete main class (for spring boot) via:
gretty {
springBootMainClass = 'package.ClassName'
}
from gretty.
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.
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.
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.
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.
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.
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.
I think I should learn some more Groovy and fix some errors by myself shortly :)
from gretty.
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.
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.
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.
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.
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.
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.
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)
- Enable to run appStart task because of NoClassDefFoundError: Lorg/jCharts/properties/PieChart2DProperties
- Problem in appStart Task
- Examples folder is missing from master branch HOT 1
- Global logging.properties file for Tomcat
- how to appStartWar with war generated in subproject? HOT 2
- AppIntegrationTest is not using src/test/resources but src/main/resources for the server test instance
- Multiproject builds: Exception in thread "Thread-x" java.lang.IllegalStateException: The configuration ... was resolved from a thread not managed by Gradle. HOT 2
- jettyRun task produces java.lang.ClassNotFoundException: org.eclipse.jetty.security.DefaultAuthenticatorFactory
- Could not read script 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
- Object of class 'org.akhikhl.gretty.JettyWebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders
- this link is obsolete
- Can I use Gretty to generate code with OpenAPI?
- KeyStores with multiple certificates are not supported on the base class org.eclipse.jetty.util.ssl.SslContextFactory HOT 2
- "Cannot run Project.afterEvaluate" crash when Gretty applied to a Gradle sub-module via plugins block HOT 1
- org.akhikhl.gretty.Runner.run issue
- For a non spring boot application, gretty is complaining for spring boot dependency HOT 1
- gretty versions after 2.0.0 no longer available in the recommended repos HOT 2
- Gretty unable to find jstl.core
- apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin' and Could not HEAD
- Errors seem to leave gretty/jetty running without the ability to shutdown without killing processes manually HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gretty.