What is the JDK version that was used to compile the Tuckey UrlRewriteFilter JAR? - tuckey-urlrewrite-filter

What is the JDK version that was used to compile the Tuckey UrlRewriteFilter JAR ?
Tuckey UrlRewriteFilter Home page :
http://www.tuckey.org/urlrewrite/
JAR :
http://central.maven.org/maven2/org/tuckey/urlrewritefilter/4.0.3/urlrewritefilter-4.0.3.jar

It was built with this : Build-Jdk: 1.6.0_21
By the way, generally you can either unzip the jar and see the manifest file or you can use javap command on any class in that jar which tells the compiler version ( for future references)

Related

ocaml jbuilder build object file without associated opam project

I'm trying to use jbuilder to build an extremely simple project (based on the example in the jbuilder project itself). Jbuilder seems to have some OPAM integration / OPAM awareness built-in. How do I disable that and direct jbuilder to just build specific files I ask for in the build directory?
Here is the jbuild in ./jbuild
(jbuild_version 1)
(library
((name hello_world)
(public_name hello_world)))
And here is hello_world.ml
let message = "hello world!"
When I run jbuilder build --only hello_world --root . (which I thought would disable the opam-related logic)
I got the error
File "jbuild", line 5, characters 5-30:
Error: You cannot declare items to be installed without adding a <package>.opam file at the root of your project.
To declare elements to be installed as part of package "hello_world", add a "hello_world.opam" file at the root of your project.
Exit 1
The only thing I'm after here is the hello_world.cmo file ... and possibly a log of the commands that jbuilder executed in order to produce it.
There might be a way to disable that behaviour, but the simplest way to use it is to just create an empty hello_world.opam file (or whatever your public_name is):
touch hello_world.opam

Compile/Build Gluon Charm-Down itself

I would like to add some features to gluon charm-down I am currently missing.
Too bad that no documentation exisits about how to do that.
All the steps I describe here are done on my development computer where I also develop a test-app using gluon mobile (incl. charm-down). Compiling/deploying this app I have no problem under iOS, Android, Desktop/Windows Surface.
My Development Environment is
Windows 10 /x64 Intel i7 32GB. Java 8u121 (some others too), installed Android SDK
For the iPhone I also have a Macbook here (which I do not use for development, only for compile/deployment/tests).
In order to be able to make my addons to charm-down I checked out the source from BitBucket via Mercurial.
hg clone https://bitbucket.org/gluon-oss/charm-down
Then I changed the working directory to the checked out root (with build.gradle, gradle.properties etc.) and called
gradlew clean install
After a short while I am informed that ANDROID_HOME is not set. Well, it is set, but as Windows Enviroment. To enable gradle to have it, I added it to gradle.properties (ANDROID_HOME=C:/.....)
The directory I gave is the one containing the directories (add-ons, build-tools etc.)
No more complaints from gradle about the missing ANDROID_HOME, but now I get compile errors for missing Android Classes
C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:30: error: package android.app does not exist
import android.app.Activity;
^
C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:31: error: package android.app does not exist
import android.app.Application;
^
C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:32: error: package android.os does not exist
import android.os.Bundle;
.... many more
What am I missing ?
If you have a look at the core/android module's build.gradle file, there is a dependency on the android.jar:
dependencies {
compile project(":core")
compile files("$ANDROID_HOME/platforms/android-$androidPlatformVersion/android.jar")
compile "org.javafxports:jfxdvk:$javafxportsVersion"
}
You have already defined your ANDROID_HOME path, but there is another variable: $androidPlatformVersion.
This one is defined in the gradle.properties file that you will find in the root of the Charm Down project, with these two properties set:
androidPlatformVersion=24
javafxportsVersion=8.60.8
You'll need to install Android SDK 24, so the dependency is resolved and android.jar is added.

Establish gtest version

