Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow farm/webapp task to include dependencies from repo #13

Closed
wcrowell opened this issue May 11, 2016 · 5 comments
Closed

Allow farm/webapp task to include dependencies from repo #13

wcrowell opened this issue May 11, 2016 · 5 comments

Comments

@wcrowell
Copy link

This issue is a possible duplicate of [https://github.com/akhikhl/issues/72].

With the farm/webapp task you cannot include additional dependencies other than what is in the maven dependency. Even if the webapp has a gradle.build, the user may not have access to add an additional dependency.

To work around this issue, I had to do download the dependency and add it to the classpath of the webapp:

farm { webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, classPath: ["${project.projectDir}/etc/jars/cas-server-support-rest-4.2.1.jar"] ... }

These additional dependencies add behavior to the webapp that have been left out because the majority of users do not use this functionality.

I would like to do something like this:

farm { webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, dependencies { "org.jasig.cas:cas-server-support-rest:4.2.1" } ... }

@saladinkzn
Copy link
Owner

Hello, I'll try to implement this feature.

@saladinkzn
Copy link
Owner

I've added this feature into current snapshot:

farm {
    webapp "ru.shadam.gretty.test:test-webapp:1.0", contextPath: '/test', inplace: true , dependencies: [ "com.google.guava:guava:19.0" ]
}

Do not forget to add

  maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }

in repositories section (both in buildscript {} and your project's)
Run gradle with --refresh-dependencies if your snapshot was not updated automatically.

@saladinkzn saladinkzn mentioned this issue May 26, 2016
9 tasks
@wcrowell
Copy link
Author

I will attach this to the issue, but I wanted to email you.

It failed. I ran:

`gradle --refresh-dependencies clean farmIntegrationTest
build.gradle.txt
settings.gradle.txt
gradle.properties.txt

`

I am running with 1.2.6-SNAPSHOT from the oss.jfrog.org artifactory that is the May 26th build: [http://oss.jfrog.org/oss-snapshot-local/ru/shadam/gretty/gretty/1.2.6-SNAPSHOT/gretty-1.2.6-20160526.001410-15.jar]

I do have an included webapp that is in the project that did work with 1.2.4 and 1.2.5. I may be missing something in the webapp line that contains the protected-web-app (problem line is in bold):


farm {
webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, dependencies: [ "org.jasig.cas:cas-server-support-rest:4.2.1" ]
webapp "org.jasig.cas:cas-management-webapp:$cas_version", contextPath: '/cas-services', inplace: true
webapp ':protected-web-app'

Here is the output:

gradle --refresh-dependencies clean farmIntegrationTest

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':protected-web-app'.
> Could not find matching constructor for: org.akhikhl.gretty.ProductConfigurer(org.gradle.api.internal.project.DefaultProject_Decorated, java.io.File, java.lang.String, org.akhikhl.gretty.ProductExtension_Decorated)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.268 secs

I am attaching build.gradle, settings.gradle, and gradle.properties.

@saladinkzn saladinkzn reopened this May 26, 2016
@saladinkzn
Copy link
Owner

I can suggest you to remove

apply from: 'https://raw.github.com/saladinkzn/gretty/master/pluginScripts/gretty.plugin'

line from your build.gradle. It's really not nessessary if you're using
buildscript {}
just add apply plugin: 'org.akhikhl.gretty' instead.

As for the bug it looks like version clash in classpath that removing apply from: can fix. Can your provide gradlew buildEnvironment and gradlew dependencies output?

@saladinkzn
Copy link
Owner

Fixed in shapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants