Eclipse not updating referenced libraries for my Play framework application - eclipse

Since I'm eager to use Elastic Search in my Play 2 project I have read through
http://www.elasticsearch.org/guide/reference/java-api/ and
added the dependency:
Build.scala:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "test"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"mysql" % "mysql-connector-java" % "5.1.18",
"org.elasticsearch" % "elasticsearch" % "0.19.10"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += Resolver.url("GitHub Play2-elasticsearch Repository", url("http://cleverage.github.com/play2-elasticsearch/releases/"))(Resolver.ivyStylePatterns)
)
}
The dependecy is found and downloaded, checking with play dependencies:
Here are the resolved dependencies of your application:
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| Module | Required by | Note |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.elasticsearch:elasticsearch:0.19.10 | test:test_2.9.1:1.0-SNAPSHOT | As elasticsearch-0.19.10.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-highlighter:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-highlighter-3.6.1.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-memory:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-memory-3.6.1.jar |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-queries:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-queries-3.6.1.jar |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| jakarta-regexp:jakarta-regexp:1.4 | org.apache.lucene:lucene-queries:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-analyzers:3.6.1 | org.elasticsearch:elasticsearch:0.19.10 | As lucene-analyzers-3.6.1.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| org.apache.lucene:lucene-core:3.6.1 | org.apache.lucene:lucene-analyzers:3.6.1 | As lucene-core-3.6.1.jar |
| | org.apache.lucene:lucene-queries:3.6.1 | |
| | org.elasticsearch:elasticsearch:0.19.10 | |
| | org.apache.lucene:lucene-memory:3.6.1 | |
| | org.apache.lucene:lucene-highlighter:3.6.1 | |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| mysql:mysql-connector-java:5.1.18 | test:test_2.9.1:1.0-SNAPSHOT | As mysql-connector-java-5.1.18.jar |
+-------------------------------------------------------------------+---------------------------------------------------------+------------------------------------+
| play:play_2.9.1:2.0.3 | test:test_2.9.1:1.0-SNAPSHOT | As play_2.9.1.jar |
...
But in eclipse I can't use elasticsearch since it can't find the libraries. I'm not
even able to import it.
What am I missing here?

You have to redo an eclipsify in the Play console after adding your new dependency (ie after updating your Build.scala file).
It will generate a new .classpath file for Eclipse containing your new dependency.

If there is Build.scala set up properly, and an info about required library found in newly-generated .classpath file, than try to run play eclipsify and if it works NOT, simply restart Eclipse. It worked for me.

Related

Nexus Repository upload plugin for Fastlane