How do I know which version of Gtest is being used in the project I'm working with? I'm working on a linux platform.
The source code of libgtest or libgtest_main libraries doesn't contain special functions which allow recognize their version (something like GetGTestVersion () or something else).
Also header files doesn't have any defined identifiers (something like GTEST_VERSION or something else).
So you can’t check version of Google C++ Testing Framework at runtime inside user code.
But maintainers provide as part of the framework special script scripts/gtest-conf which:
...
provides access to the necessary compile and linking
flags to connect with Google C++ Testing Framework, both in a build prior to
installation, and on the system proper after installation.
...
Among other things this script has several options which connected with version:
...
Installation Queries:
...
--version the version of the Google Test installation
Version Queries:
--min-version=VERSION return 0 if the version is at least VERSION
--exact-version=VERSION return 0 if the version is exactly VERSION
--max-version=VERSION return 0 if the version is at most VERSION
...
The script also contain usage example of it:
Examples:
gtest-config --min-version=1.0 || echo "Insufficient Google Test version."
...
It means that user can test version of the framework in build time using script gtest-config.
Note:
The script gtest-config get actual version of the framework during configuration through variables declared in configure.ac.
...
AC_INIT([Google C++ Testing Framework],
[1.7.0],
[googletestframework#googlegroups.com],
[gtest])
...
And after calling autoconf the following identifiers inside configure file populated:
...
# Identity of this package.
PACKAGE_NAME='Google C++ Testing Framework'
PACKAGE_TARNAME='gtest'
PACKAGE_VERSION='1.7.0'
PACKAGE_STRING='Google C++ Testing Framework 1.7.0'
PACKAGE_BUGREPORT='googletestframework#googlegroups.com'
PACKAGE_URL=''
...
# Define the identity of the package.
PACKAGE='gtest'
VERSION='1.7.0'
...
As far the framework compiled with option AC_CONFIG_HEADERS this identifiers stored into file build-aux/config.h and availiable for user at compile time.
The file CHANGES, in the gtest home directory, contains a gtest version number.
If you have cloned the official repo you can check the latest Git commit inside Google Test's directory (using for example git log -n 1 or git rev-parse HEAD) and compare it with the list of released versions.
In my case, the commit hash is ec44c6c1675c25b9827aacd08c02433cccde7780, which turns out to correspond to release-1.8.0.

Gradle Jetty plugin locking files

Is there a way to fix the file locking issue caused by jetty entirely from gradle?
Some clarification:
When using the Gradle Jetty plugin by running gradle jettyRun, jetty causes the static resource files (html, css, js, etc.) to be locked when using Windows.
You can see a description of the problem in Files locked on Windows.
The same article also describes how you can fix that. Basically you have to either:
Disable the use of file mapped buffer
Not use NIO at all.
Both things require to add some jetty specific configuration files to the project, which I do not want to do - the jetty plugin is used only for convenience, and maintaining configuration for it does not feel right.
I do not need NIO for testing on the local machine, so any solution works.
Edit:
For now, I picked the option at which you set useFileMappedBuffer to false. This is how to do it:
Specify a path to your webdefault.xml like
[jettyRun, jettyRunWar,jettyStop]*.with {
//other configs
webDefaultXml = file("${project.webAppDir}/WEB-INF/jetty-webdefault.xml")
}
Get file from the latest 6.1.x distribution of jetty. The plugin seems to support only jetty 6. You can localte it at jetty-6.1.26\etc\webdefault.xml. Obviously, you have to place it at the path specified at the previous step.
Change the default servlet init parameter useFileMappedBuffer to false
I will research the option of using embeded jetty insted of the plugin.
I found a plugin that seem to be a better alternative:
https://github.com/akhikhl/gretty
Positives
Does not lock your files and support hot deployment (even something Gretty call "fast reload")
Gretty 1.2.0 uses Jetty 9.2.9.v20150224. Jetty plugin provided by Gradle 2.2.1 uses Jetty 6.1.25.
same task is used jettyRun (or more simply run).
"Press any key to stop the server". Jetty plugin required CTRL+C then Y.
From what I can tell, the documentation seem to be awesome (Gradle's not so much)
Negatives
A bit more bloated code to setup the buildscript's classpath dependency or apply plugin directly from URL (see doc)
Gretty crash unless you explicitly apply plugin: 'war' (Jetty plugin extends the War plugin)
Kiril answered his own question, many thanks. You should follow Kiril's instructions and this will help you find the appropriate webdefault.xml.
To find out what version of Jetty is started by Gradle, execute
gradle jettyRun -i
And you'll see something like this:
...
Tmp directory = determined at runtime
Web defaults = org/mortbay/jetty/webapp/webdefault.xml
Web overrides = none
Webapp directory = C:\dev\my-project\src\main\webapp
Starting jetty 6.1.25 ...
jetty-6.1.25
...
It took me a while to find a copy of Jetty 6.1.25 as it is no longer listed on the Jetty download page (not even in the archive section!).
You can then grab the appropriate copy of webdefault.xml from here, adjusting the version number as appropriate for your needs:
http://grepcode.com/file/repo1.maven.org/maven2/org.mortbay.jetty/jetty/6.1.25/org/mortbay/jetty/webapp/webdefault.xml

What jetty jar should I use?

I'd like to create an application using the embedded version of Jetty. Unfortunately, I can't find any information on what jar files I would need to do that. There are several in the maven repository (http://repo2.maven.org/maven2/org/eclipse/jetty/aggregate/). But what's the difference between jetty-server, jetty-server-all, and jetty-webapp? Are any of these what I want for the embedded use case?
I stopped getting compile errors against the Eclipse embedded code minimal example combining SimplestServer and HelloWorldHandler...
http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
To achieve this I had to include the following from the lib directory in the unzipped distribution from eclipse's jetty mirror...
jetty-server-7.1.4xxxx.jar
jetty-util-7.1.4xxxx.jar
servlet-api.2.5.jar
This document lists the JAR files required for embedding and is pretty complete.
http://docs.codehaus.org/display/JETTY/Embedding+Jetty
I believe you won't need the Ant jar file unless you're invoking Jetty from Ant, even though it says you need it.
Some of the JSP jar files are named differently in the binary bundle than that document calls for, but this document helps figure out which Jetty JSP jars to use:
http://docs.codehaus.org/display/JETTY/JSP+2.0+v+JSP+2.1
I used jetty-webapp.
All the dependencies are very best explained in this diagram : http://wiki.eclipse.org/Jetty/Reference/Dependencies
Based on the diagram,for embedded use case, a minimum of 6 jars are required.
E.g for Jetty 8, try:
jetty-continuation-8..jar
jetty-http-8..jar
jetty-io-8..jar
jetty-server-8..jar
jetty-util-8.*.jar
servlet-api-3.0.jar
For completeness, the xml for jetty-webapp is;
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.1.2.v20120308</version>
</dependency>