How to put a JAR file in a Play 2 project and use it? - dependency-management

In Play 1, we can put some JAR files into the /lib directory. But there is no such a directory, and I don't find any information to do this.
Play 2 uses repositories, but sometimes I just want a quick and dirty way to use a JAR file. How do I do that?

Since Play 2 applications are built using sbt, you can just follow their convention for unmanaged dependencies: put your JAR file in the lib/ directory.

Related

Java war file wrongly (?) detected as an invalid zip file

To do a test, I have to add a jar file into a Java war file I've created with Maven. The war file works itself fine.
To insert my lz4-java-1.6.0.jar into application-metier-et-gestion.war on internal zip folder /WEB-INF/lib, I use this command :
zip -b WEB-INF/lib application-metier-et-gestion.war lz4-java-1.6.0.jar
But I receive that error message :
zip warning: expected 354 entries but found 84
zip error: Zip file structure invalid (application-metier-et-gestion.war)
I can do and redo mvn clean install it will always create a runnable war that seems perfect to me, but that zip declares invalid. Who is wrong ?
I case zip would be going wrong, what is the workaround to do what I want ? Is there a way through another tool ? tar ?
I case Maven would be going wrong and create a bad war file each time, how to detect the part it is creating wrongly ?
right click the war file ,rename the file extension war into zip
example :
test.war -> test.zip
As far as I can see you tried to add an additional library to the archive.
JAR files and WAR files are plain ZIP files. There is only one rule you have to obey, library files must not be compressed.
If you want to add JAR files to a JAR or WAR file, disable compression for the specific file to be added.

NodeJS archive manager

I need to get the content of archives and then I want to uncompress the selected one - but I dont want to uncompress the archives to know what's in it. I'd like to list and uncompress at least zip and rar, but (if that's possible) I don't want to be limited to only these two.
Can you advise good npm modules or other projects to achieve this?
Here's what I came up with:
zip
I found node-zip can only unzip files, but not list archive content.
rar
The best solution seems node-rar, but I can't install it on Windows.
node-uncompress This does what it says: It's an "Command-line wrapper for uncompressing various file types." So there is again no possibility to list archive content.
Currently I try to get node-uncompress to list files and hopefully it must never run cross-platform.
Solution:
I am now using 7zip with the node module node-7z instead of trying to get every archive working on its own. The corresponding site is: https://www.npmjs.com/package/node-7z
This library uses the OS independent archive manager 7zip. On Windows 7za is used. "7za.exe (a = alone) is a standalone version of 7-Zip". I've tested it on Windows and Ubuntu and it works great.
Update:
At Windows: Somehow I just got it working by adding 7za to the Path variables - not by adding 7za.exe to the "the same directory of your package.json file." like the description says.
Update 2:
On Windows 7za, that's referred in the node-7z post, cannot handle .rar-archives. So I'm using the "casual" 7-zip instead of 7za.exe. I just renamed the commanline 7z.exe to 7za.exe and added the 7-zip folder to the Path Variables.

Geb Testing - project folder structure contains lot of files ending as closure.class

I am new to geb testing. We have two project folders. One of them is a subset of others. During last few days, whenever I check the status of the subset project folder using git shell, lot of closure.class files are showing as changed. But I am changing only the groovy files. I am not sure why this is happening? previously I haven't seen anything like this.
Also lot of class files are showing as untracked files.
The file name look like this.
xxx$_$spock_feature_7_29_closure6.class
We are using IntelliJ IDE.
There are lots of files, I mean class files generated when you try to build using gradlew. As Peter had suggested already, create a .gitignore file and add anything you want to ignore, for instance:
*.log
build
.gradle
.DS_Store
*.ipr
*.iml
*.iws
out
*.pem
gradle.properties
and run the gradlew clean command. You will not see those anymore. Cheers!

trouble creating an axis 2 .aar file: xml/services not found error

I am trying to create an aar file using OSX 10.7.5 (as a part of this tutorial). To generate the .aar, I navigate to the directory holding my webservice in my eclipse workspace and type
jar cvf FirstWebService.aar ./*
This is the command that Apache says to use to generate the aar in their Code Listing 9 from the apache axis 2 documentation.
The command creates an.aar -- but something is wrong with the process that I am using to create the .aar because when I go to load the .aar file into tomcat's /webapps I get an .xml/services not found error.
I am not sure what to do to fix this error. If I search my computer's file system for the services.xml file, I can find it in /path to eclipse workspace/workspace/MyFirstWebService/WebContent/WEB-INF/services/FirstWebService/META-INF
but I am not sure if this file is supposed to be rolled in to the .aar file somehow or if I can just manually plunk this file somewhere into the apache directory structure to get the thing to run.
Note: I do not think I am manually unzipping or unpacking the aar like in this question. Axis2 web service error: services.xml not found I am just running the command listed above from the apache documentation.
Here is the .aar file
note I am using all of the same versions of the software as in the tutorial -- but I am using OSX 10.7.5 where they use windows in the tutorial. Accordingly, I have changed the make-aar command for windows shown in the tutorial (jar cvf FirstWebService.aar com META-INF) into the one shown above. If I just try to run the command from the tutorial jar cvf FirstWebService.aar com META-INF I get the same xml/services not found error. It gives this output in the terminal...
com: no such file or directory
META-INF: no such file or directory
added manifest
I found the issue. When you type the command to create the aar file you have to be in the directory .../EclipseWorkspace/EclipseProjectName/WebContent/WEB-INF/services. This directory contains /META-INF/services.xml. The process that makes the .aar file must be looking in this folder.

phonegap Blackberry webworks plugin

I am trying to create a BlackBerry Webworks plugin using Phone gap. I am trying to follow the instructions given in this link:
http://wiki.phonegap.com/w/page/35799737/How%20To%20Create%20a%20PhoneGap%20Plugin%20for%20BlackBerry%20WebWorks
however, the directory structure mentioned in the link and mine vary significantly, also there is no build.xml in the root directory to run the
ant create-plugin command,
Since Phonegap being converted to Cordova Project, has something changed in the process to be followed?
Thanks in advance.
Currently the way plugin is added is different:
Add customplugin.js to your project's www folder and include a reference to it in your html file after cordova.js.
Add the plugin source to your cordova.jar in your projects ext folder. Open cordova.jar with your favorite archive manager or use the jar to copy the CustomPlugin.java file into org/apache/cordova/plugins directory.
In your projects plugins.xml file add the following line:
ref:
https://github.com/phonegap/phonegap-plugins/tree/master/BlackBerry/ChildBrowser

Resources