I am working on a mobile CI/CD and using Fastlane for the scripting / actions support. The organization wants to put the Android and IOS artifacts in the Nexus Repository Manager, so I looked for an action and/or plugin for FastLane. Sure enough there is an action: Fastlane action for nexus upload and a plugin (source) in GitHub: Source for nexus_upload plugin to Fastlane.
I am unable to get the action to work and it throws a mysterious error:
$ bundle exec fastlane uploadToServer
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:30:01]: ------------------------------
[13:30:01]: --- Step: default_platform ---
[13:30:01]: ------------------------------
[13:30:01]: Lane name 'env' is invalid! Invalid names are run, init, new_action, lanes, list, docs, action, actions, enable_auto_complete, new_plugin, add_plugin, install_plugins, update_plugins, search_plugins, help, env, update_fastlane.
[!] Lane name 'env' is invalid
Try the following to get the parameters.
enter $ fastlane action nexus_upload
[✔] 🚀
[13:35:41]: fastlane detected a Gemfile in the current directory
[13:35:41]: However, it seems like you didn't use `bundle exec`
[13:35:41]: To launch fastlane faster, please use
[13:35:41]:
[13:35:41]: $ bundle exec fastlane action nexus_upload
[13:35:41]:
[13:35:41]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
Loading documentation for nexus_upload:
+--------------------------------------------------------------------------+
| nexus_upload |
+--------------------------------------------------------------------------+
| Upload a file to "Sonatype Nexus platform" (https://www.sonatype.com 🔗) |
| |
| Created by xfreebird, mdio |
+--------------------------------------------------------------------------+
+----------------------+-----------------------------------------------+-------------------------------+---------+
| nexus_upload Options |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| Key | Description | Env Var | Default |
+----------------------+-----------------------------------------------+-------------------------------+---------+
| file | File to be uploaded to Nexus | FL_NEXUS_FILE | |
| repo_id | Nexus repository id e.g. artefacts | FL_NEXUS_REPO_ID | |
| repo_group_id | Nexus repository group id e.g. com.company | FL_NEXUS_REPO_GROUP_ID | |
| repo_project_name | Nexus repository commandect name. Only | FL_NEXUS_REPO_PROJECT_NAME | |
| | letters, digits, underscores(_), hyphens(-), | | |
| | and dots(.) are allowed | | |
| repo_project_version | Nexus repository commandect version | FL_NEXUS_REPO_PROJECT_VERSION | |
| repo_classifier | Nexus repository artifact classifier | FL_NEXUS_REPO_CLASSIFIER | |
| | (optional) | | |
| endpoint | Nexus endpoint e.g. http://nexus:8081 | FL_NEXUS_ENDPOINT | |
| mount_path | Nexus mount path (Nexus 3 instances have | FL_NEXUS_MOUNT_PATH | /nexus |
| | this configured as empty by default) | | |
| username | Nexus username | FL_NEXUS_USERNAME | |
| password | Nexus password | FL_NEXUS_PASSWORD | |
| ssl_verify | Verify SSL | FL_NEXUS_SSL_VERIFY | true |
| nexus_version | Nexus major version | FL_NEXUS_MAJOR_VERSION | 2 |
| verbose | Make detailed output | FL_NEXUS_VERBOSE | false |
| proxy_username | Proxy username | FL_NEXUS_PROXY_USERNAME | |
| proxy_password | Proxy password | FL_NEXUS_PROXY_PASSWORD | |
| proxy_address | Proxy address | FL_NEXUS_PROXY_ADDRESS | |
| proxy_port | Proxy port | FL_NEXUS_PROXY_PORT | |
+----------------------+-----------------------------------------------+-------------------------------+---------+
* = default value is dependent on the user's system
More information can be found on https://docs.fastlane.tools/actions/nexus_upload here
Missing parameters will result in a dialog for the needed parameters:
$ bundle exec fastlane run nexus_upload username:"mobibob" password:"secretpassword" file:"./app/build/outputs/apk/debug/app-debug.apk"
[✔] 🚀
+----------------------------------+---------+------------------+
| Used plugins |
+----------------------------------+---------+------------------+
| Plugin | Version | Action |
+----------------------------------+---------+------------------+
| fastlane-plugin-upload_to_server | 0.1.6 | upload_to_server |
+----------------------------------+---------+------------------+
[13:34:22]: --------------------------
[13:34:22]: --- Step: nexus_upload ---
[13:34:22]: --------------------------
[13:34:22]: To not be asked about this value, you can specify it using 'repo_id'
[13:34:22]: Nexus repository id e.g. artefacts:

Looking for Flutter graphics classes corresponding to Android classes

I am looking into the feasibility of converting a simple open source Android chart tool to Flutter. Looking at a few Android charting tools, I find they may use the following Android imports.
Next, I am trying to identify Flutter classes that would, very roughly and loosely, correspond to the Android classes. Mostly looking by names, I find this rough mapping.
Would someone be able to point me to Flutter classes on lines with questionmarks? (Comments on the filled up lines are also great)
| Android | Flutter | Comment | Android API | Flutter API |
|-------------------------------------+-----------------+---------+---------------------------------------------------------------------------------+------------------------------------------------------------|
| android.content.Context; | ? | | https://developer.android.com/reference/android/content/Context.html | ? |
| android.util.AttributeSet; | ? | | https://developer.android.com/reference/android/util/AttributeSet.html | ? |
| android.graphics.Color; | dart:ui.Color | | https://developer.android.com/reference/android/graphics/Color.html | https://docs.flutter.io/flutter/dart-ui/Color-class.html |
| android.graphics.Canvas; | dart:ui.Canvas | | https://developer.android.com/reference/android/graphics/Canvas.html | https://docs.flutter.io/flutter/dart-ui/Canvas-class.html |
| android.graphics.Rect; | dart:ui.Rect | | https://developer.android.com/reference/android/graphics/Rect.html | https://docs.flutter.io/flutter/dart-ui/Rect-class.html |
| android.graphics.Point; | dart:math.Point | | https://developer.android.com/reference/android/graphics/Point.html | https://docs.flutter.io/flutter/dart-math/Point-class.html |
| android.graphics.Paint; | dart:ui.Paint | | https://developer.android.com/reference/android/graphics/Paint.html | https://docs.flutter.io/flutter/dart-ui/Paint-class.html |
| android.graphics.Region; | ? | | https://developer.android.com/reference/android/graphics/Region.html | ? |
| android.graphics.drawable.Drawable; | ? Picture ? | | https://developer.android.com/reference/android/graphics/drawable/Drawable.html | ? |
| android.view.View; | ? Viewport ? | | https://developer.android.com/reference/android/view/View.html | ? |
During the Android->Flutter code conversion of a graphics application, I ended up using the following mapping of classes. Except of AttributeSet that I ended up not needing, each has more or less corresponding class.
| Android | Flutter | Comment |
|---------------------------------------+------------------------------------------+-----------------------------------------------------------------|
| android.content.Context; | package:flutter:widgets.BuildContext | somewhat equivalent |
| android.util.AttributeSet; | ? | |
| android.graphics.Color; | dart:ui.Color | import 'dart:ui' as ui; // in code: ui.Color |
| android.graphics.Canvas; | dart:ui.Canvas | |
| android.graphics.Rect; | dart:ui.Rect | For operations such as "contains(Offset)" etc |
| android.graphics.Point; | dart:ui.Offset (*not* dart:math.Point) | Offset in context of graphics |
| android.graphics.Paint; | dart:ui.Paint | |
| android.graphics.Region; | dart:ui.Rect | |
| android.graphics.drawable.Drawable; | used CustomPaint - see line below | |
| android.view.View; impl Drawable | package:flutter/widgets.dart.CustomPaint | import 'package:flutter/widgets.dart' as widgets; |
| - (continuation line) | - combined with CustomPainter | - in code: widgets.CustomPaint, widgets.CustomPainter |
| android.graphics.Path | dart:ui.Path | |
| android.graphics.PathEffect | Needed for dash-lines. | there is no dash-lines effect in Dart, intentional, performance |
| android.Text (when drawing on Canvas) | package:flutter/painting.dart.TextSpan | import package:flutter/painting.dart'; |
| - (continuation line) | - *not* widgets.Text | - there are multiple *Text* classes in Dart. |
| | | - TextSpan is for drawing text on Canvas. |

Define array in env file for snapshot

In my projet I have several targets to build several variants of my app. In order to handle this with snapshot, I use environnements as described here: https://github.com/fastlane/fastlane/blob/master/docs/Advanced.md#environment-variables
It works fine for defining my scheme but I do not manage to use it for languages.
.env.first_environment
SCHEME = MyScheme
LANGUAGES = en-GB,es-ES
Snapfile
languages([
ENV['LANGUAGES']
])
# The name of the scheme which contains the UI Tests
scheme ENV['SCHEME']
If I have only one language it works, but as soon as there is a comma in the env variable, I have some problems. When I launch fastlane I have:
+----------------------------+------------------------------+
| Summary for snapshot 1.2.2 |
+----------------------------+------------------------------+
| workspace | ./my_app.xcworkspace |
| devices | ["iPhone 4s"] |
| languages | ["en-GB,es-ES"] |
| output_directory | ./fastlane/Snapshots/MyScheme|
| ios_version | 9.1 |
| stop_after_first_error | false |
| skip_open_summary | false |
| clear_previous_screenshots | false |
| buildlog_path | ~/Library/Logs/snapshot |
| clean | false |
| scheme | My-Scheme |
+----------------------------+------------------------------+
For the language option I have "en-GB,es-ES" instead of "en-GB","es-ES".
Answer from #AliSoftware:
In env file
...
LANGUAGES = "en-GB,es-ES"
...
In Snapfile
...
languages(
ENV['LANGUAGES'].split(",")
)
...
Thanks.

Dependencies from RootProject under Maven in SBT multi-project build ignored?

SBT seems to be ignoring dependencies defined in pom.xml for multi-project builds:
object ApplicationBuild extends Build {
lazy val project = Project("root", file(".")).dependsOn(RootProject(riakJavaClient))
lazy val riakJavaClient = uri("git://github.com/basho/riak-java-client")
}
Output from dependency-graph:
[info] +-------------------+
[info] |my-project_2.10 [S]|
[info] | my-project |
[info] | 1.0 |
[info] +-------------------+
[info] | || |
[info] ----------------------------- || --------------------------------------
[info] | |--------------- |
[info] | ---------------| |
[info] v || |
[info] +---------------------------+ || |
[info] |unfiltered-scalate_2.10 [S]| || |
[info] | net.databinder | || |
[info] | 0.6.8 | || |
[info] +---------------------------+ || |
[info] | | | || |
[info] | | ---------------------------- || |
[info] | ----------------- | || |
[info] v | | || |
[info] +----------------------+ | | || |
[info] | scalate-core_2.10 | | | || |
[info] |org.fusesource.scalate| | | || |
[info] | 1.6.1 | | | || |
[info] +----------------------+ | | || |
[info] | | | | | || |
[info] | | ------ | | || |
[info] | --------- | | | || |
[info] v | | | v || v
[info] +------------------+ | | | +-------------------+ || +-----------------+
[info] |scala-compiler [S]| | | | |unfiltered_2.10 [S]| || |commons-validator|
[info] | org.scala-lang | | | | | net.databinder | || |commons-validator|
[info] | 2.10.0 | | | | | 0.6.8 | || | 1.4.0 |
[info] +------------------+ | | | +-------------------+ || +-----------------+
[info] | | ------------ | | | | | || | | |
[info] | | | | | | | --------- || ------------ | ------------
[info] | | | | | | ------------ | || | | |
[info] v | | v | v | | || v | |
[info] +-----------------+ | | +----------------------+ | +------------------------+ | | || +-----------------+ | |
[info] |scala-reflect [S]| | | |scalate-util_2.10 [S] | | |unfiltered-util_2.10 [S]| | | || |commons-beanutils| | |
[info] | org.scala-lang | | | |org.fusesource.scalate| | | net.databinder | | | || |commons-beanutils| | |
[info] | 2.10.0 | | | | 1.6.1 | | | 0.6.8 | | | || | 1.8.3 | | |
[info] +-----------------+ | | +----------------------+ | +------------------------+ | | || +-----------------+ | |
[info] | ----------- ---- | | | | | | || | | |
[info] | | | | | | | | | || ---------- | |
[info] | | ------------------ | | | | | || | | |
[info] | | | | ------------- | | | | || | | |
[info] | | | | | ------------- | | | || | | |
[info] | | | | | | ------------------------ | | || | | |
[info] | | | | | | | ---------------------------------- | || | | |
[info] | | | | | | | | -------------------------------|--| | | |
[info] | | | | | | | | | -------------------- | | | |
[info] | | | | | | | | | | | | | |
[info] v v v v v v v v v v v v v v
[info] +------------------+ +---------+ +------------------+ +-------------+ +-------------------------+ +---------------+ +----------------+
[info] | scala-library | |slf4j-api| | scala-library | |commons-codec| |riak-java-client_2.10 [S]| |commons-logging| |commons-digester|
[info] | org.scala-lang | |org.slf4j| | org.scala-lang | |commons-codec| | default | |commons-logging| |commons-digester|
[info] | 2.10.0 | | 1.6.1 | | 2.10.1 | | 1.4 | | 0.1-SNAPSHOT | | 1.1.1 | | 1.8 |
[info] |evicted by: 2.10.2| +---------+ |evicted by: 2.10.2| +-------------+ +-------------------------+ +---------------+ +----------------+
[info] +------------------+ +------------------+
[info] Note: The old tree layout is still available by using `dependency-tree`
The riak-java-client project should import all the libraries defined in its pom.xml, but is importing nothing.
RootProject and ProjectRef (just ProjectReference's in general) are to reference SBT projects so they fully resolvable and their dependencies handled properly (via appropriate Resolvers for file, svn, git and hg). It won't however work with non-SBT projects - under Maven, Ant, Gradle or similar. Just SBT ones.
You may want to give externalPom a try. I didn't, so can't comment on its use.

Cannot read (or find?) ResourceBundle

Below is my project structure.
Project
|
|--src
| |
| |--com
| | |
| | |--jasper
| | |
| | |--JasperDemo.java
| |
| |--i18n.properties
|
|
|--Arabic.jrxml
In the properties file there is a key text1.paragraph and it's value may be in any language(most preferable arabic).
In the .jrxml file I have set ResourceBundle="i18n" and in the textfield have used $R{text1.paragraph}
Now the problem is that when I run it from eclipse in the PDF file I get output of the field as $R{text1.paragraph} not it's value