tag:support.gradlefx.org,2011-05-23:/discussions/questions/89-exception-is-thrown-when-dependencies-are-addedGradleFx: Discussion 2016-08-11T02:32:05Ztag:support.gradlefx.org,2011-05-23:Comment/290216232013-09-25T21:58:01Z2013-09-25T21:58:36ZException is thrown when dependencies are added<div><p>Hi Jhon,</p>
<p>At first glance it looks like you've misplaced your as3commons
dependencies. The <code>buildscript.dependencies</code> node should
contain only those dependencies required to run the Gradle build
script, i.e. just the GradleFx plugin artifact in this case.</p>
<p>Those as3commons <code>external</code> dependencies should go
into the project <code>dependencies</code> node together with the
<code>merged</code> libraries you've already got there.</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/290216232013-09-26T17:10:48Z2013-09-26T17:10:49ZException is thrown when dependencies are added<div><p>Thanks for you prompt response. I moved as3commons to the
project dependency node and now I am getting the following error
:</p>
<p>Thanks</p>
<p>gradle compile<br>
:copyresources :compileFlex</p>
<p>FAILURE: Build failed with an exception.</p>
<ul>
<li>
<p>What went wrong: Execution failed for task ':compileFlex'.</p>
<blockquote>
<p>Could not resolve all dependencies for configuration
':external'. Could not find group:org.as3commons,
module:as3commons-collections, version:1.1. Required by:
:TestGradleProject:unspecified</p>
</blockquote>
</li>
<li>
<p>Try: Run with --stacktrace option to get the stack trace. Run
with --info or --debug option to get more log output.</p>
</li>
</ul>
<p>BUILD FAILED</p>
<p>Total time: 6.196 secs<br>
xinexus2:TestGradleProject</p>
<pre>
<code> /**</code>
</pre>
<ul>
<li>Build File: follow the directions in the README.txt to
build</li>
<li>this plug-in from the source. * */</li>
</ul>
<p>buildscript {<br>
repositories { mavenCentral() } dependencies { classpath group:
'org.gradlefx', name: 'gradlefx', version: '0.6.4' } }</p>
<p>apply plugin: 'gradlefx'<br>
apply plugin: 'flashbuilder'</p>
<p>type = 'swf'<br>
srcDirs = ['src/']<br>
testDirs = ['test']<br>
testResourceDirs = ['test/testresources']<br>
resourceDirs = ['assets/']</p>
<p>// Option necessary to embed configuration file to cuePoint
class. additionalCompilerOptions = [<br>
'-static-link-runtime-shared-libraries=true' ]</p>
<p>mainClass = 'CallToAction.as'</p>
<p>dependencies {<br>
//merged files('lib/as3corelib.swc') merged fileTree(dir: 'lib/',
include: '*.swc')<br>
external group: 'org.as3commons', name: 'as3commons-collections',
version: '1.1', ext: 'swc'<br>
}</p></div>Jhontag:support.gradlefx.org,2011-05-23:Comment/290216232013-09-27T13:58:47Z2013-09-27T13:59:06ZException is thrown when dependencies are added<div><p>You didn't define any repositories where Gradle(Fx) is supposed
to look for your dependencies. Usually you'd pull dependencies from
Maven central:</p>
<pre>
<code>repositories {
mavenCentral()
}</code>
</pre>
<p>however I think as3commons is not available on Maven central. So
you have three options:</p>
<ul>
<li>find a public repository that has the as3commons artifact</li>
<li>publish the as3commons swc to a self-hosted repository</li>
<li>use a 'local' repository like you already did with your
<code>merged</code> dependencies</li>
</ul>
<p>For option number 2 you'll have to add the URL to your
self-hosted repo:</p>
<pre>
<code>repositories {
mavenCentral()
maven { url 'http://my/self-hosted/repo' }
}</code>
</pre></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/290216232013-09-27T15:20:14Z2013-09-27T15:20:14ZException is thrown when dependencies are added<div><p>Thanks Maxime. You guys have the best technical support.</p></div>Jhon