I want to configure my travis.yml for Play framework 2.4.3 Java project, but I couldn't find anything about that.
This is my current .travis.yml:
language: java
sudo: false
addons:
apt:
packages:
- oracle-java8-installer
jdk:
- oraclejdk8
env:
PLAY_VERSION=2.4.3
before_script:
wget http://downloads.typesafe.com/releases/play-${PLAY_VERSION}.zip
unzip -q play-${PLAY_VERSION}.zip
script: play-${PLAY_VERSION}/play deps --sync
notifications:
email: false
As you know, Play framework use Activator since 2.3.8 version, and how can I download play framework 2.4.3 from full URL? Because http://downloads.typesafe.com/releases/play-${PLAY_VERSION}.zip this URL is not working.
My Project Spec:
Play Framework 2.4.3
MySQL 5.7.9
Hazelcast (Maybe could be Redis)
Debian 8 (on cloud)
Travis-CI (Pro)
Github
IntelliJ Idea 14
If your project uses the standard project setup that activator provides, there's very little you need to do to integrate with Travis CI. I am not sure why you are downloading the framework, when sbt should be doing that for you.
All you need is a .travis.yml file at the root of the project with the following content:
For Java:
language: java
jdk:
- oraclejdk8
For Scala:
language: scala
jdk:
- oraclejdk8
Travis will find your projects sbt files and will fetch the Play Dependencies for you. See my scala example here
Perhaps you could try a maven repo:
wget http://central.maven.org/maven2/com/typesafe/play/play-ws_2.10/2.4.3/play-ws_2.10-2.4.3.jar
PS: 'm not familiar with Activator; I looked at your question since it mentions Hazelcast.
this config work for me, my project is play framework with java.
language: scala
sudo: true
scala:
- 2.11.6
jdk:
- oraclejdk8
install: true
Thanks.
Related
I installed maven on my MacOs device. Then I watched this tutorial on how to create a new Spring Boot project on intelliJ. https://www.youtube.com/watch?v=YDRNMAJo0MA
When I press build project I get an error. This is the error I get:
java.util.concurrent.ExecutionException: com.intellij.diagnostic.PluginException: Cannot load class dev.flikas.spring.boot.assistant.idea.plugin.suggestion.filetype.YamlPropertiesFileType (
error: dev/flikas/spring/boot/assistant/idea/plugin/suggestion/filetype/YamlPropertiesFileType has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0,
classLoader=PluginClassLoader(plugin=PluginDescriptor(name=Spring Boot Assistant, id=dev.flikas.idea.spring.boot.assistant.plugin, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/IdeaIC2021.2/plugins/idea-spring-boot-assistant, version=0.17.2, package=null), packagePrefix=null, instanceId=67, state=active)
)
Above it says that this version of Java runtime only recognises class file versions up to 55.0 which is java 11. I created this Spring project firstly as java 17 project because on my macOs I have java 17 installed(I also have 11.0.12). Then in the pom.xml file I changed it to 11.0.12. Also on my project structure I changed it to JDK 11.
I also tried changing my default jdk version on my macOs with this tutorial https://medium.com/#devkosal/switching-java-jdk-versions-on-macos-80bc868e686a
When I use this line export JAVA_HOME=/usr/libexec/java_home -v 11.0.12 and then write java -version it says that my jdk is java 11.0.12 but when I reset terminal and write java -version again it says that it's jdk 17. I also wrote
export JAVA_HOME=/usr/libexec/java_home -v 11.0.12 in my bash profile.
I don't know what I have to do.
Since you are just importing the generated Spring Boot POM application, in this case, you may just Disable the third-party plug-in Spring Boot Assistant(Settings > Plugins > Installed, disable it) then restart your IDEA and everything should work.
If you still want to use that plugin, make sure you are using the latest version of IDEA CE(at this time it's 2022.3.2) and install the Spring Boot Assistant plugin again.
Goodmorning,
I am trying to generate an API client in Java with Open API. Sadly, it needs to work with java 6. I enable the flag, and everything works fine in the development environment (Eclipse) running on Java 11 with compliance for Java 6. When I export the JAR and try to run it in the staging environment with JRE 1.6, I get the error ClassDefNotFound okhttp3/Interceptor. If I try to download this dependency from Maven I then get Unsupported major.minor version 52.0.
So, I am wondering if the flag supportJava6 actually does something or not, since it seems like it requires at least Java 8.
Am I doing something wrong?
Best regards
UPDATE:
The API specs: https://api.civilianext.it/Protocollo/api/help/v1/docs
The API is authorized with client_ID and secret. I have made a small lib for the authorization, that works with Java6, so the auth is working and done.
What is not working is the API, at runtime usually (it compiles with some quick fixes).
I used both Swagger and OpenAPI, running locally in a docker.
BEWARE: I changed these files many times, I do not remember all combinations and configurations I tried. I do know I tried everything it was posted here in StackOverflow and even more, and nothing worked. I've been here for like a month trying everything when I have time.
These are the latest configurations I tried:
OpenAPI:
version: "3.6"
services:
openapi-codegen-cli:
image: openapitools/openapi-generator-cli:v4.3.1
volumes:
- '.:/local'
command: generate -g jaxrs-spec -i local/in/api.yml -o /local/out/jaxrs-client --additional-properties=dataLibrary=threetenbp,java8=false --skip-validate-spec
volumes:
openapi_data:
Swagger:
swagger-codegen-cli:
image: swaggerapi/swagger-codegen-cli
volumes:
- '.:/local'
command: generate -l java -i local/json/api.json -c local/config/config.json -o /local/out/java-client
// config.json
{
supportJava6: true,
}
Once the code is generated, I usually have to fix the pom.xml, adding <pluginManagement> tags. Then I build the project with mvn clean install. The build compiles and I usually get some errors at runtime, about unsupported major.minor version.
I also tried this: https://github.com/OpenAPITools/openapi-generator/issues/8383
You should use version 1.x of okhttp. Read carefully the change log at https://square.github.io/okhttp/changelog_1x/. Try first with version 1.1.1.
You can download the jar from maven repository at https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
It is not obvious to extend an old project with a complete REST stack when Java 6 is a target constraint.
I would propose to give a try to alternate OpenAPI generator JAX-RS spec or JAX-RS CXF client with the hope it is easier to configure Maven project with last Java 6 compatible CXF 3.0.6 version or any other JAX-RS implementation you may find for Java 6.
According to documentation, you have to take care to options dataLibrary=threetenbp and java8=false which should work in version 4.3.1 (Java 6 support has been dropped in version 5.x)
I recommend to follow this tutorial provided with a demonstration project: https://guntherrotsch.github.io/blog_2020/openapi-jaxrs-context.html
Only the jersey1 library in the Java client generator support the supportJava6 option. Here is an example:
npm install -g #openapitools/openapi-generator-cli
openapi-generator-cli generate \
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
-g java \
--library jersey1 \
--additional-properties supportJava6=true \
-o /var/tmp/java_api_client
FYI. The supportJava6 option has been deprecated and will be removed in the upcoming 5.x release of OpenAPI Generator
I'm following the Development guide https://github.com/MobiVM/robovm/wiki/Developer-Guide to build RoboVM locally using eclipse IDE. I have followed the steps till https://github.com/MobiVM/robovm/wiki/Developer-Guide#importing-into-eclipse without any issue and issue begins after I Imported all projects into Eclipse via their Maven poms.
When I try to fix the following errors by 'Discover new m2e connectors',
I'm getting these following errors,
Following are the above errors one by one.
HTTP Server 'Not Implemented': http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.8.1/N/0.8.1.201704211436/content.xml/content.xml - How can I change http to https ?
No repository found at http://ifedorenko.github.com/m2e-extras/. - This is not exist now.
No repository found at https://github.com/MobiVM/robovm/tree/master/plugins/eclipse.
Unknown Host: http://download.robovm.org/eclipse/content.xml
I have added all the following dependencies as mentioned in the development guide,
JDK
Maven
CMake
Xcode and command line tools
IntelliJ IDEA 15 or higher, stored under /Applications/IntelliJ IDEA CE.app
OpenSSL development libraries, install via brew install openssl on Mac OS X
autoconf, install via brew install autoconf on Mac OS X
automake, install via brew install automake on Mac OS X
libtool, install via brew install libtool on Mac OS X
These are the versions I'm using,
Mac OS: 10.15.4
Xcode: 12.0.1
Eclipse: 2019-03 (4.11.0)
Robovm: https://github.com/MobiVM/robovm (master branch - 2.3.11)
JDK: 1.8
Maven: 3.6.3
m2e:
I'm stuck on these errors and looking for your help please.
Thanks !
I have just downloaded and fresh installed Eclipse 2020-09.
Followed guide and imported for start Eclipse plugin and then Compiler set of project.
And have not experienced this bunch of issues. More over after quick tweak of connectors and described in guide I was able to compile and run Eclipse RoboVM plugin.
Please try using up-to date version of tools.
Also try importing and solving modules one by one.
Background:
I've a spring-boot 2.3 project using reactive driver for cassandra that is built on Java 11. For integration test though, when I spin up an embedded Cassandra database, I rely on presence of Java 8 on the machine with accompanying environment variable JAVA8_HOME.
Question:
How can I configure GitHub action setup-java to utilise multiple JDKs for my build and let JAVA_HOME point to Java 11 but JAVA8_HOME point to Java8?
Using multiple JDKs with GitHub actions is already possible today. One great and neat way is to leverage the strategy.matrix job configuration like that in your .github/workflows/maven.yml:
name: github
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11, 15 ]
steps:
- uses: actions/checkout#v2
- uses: actions/setup-java#v1
with:
java-version: ${{ matrix.java-version }}
- run: mvn -B install --no-transfer-progress --file pom.xml
I didn't check if this does include the environment variable configuration for JAVA_HOME you need - but it clearly isolates the build environments for the separate Java versions. Here's a full example project using this setup: https://github.com/codecentric/cxf-spring-boot-starter and here's a green build log.
Also the GitHub actions GUI for matrix builds is quite nice:
Not exactly setup-java, but you can try another java-install action: https://github.com/AdoptOpenJDK/install-jdk#multiple-jdks. Use target property for setting up env var to use as JAVA_HOME.
This question follows-on from notes against Netbeans v8.0.1.
Wondering how to use Groovy 2.3 with Netbeans 8?
This question is now critical since I began using Spock for Java testing since it is Groovy based.
I like Spock and I'd prefer to work with the same Groovy version within Netbeans, as I use with Gradle and on the command line.
Also, I am using sdkman which means that the "working" Groovy version can swap depending on which project or which version of a package I need to work on. In short I want Netbeans to work with ...
current Groovy version
At present ...
$ groovy -version
Groovy Version: 2.4.7 JVM: 1.8.0_102 Vendor: Oracle Corporation OS: Linux
$
$ gradle -version
------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------
Build time: 2016-09-19 10:53:53 UTC
Revision: 13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97
Groovy: 2.4.7
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_102 (Oracle Corporation 25.102-b14)
OS: Linux 4.4.0-36-generic amd64
And when the Groovy and Gradle project runs on the command-line...
$ gradle build
Starting a Gradle Daemon (subsequent builds will be faster)
Gradle version: 3.1
Groovy version: 2.4.7
Java version: 1.8.0_102
:compileJava
:compileGroovy
...
Running the same Gradle build.gradle project within Netbeans:
Executing: gradle build
Arguments: [-u]
Gradle version: 3.1
Groovy version: 2.4.4
Java version: 1.8.0_102
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
At present I have NO idea where v2.4.4 Groovy came from! Although I am formulating an uncomfortable hypothesis which I'll plonk at the end.
With Netbeans there seem to be two different problems which I'll cover separately. I will take the second point first, as it probably impacts the point #1 more than we realise..
Inconsistent Groovy packaging and support
Ineffective configuration-method to select/use a specific Groovy platform or version.
1. Inconsistent Groovy configuration
The documented Groovy configuration process
Advice seems to believe that just changing the Groovy library to the latest groovy-all.jar is enough
http://www.areaofthoughts.com/2011/11/upgrading-groovy-in-netbeans-ide-71.html
https://netbeans.org/features/groovy/
This hasn't worked very well at all judging by the relevant questions/comments out there ...
How to use Groovy 2.0 in netbeans
a bit of googling gets you over 10,000 hits and
quite a few on the first page seem to be active bugs.
A mythbuster ... I have been adding this snippet to Groovy and Gradle scripts
println "Gradle version: "+ gradle.gradleVersion;
println "Groovy version: "+ GroovySystem.version;
println "Java version: "+ System.getProperty("java.version");
The output when running with netbeans 8.2 on Windows and Linux is curious.
Groovy version: 2.1.3
Java version: 1.8.0_102
I was thinking v2.1.3 is the groovy-all JAR file that comes with Netbeans -- how silly of me:
The Netbeans log show me that the Groovy module loaded was:
"Groovy 2.1.7"
jar:nbinst://org.netbeans.modules.libs.groovy/modules/ext/groovy-all.jar!/
I checked that JAR, and this JAR file reports its version 2.4.5:
$ java -jar /opt/dev/netbeans/home/groovy/modules/ext/groovy-all.jar -version
Groovy Version: 2.4.5 JVM: 1.8.0_102 Vendor: Oracle Corporation OS: Linux
Where does Groovy v2.1.3 come from? I accidentally found that too. I swapped out the bundled (and mislabelled in libraries) v2.1.7 JAR file with the current embedded groovy-all (v2.4.7).
When I started Netbeans 8.2 ... I ran my Groovy main program:
Gradle version: 3.1
Groovy version: 2.1.3
Java version: 1.8.0_102
Huh! No difference ... Now. Look at the output from a Gradle build under Netbeans (which also runs a Groovy run-time...):
Executing: gradle build
Arguments: [-u]
Gradle version: 3.1
Groovy version: 2.4.4
Java version: 1.8.0_102
:compileJava UP-TO-DATE
:compileGroovy
Summarising; Netbeans appears to embody the following Groovy run-time versions:
2.1.3
2.1.7
2.4.4
2.4.5
And even though I have established a groovy library as: groovy-all-2.4.7.jar and put this JAR into the Netbeans Groovy modules area:
/opt/dev/netbeans/home/groovy/modules/ext
groovy-all.jar
# After copying the embeddable/groovy-all-2.4.7.jar
# into Netbeans Groovy/modules ...
#
$ java -jar /opt/dev/netbeans/home/groovy/modules/ext/groovy-all.jar -version
Groovy Version: 2.4.7 JVM: 1.8.0_102 Vendor: Oracle Corporation OS: Linux
Still NO scripts report the Groovy version as: 2.4.7.
To mis-quote The Princess Bride, "Groovy integration with Netbeans ... You seem to use this word alot.
"I don't think you know what it means."
2. Groovy packaging with Netbeans
As a counter point; I found the Gradle configuration ... These language/platform configurations can suit my needs:
Gradle (qualified)
Maven
Javascript
JRuby and Ruby
Java
Things that don't work well in a Netbeans context are:
Scala
Gradle (not integrated)
Groovy
Ant (yes)
Why can't Netbeans support a "Groovy platform" across all components and activities?!
Good examples for Groovy would be to look at how Netbeans supports:
Java platforms
Maven
Gradle - while clumsy imho, it works
Whereas Groovy appears to be all over the place. Clearly the use of Library functionality is NOT working.
I want some consistent Groovy language operation with Netbeans. It this means I need to fiddle with Bundles and get down and dirty, then may be that's a good thing because what I'm experiencing is Unsatisfactory.
hypothesis:
IDEA, Eclipse and Netbeans are using OSGi for component assembly.
It looks to me as if individual plug-ins or simple build packages are including their own Groovy package.
That can be a good thing for something that isn't meant to interact with projects or developers.
From my perspective I think it would be better if Groovy was a First Class language. So there is ONLY ONE Groovy version working at any particular time.
So that groovy based tooling like (say) Gradle, Spock and Groovy scripting are ALL the SAME Groovy run-time, same AST and on and on.
Hopefully the Stackoverflow collective have enough insight to identify methods to get things happening better.
On your project node, right click and choose Properties from the menu. Choose the Libraries category. In the Compile tab, you'll see under Compile-time Libraries: "Groovy 2.1.7". Select it, and click "Edit". In the Classath tab, you'll see under Library Classpath that it refers to a groovy-all.jar under the NetBeans installation directory.
In my preferred groovy installation at /usr/share/groovy, I found an alternative jar file at embeddable/groovy-all.jar. By removing the existing Library Classpath and replacing it with this one, you can compile your project to using Groovy 2.4.12.