I have downloaded and copied the http-builder-0.5.0-RC2.jar to the lib folder of my grails project. I am using GGTS and see the jar in my lib folder when I open the project.
BuildConfig.groovy has the following line in the dependency section:
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.0-RC2'
When I try to reference a class from the jar the I am getting a reference error indicating the class name cannot be resolved.
Is there something I am missing in regards to importing classes from a jar file? I am new to java / groovy and would appreciate some help. Thanks.
import groovyx.net.http.HTTPBuilder
This results in:
Groovy:unable to resolve class groovyx.net.http.HTTPBuilder
I have downloaded and copied the http-builder-0.5.0-RC2.jar to the lib folder of my grails project.
This should not be necessary, since HttpBuilder is in Maven Central. Just declare the dependency and let Grails download the JAR itself along with its transitive dependencies. You may also want to consider using a more recent version of HttpBuilder (0.5.0-RC2 is from 2009, at the time of writing the current release is 0.7.1).
Delete the JAR from your lib directory and try refreshing your Grails dependencies again.
Related
I'm trying to release a library on nuget, but when trying to install it, it says that it can't find the dependency.
I'm using paket and a paket.template in order to generate the nupkg. I have no real idea how dependency resolution happens in F#/.NET, but it looks like in my .fsproj file, it's referencing a relative path.
The dependency I'm trying to include is Colorful.Console.
In my .fsproj, it references it like:
<Reference Include="Colorful.Console">
<HintPath>..\packages\Colorful.Console\lib\net461\Colorful.Console.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
which works fine locally, and seems to have no apparent problems during paket pack, but when installing in a different project from the remote source (also using paket), it tells me that MyLibrary can't find dependency 'Colorful.Console'.
It's in my library's dependencies with nuget Colorful.Console, and that dependency seems to be carried through, as Colorful.Console is in the packages folder of my other project (and shows up under 'References' in Visual Studio).
I've included the example project here: https://github.com/deecewan/GenbankDemoProject
Here is the library project, and more directly the paket.template used to generate the package.
Edit: I have updated my project thanks to advice from #rmunn - it is now meant to load the Colorful.Console version from net461 when the framework is net472. This is what I want/expect, I think. However, I still get the following error:
parse error FS3053: error : The type provider constructor has thrown an exception: Could not load file or assembly 'Colorful.Console, Version=1.2.9.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Attached below is a screenshot of the references of the project - GenbankTypeProvider and Colorful.Console are both included.
I mistakenly added some jars to Grails dependencies using Java build path dialogue of GGTS.
Now I want to remove them.
But the build path dialogue offers no chance to do so.
Just remove the project from eclipse, delete .project and .classpath files. regenerate eclipse files using command grails integrate-with --eclipse and import the project again and you classpath should be good.
I have installed Umbraco via nuget to empty project. I then ran the project so the installation started.
After installation ran there was lots of generated files so I have included them in project so that I can use source control.
I then ran project again and got the error:
Could not load file or assembly 'Newtonsoft.Json'
There is the dll file for this in bin folder and also a reference.
I think this might be because the "packages" folder created by nuget installation is not included in project. I do not know how to include this.
Does anyone know what I should do?
It turns out problem was in the Newtonsoft.Json file in nuget package. I downloaded latest dll from codeplex and it fixed the problem.
Is there a way for me to add dependencies from other folders/projects(non-grails, but definitely java projects) into my grails project? I've tried searching but didn't really get much of an answer. :(
You can use every possible library which is in a maven repository. So transform your java project to a maven or gradle project. Install your builded jar to maven repo and then you can add dependency in grails-app/conf/BuildConfig.groovy.
dependencies {
compile "your.group:your.artifact:1.0"
}
You have to get the code into your project somehow.
These are the options:
JAR
Package your module as a jar file and copy this to your project's lib/ directory.
source code
Copy the source code for your module into src/java/
Maven Artifact
Package your module as a maven artifact, and specify it in the dependencies closure of grails-app/conf/BuildConfig.groovy.
Read more in the grails documentation at http://grails.org/doc/latest/guide/conf.html#configurationsAndDependencies
Usually, when creating a WebWorks Javascript extension you export your source files into a JAR with the appropriate provisions (e.g. library.xml, *.java). Usually, 3rd party libraries are in a jar file with compiled java code. I included the 3rd party jar inside my custom extension. This creates a jar within a jar file structure. The Blackberry Widget packager (bbwp) opens up the jar and compiles the Java files to be used in your WebWorks application. Blackberry's Java compiler is unable to compile because the appropriate packages are not visible in the class-path at the time of compilation. The appropriate packages are in the 3rd party library jar included in the extensions jar. Does anyone know how to resolve this class-path issue? Do I need the 3rd party source files instead of a jar? Is there documentation on how the BlackBerry Widget Packager (bbwp) works?
Thanks in advance.
Follow the instructions "Use precompiled classes in an extension" listed in the following link. That should resolve the compilation issue.
Creating a JAR file that defines your extension