Is it possible via regular mvn command line client to browse the central repository, and possibly perform a specific search?
e.g: i want to get a list of all the artifacts that have "log4j" in their Artifact ID.
I whipped up a little Groovy script that does this:
import groovyx.net.http.URIBuilder
import groovy.json.JsonSlurper
class Fun {
public static void main(String[] args) {
def uri = new URIBuilder("http://search.maven.org/solrsearch/select")
uri.addQueryParam 'rows', 20
uri.addQueryParam 'wt', 'json'
uri.addQueryParam 'q', args[0]
def text = uri.toURL().getText()
def json = new JsonSlurper()
def result = json.parseText( text )
result.response.docs.each { doc ->
println "$doc.id:$doc.latestVersion"
}
}
}
And here's a Ruby script that does the same thing (using the httparty gem):
require 'httparty'
query = ARGV[0]
class MavenCentral
include HTTParty
base_uri 'search.maven.org'
def initialize(query, rows=20)
#options = { query: {rows: rows, wt: 'json', q: query} }
end
def artifacts
self.class.get('/solrsearch/select', #options)
end
end
maven_central = MavenCentral.new(query)
maven_central.artifacts['response']['docs'].each do |doc|
puts "#{doc['id']}:#{doc['latestVersion']}"
end
There is an SBT plugin for this: sbt-search-maven-plugin
$ sbt "searchMaven log4j"
[info] Loading global plugins from ~/.sbt/0.13/plugins
[info] Set current project to foo (in build file:~/projects/)
[info] Results for log4j:
[info] "com.jkoolcloud.tnt4j.logger" % "log4j" % "0.1"
[info] "org.apache.logging.log4j" % "log4j" % "2.6.1"
[info] "org.darkphoenixs" % "log4j" % "1.2.17"
[info] "log4j" % "log4j" % "1.2.17"
[info] "de.huxhorn.lilith" % "log4j" % "0.9.41"
[info] "org.mod4j.org.eclipse.xtext" % "log4j" % "1.2.15"
[info] "org.apache.logging.log4j" % "log4j-bom" % "2.6.1"
[info] "org.apache.logging.log4j.samples" % "log4j-samples" % "2.0.1"
[info] "org.apache.logging.log4j.osgi" % "log4j-osgi" % "2.0-rc1"
[info] "ro.fortsoft.log2j" % "log2j-parent" % "0.4"
[info] "ant" % "ant-apache-log4j" % "1.6.5"
[info] "ant" % "ant-jakarta-log4j" % "1.6.1"
[info] "plexus" % "plexus-log4j-logging" % "1.0"
[info] "org.apache.logging.log4j" % "log4j-liquibase" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-jul" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-iostreams" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-nosql" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-jmx-gui" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-taglib" % "2.6.1"
[info] "org.apache.logging.log4j" % "log4j-web" % "2.6.1"
[success] Total time: 1 s, completed 24/06/2016 2:47:24 PM
mvn -q com.jarcasting:search-maven-plugin:search -Dq="com google guava"
search-maven-plugin
Related
I'm trying to learn nextflow but it's not going very well. I started with the tutorial of this site: https://www.nextflow.io/docs/latest/getstarted.html (I'm the one who installed nextflow).
I copied this script :
#!/usr/bin/env nextflow
params.str = 'Hello world!'
process splitLetters {
output:
file 'chunk_*' into letters
"""
printf '${params.str}' | split -b 6 - chunk_
"""
}
process convertToUpper {
input:
file x from letters.flatten()
output:
stdout result
"""
cat $x | tr '[a-z]' '[A-Z]'
"""
}
result.view { it.trim() }
But when I run it (nextflow run tutorial.nf), in the terminal I have this :
N E X T F L O W ~ version 22.03.1-edge
Launching `tutorial.nf` [intergalactic_waddington] DSL2 - revision: be42f295f4
No such variable: result
-- Check script 'tutorial.nf' at line: 29 or see '.nextflow.log' file for more details
And in the log file I have this :
avr.-20 14:14:12.319 [main] DEBUG nextflow.cli.Launcher - $> nextflow run tutorial.nf
avr.-20 14:14:12.375 [main] INFO nextflow.cli.CmdRun - N E X T F L O W ~ version 22.03.1-edge
avr.-20 14:14:12.466 [main] INFO nextflow.cli.CmdRun - Launching `tutorial.nf` [intergalactic_waddington] DSL2 - revision: be42f295f4
avr.-20 14:14:12.481 [main] DEBUG nextflow.plugin.PluginsFacade - Setting up plugin manager > mode=prod; plugins-dir=/home/user/.nextflow/plugins; core-plugins: nf-amazon#1.6.0,nf-azure#0.13.0,nf-console#1.0.3,nf-ga4gh#1.0.3,nf-google#1.1.4,nf-sqldb#0.3.0,nf-tower#1.4.0
avr.-20 14:14:12.483 [main] DEBUG nextflow.plugin.PluginsFacade - Plugins default=[]
avr.-20 14:14:12.494 [main] INFO org.pf4j.DefaultPluginStatusProvider - Enabled plugins: []
avr.-20 14:14:12.495 [main] INFO org.pf4j.DefaultPluginStatusProvider - Disabled plugins: []
avr.-20 14:14:12.501 [main] INFO org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode
avr.-20 14:14:12.515 [main] INFO org.pf4j.AbstractPluginManager - No plugins
avr.-20 14:14:12.571 [main] DEBUG nextflow.Session - Session uuid: 67344021-bff5-4131-9c07-e101756fb5ea
avr.-20 14:14:12.571 [main] DEBUG nextflow.Session - Run name: intergalactic_waddington
avr.-20 14:14:12.573 [main] DEBUG nextflow.Session - Executor pool size: 8
avr.-20 14:14:12.604 [main] DEBUG nextflow.cli.CmdRun -
Version: 22.03.1-edge build 5695
avr.-20 14:14:12.629 [main] DEBUG nextflow.Session - Work-dir: /home/user/Documents/formations/nextflow/testScript/work [ext2/ext3]
avr.-20 14:14:12.629 [main] DEBUG nextflow.Session - Script base path does not exist or is not a directory: /home/user/Documents/formations/nextflow/testScript/bin
avr.-20 14:14:12.637 [main] DEBUG nextflow.executor.ExecutorFactory - Extension executors providers=[]
avr.-20 14:14:12.648 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
avr.-20 14:14:12.669 [main] DEBUG nextflow.cache.CacheFactory - Using Nextflow cache factory: nextflow.cache.DefaultCacheFactory
avr.-20 14:14:12.678 [main] DEBUG nextflow.util.CustomThreadPool - Creating default thread pool > poolSize: 9; maxThreads: 1000
avr.-20 14:14:12.741 [main] DEBUG nextflow.Session - Session start invoked
avr.-20 14:14:13.423 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
avr.-20 14:14:13.446 [main] DEBUG nextflow.Session - Session aborted -- Cause: No such property: result for class: Script_6634cd79
avr.-20 14:14:13.463 [main] ERROR nextflow.cli.Launcher - #unknown
groovy.lang.MissingPropertyException: No such property: result for class: Script_6634cd79
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:341)
at Script_6634cd79.runScript(Script_6634cd79:29)
at nextflow.script.BaseScript.runDsl2(BaseScript.groovy:170)
at nextflow.script.BaseScript.run(BaseScript.groovy:203)
at nextflow.script.ScriptParser.runScript(ScriptParser.groovy:220)
at nextflow.script.ScriptRunner.run(ScriptRunner.groovy:212)
at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:120)
at nextflow.cli.CmdRun.run(CmdRun.groovy:334)
at nextflow.cli.Launcher.run(Launcher.groovy:480)
at nextflow.cli.Launcher.main(Launcher.groovy:639)
What should I do ?
Thanks a lot for your help.
Nextflow includes a new language extension called DSL2, which became the default syntax in version 22.03.0-edge. However, it's possible to override this behavior by either adding nextflow.enable.dsl=1 to the top of your script, or by setting the -dsl1 option when you run your script:
nextflow run tutorial.nf -dsl1
Alternatively, roll back to the latest release (as opposed to an 'edge' pre-release). It's possible to specify the Nextflow version using the NXF_VER environment variable:
NXF_VER=21.10.6 nextflow run tutorial.nf
I find DSL2 drastically simplifies the writing of complex workflows and would highly recommend getting started with it. Unfortunately, the documentation is lagging a bit, but lifting it over is relatively straight forward once you get the hang of things:
params.str = 'Hello world!'
process splitLetters {
output:
path 'chunk_*'
"""
printf '${params.str}' | split -b 6 - chunk_
"""
}
process convertToUpper {
input:
path x
output:
stdout
"""
cat $x | tr '[a-z]' '[A-Z]'
"""
}
workflow {
splitLetters | flatten() | convertToUpper | view()
}
Results:
nextflow run tutorial.nf -dsl2
N E X T F L O W ~ version 21.10.6
Launching `tutorial.nf` [prickly_kilby] - revision: 0c6f835b9c
executor > local (3)
[b8/84a1de] process > splitLetters [100%] 1 of 1 ✔
[86/fd19ea] process > convertToUpper (2) [100%] 2 of 2 ✔
HELLO
WORLD!
[INFO] : Processing JavaScript files
[INFO] : Encrypting JavaScript files: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\titanium_prep.win32.exe "com.voxcinemas.voxcinemasdev" "E:\Titanium\voxcinemastitanium\build\android\assets" "app.js" "config.js" "gcm.js" "gcm_activity.js" "icons.js" "iphone/lib/db.js" "iphone/lib/genericWindow.js" "iphone/lib/helper.js" "iphone/lib/httpClient.js" "iphone/lib/indicator.js" "iphone/lib/style.js" "iphone/lib/styleIOS7.js" "iphone/lib/views.js" "iphone/lib/viewsIOS7.js" "iphone/lib/youtube.js" "iphone/viewcontroller/applicationTabGroup.js" "iphone/viewcontroller/buyTicketsWindow.js" "iphone/viewcontroller/cardDetailsWindow.js" "iphone/viewcontroller/cinemasWindow.js" "iphone/viewcontroller/detailPageWindow.js" "iphone/viewcontroller/error.js" "iphone/viewcontroller/expDetailWindow.js" "iphone/viewcontroller/expWindow.js" "iphone/viewcontroller/favCinemasDetailsWindow.js" "iphone/viewcontroller/favCinemasWindow.js" "iphone/viewcontroller/moviesWindow.js" "iphone/viewcontroller/myAccountWindow.js" "iphone/viewcontroller/offerWindow.js" "iphone/viewcontroller/offerWindowStep2.js" "iphone/viewcontroller/paymentWindow.js" "iphone/viewcontroller/rewardsWindow.js" "iphone/viewcontroller/termsConditionsWindow.js" "iphone/viewcontroller/ticketConfirmationWindow.js" "iphone/viewcontroller/todayWindow.js" "iphone/viewcontroller/transactionHistoryWindow.js" "iphone/viewcontroller/userDetailsWindow.js" "iphone/viewcontroller/webView.js" "iphone/viewcontrollerIOS7/applicationTabGroup.js" "iphone/viewcontrollerIOS7/buyTicketsWindow.js" "iphone/viewcontrollerIOS7/cardDetailsWindow.js" "iphone/viewcontrollerIOS7/cinemasWindow.js" "iphone/viewcontrollerIOS7/detailPageWindow.js" "iphone/viewcontrollerIOS7/error.js" "iphone/viewcontrollerIOS7/expDetailWindow.js" "iphone/viewcontrollerIOS7/expWindow.js" "iphone/viewcontrollerIOS7/favCinemasDetailsWindow.js" "iphone/viewcontrollerIOS7/favCinemasWindow.js" "iphone/viewcontrollerIOS7/moviesWindow.js" "iphone/viewcontrollerIOS7/myAccountWindow.js" "iphone/viewcontrollerIOS7/offerWindow.js" "iphone/viewcontrollerIOS7/offerWindowStep2.js" "iphone/viewcontrollerIOS7/paymentWindow.js" "iphone/viewcontrollerIOS7/rewardsWindow.js" "iphone/viewcontrollerIOS7/termsConditionsWindow.js" "iphone/viewcontrollerIOS7/ticketConfirmationWindow.js" "iphone/viewcontrollerIOS7/todayWindow.js" "iphone/viewcontrollerIOS7/transactionHistoryWindow.js" "iphone/viewcontrollerIOS7/userDetailsWindow.js" "iphone/viewcontrollerIOS7/webView.js" "lib/db.js" "lib/genericWindow.js" "lib/helper.js" "lib/httpClient.js" "lib/indicator.js" "lib/style.js" "lib/views.js" "lib/youtube.js" "viewcontroller/androidHomeWindow.js" "viewcontroller/buyTicketsWindow.js" "viewcontroller/cardDetailsWindow.js" "viewcontroller/detailPageWindow.js" "viewcontroller/error.js" "viewcontroller/expDetailWindow.js" "viewcontroller/favCinemasDetailsWindow.js" "viewcontroller/favCinemasWindow.js" "viewcontroller/myAccountWindow.js" "viewcontroller/offerWindow.js" "viewcontroller/offerWindowStep2.js" "viewcontroller/paymentWindow.js" "viewcontroller/rewardsWindow.js" "viewcontroller/termsConditionsWindow.js" "viewcontroller/ticketConfirmationWindow.js" "viewcontroller/transactionHistoryWindow.js" "viewcontroller/userDetailsWindow.js" "viewcontroller/webView.js" "ti.cloud.js" "_app_props_.json"
[INFO] : Writing E:\Titanium\voxcinemastitanium\build\android\bin\assets\app.json
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-analytics.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-android.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-app.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-filesystem.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-media.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-locale.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-network.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-xml.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-utils.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-geolocation.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-accelerometer.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-contacts.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-map.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-gesture.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-calendar.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-platform.res.zip
[INFO] : Extracting module resources: C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-database.res.zip
[INFO] : No aidl files to compile, continuing
[INFO] : Generating i18n files
[INFO] : Generating E:\Titanium\voxcinemastitanium\build\android\res\values\theme.xml
[INFO] : Packaging application: C:\Users\Ramesh\AppData\Local\Android\sdk\build-tools\23.0.1\aapt.exe "package" "-f" "-m" "-J" "E:\Titanium\voxcinemastitanium\build\android\gen" "-M" "E:\Titanium\voxcinemastitanium\build\android\AndroidManifest.xml" "-A" "E:\Titanium\voxcinemastitanium\build\android\bin\assets" "-S" "E:\Titanium\voxcinemastitanium\build\android\res" "-I" "C:\Users\Ramesh\AppData\Local\Android\sdk\platforms\android-22\android.jar" "-F" "E:\Titanium\voxcinemastitanium\build\android\bin\app.ap_" "--auto-add-overlay" "--extra-packages" "ti.modules.titanium.ui:android.support.v7.appcompat:com.google.android.gms" "-S" "C:\Users\Ramesh\AppData\Local\Temp\115824-4792-1rzrtiq/res" "-S" "C:\Users\Ramesh\AppData\Local\Temp\115824-4792-ljesl8/res"
[INFO] : Building Java source files: C:\Program Files (x86)\Java\jdk1.7.0_79\bin\javac.exe "-J-Xmx256M" "-encoding" "utf8" "-bootclasspath" "C:\Users\Ramesh\AppData\Local\Android\sdk\platforms\android-22\android.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\kroll-v8.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-analytics.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\aps-analytics.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-android.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\jaxen-1.1.1.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\ti-commons-codec-1.3.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\kroll-common.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\titanium.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-app.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-ui.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\nineoldandroids-appc-2.4.0.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-filesystem.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-media.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-appcompat.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\android-support-v4.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\android-support-v7-appcompat.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-locale.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-network.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-xml.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-utils.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-geolocation.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-accelerometer.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-contacts.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-map.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-gesture.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-calendar.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-platform.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-database.jar;E:\Titanium\voxcinemastitanium\modules\android\net.iamyellow.gcmjs\0.1\gcmjs.jar;E:\Titanium\voxcinemastitanium\modules\android\net.iamyellow.gcmjs\0.1\lib\gcm.jar;C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\map.jar;C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\lib\google-play-services-base.jar;C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\lib\google-play-services-map.jar;E:\Titanium\voxcinemastitanium\modules\android\com.onecowstanding.flurry\1.1.1\flurry.jar;E:\Titanium\voxcinemastitanium\modules\android\com.onecowstanding.flurry\1.1.1\lib\FlurryAgent.jar;E:\Titanium\voxcinemastitanium\modules\android\analytics.google\3.1.0\analytics.google.jar;E:\Titanium\voxcinemastitanium\modules\android\analytics.google\3.1.0\lib\google-play-services.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\kroll-apt.jar;C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\lib\titanium-verify.jar;Manifest.class;R.class;AssetCryptImpl.class;VoxCinemasActivity.class;VoxCinemasAppInfo.class;VoxCinemasApplication.class" "-d" "E:\Titanium\voxcinemastitanium\build\android\bin\classes" "-proc:none" "-target" "1.6" "-source" "1.6" "#E:\Titanium\voxcinemastitanium\build\android\java-sources.txt"
[INFO] : Running dexer: C:\Program Files (x86)\Java\jdk1.7.0_79\bin\java.exe "-Xmx256M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=C:\Users\Ramesh\AppData\Local\Android\sdk\platform-tools" "-jar" "C:\Users\Ramesh\AppData\Local\Android\sdk\build-tools\23.0.1\lib\dx.jar" "--dex" "--output=E:\Titanium\voxcinemastitanium\build\android\bin\classes.dex" "E:\Titanium\voxcinemastitanium\build\android\bin\classes" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\lib\titanium-verify.jar" "E:\Titanium\voxcinemastitanium\modules\android\net.iamyellow.gcmjs\0.1\gcmjs.jar" "E:\Titanium\voxcinemastitanium\modules\android\net.iamyellow.gcmjs\0.1\lib\gcm.jar" "C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\map.jar" "C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\lib\google-play-services-base.jar" "C:\ProgramData\Application Data\Titanium\modules\android\ti.map\2.3.3\lib\google-play-services-map.jar" "E:\Titanium\voxcinemastitanium\modules\android\com.onecowstanding.flurry\1.1.1\flurry.jar" "E:\Titanium\voxcinemastitanium\modules\android\com.onecowstanding.flurry\1.1.1\lib\FlurryAgent.jar" "E:\Titanium\voxcinemastitanium\modules\android\analytics.google\3.1.0\analytics.google.jar" "E:\Titanium\voxcinemastitanium\modules\android\analytics.google\3.1.0\lib\google-play-services.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\kroll-v8.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-analytics.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\aps-analytics.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-android.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\jaxen-1.1.1.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\ti-commons-codec-1.3.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\kroll-common.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\titanium.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-app.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-ui.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\nineoldandroids-appc-2.4.0.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-filesystem.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-media.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-appcompat.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\android-support-v4.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\android-support-v7-appcompat.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-locale.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-network.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-xml.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-utils.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-geolocation.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-accelerometer.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-contacts.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-map.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-gesture.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-calendar.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-platform.jar" "C:\ProgramData\Titanium\mobilesdk\win32\5.0.0.GA\android\modules\titanium-database.jar"
[ERROR] : Failed to run dexer:
TRACE | titanium exited with exit code 1
[ERROR] Application Installer abnormal process termination. Process exit value was 1
Searching google leads to:
run
ti config android.dx.maxMemory 512M
source
perhaps that helps in your case, too. Otherwise please more information (code, platform, system specs). ti info helps
I'm trying to download multiple files, but for some reason, it only downloads one file.
My code:
for (var fl = 0; fl < fileurls.length; fl++){
var fname = fileurls[fl].substr(fileurls[fl].lastIndexOf('/')+1);
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, fname);
if(file.exists()) {
dlurls.push(fname);
Ti.API.info('File exists, adding: ' + fname)
}
if(!file.exists()) {
Ti.API.info('File does not exist, downloading: ' + fname)
modalview.show();
ind.show();
c.open('GET',fileurls[fl]);
ind.message = 'Downloading: ' + fname;
c.file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, fname);
c.onload = function(e)
{
dlurls.push(fname);
};
c.send();
}
Ti.API.info('Total files: ' + fileurls.length + ' Downloaded files: ' + dlurls.length)
if (fileurls.length==dlurls.length){
modalview.hide();
ind.hide();
}
}
So the for loop parses the json, and finds all the photos that need to be downloaded.
It checks the file system to see if they exist in which case it pushes the filename to the downloaded files list. If the file does not exist, it initiates a download which when complete pushes the file to the downloaded file list.
When done if filelist is equal to downloaded file list, means all files are there.
So, it does loop through all the files, but only one download is initiated?
[INFO] : File does not exist, downloading: IMG_1643_result.JPG
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: IMG_3883_result.JPG
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: 32103.JPG
[ERROR] : Must set a connection to OPENED before send()
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: 32142.JPG
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: kale02.JPG
[ERROR] : Must set a connection to OPENED before send()
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: 3213212.JPG
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: 32123.JPG
[INFO] : Total files: 27 Downloaded files: 0
[INFO] : File does not exist, downloading: 32132.jpg
[ERROR] : Must set a connection to OPENED before send()
...
[INFO] : Total files: 27 Downloaded files: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 0.602950394153595
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 1.6029504537582397
[INFO] : ONDATASTREAM1 - PROGRESS: 1.1585098505020142
[INFO] : ONDATASTREAM1 - PROGRESS: 2.1585099697113037
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 2.2008988857269287
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 3.8818702697753906
[INFO] : ONDATASTREAM1 - PROGRESS: 4.881870269775391
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 1
[INFO] : ONDATASTREAM1 - PROGRESS: 2.251030445098877
[INFO] : ONDATASTREAM1 - PROGRESS: 3.251030445098877
Ok, so what i did is i put the entire request in a function, and then had the oncomplete call call the function. Now it works.
Relevant parts of my build.sbt are here:
libraryDependencies ++= Seq (
"org.scalatest" % "scalatest_2.10" % "1.9.1" % "test",
//Spray dependencies
"io.spray" % "spray-servlet" % "1.1-M7",
"com.typesafe.akka" %% "akka-actor" % "2.2-M3",
"com.typesafe.akka" %% "akka-slf4j" % "2.2-M3",
//Servlet API?
//"org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" artifacts Artifact("javax.servlet", "jar", "jar"),
"javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
"ch.qos.logback" % "logback-classic" % "1.0.12"
)
resolvers ++= Seq( "snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"spray repo" at "http://repo.spray.io",
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"releases" at "http://oss.sonatype.org/content/repositories/releases")
I get these same 12 errors no matter what I try to use for the servlet API (or maybe it's not the Servlet API at all?):
[info] Loading global plugins from /home/dkowis/.sbt/plugins
[info] Loading project definition from /home/dkowis/gitwork/turbo-jug-robot/project
[info] Set current project to turbo-jug-robot (in build file:/home/dkowis/gitwork/turbo-jug-robot/)
[info] Updating {file:/home/dkowis/gitwork/turbo-jug-robot/}default-5e44c0...
[info] Resolving javax.servlet#javax.servlet-api;3.0.1 ...
[info] Done updating.
[info] Compiling 2 Scala sources to /home/dkowis/gitwork/turbo-jug-robot/target/scala-2.10/classes...
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:15: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:48: overloaded method value apply with alternatives:
[error] (optionalBody: Option[spray.http.HttpBody])spray.http.HttpEntity <and>
[error] (buffer: Array[Byte])spray.http.HttpEntity <and>
[error] (string: String)spray.http.HttpEntity
[error] cannot be applied to (spray.http.MediaType, String)
[error] entity = HttpEntity(`text/html`,
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:18: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/ping"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:21: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/stream"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:25: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/crash"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:30: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/timeout"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:33: not found: value Uri
[error] case HttpRequest(GET, Uri.Path("/timeout/timeout"), _, _, _) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:38: not found: value Timedout
[error] case Timedout(HttpRequest(_, Uri.Path("/timeout/timeout"), _, _, _)) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:41: not found: value Timedout
[error] case Timedout(request: HttpRequest) =>
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:42: not found: value request
[error] sender ! HttpResponse(500, "The " + request.method + " request to '" + request.uri + "' has timed out...")
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:72: value withAck is not a member of spray.http.ChunkedResponseStart
[error] client ! ChunkedResponseStart(HttpResponse(entity = " " * 2048)).withAck(Ok(count))
[error] ^
[error] /home/dkowis/gitwork/turbo-jug-robot/src/main/scala/spray/examples/DemoService.scala:85: value withAck is not a member of spray.http.MessageChunk
[error] client ! MessageChunk(DateTime.now.toIsoDateTimeString + ", ").withAck(Ok(remaining - 1))
[error] ^
[error] 12 errors found
[error] (compile:compile) Compilation failed
[error] Total time: 4 s, completed May 25, 2013 1:32:40 PM
I'm truly at a loss as to what the proper dependencies are, and they're not exactly spelled out on the spray.io site. Or I'm dumb and can't figure out what the dependencies are.
Aha, turns out that the git master branch has newer, breaking changes in it, and so the examples aren't valid for any released artifacts. Using a tag in the repo, in my case 1.1-M7 made everything happy again.
Herp derp.
When successfully running >mvn package on an appfuse-basic-spring-archetype v2.1.0 project, the console output displays:
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # ScanillionAppTier02 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 20 resources
[INFO] Copying 16 resources
[INFO] Copying 16 resources
[INFO] Copying 16 resources
I direct your attention to the last 3 lines (Copying 16...). I ran >mvn -X package to get DEBUG output, which shows that the resources plugin claims to be first filtering the 16 files and then copying them twice.
Even more copies happen within the forked hibernate3-maven-plugin:hbm2ddl portion of the build; in that section, the output shows the 16 files being filtered once and copied 4 times.
Again, the build works, so I could have (should have?) counted my blessings, averted my eyes, and got on with my project. Alas, I went down this rat hole and it's going to bug me until I get an answer. Help a guy get some sleep. :-)
EDIT 3/19/2012 cdhabecker: more detail
In the maven output with the -X option, I found this:
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.5:resources' with basic configurator -->
[DEBUG] (f) buildFilters = []
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) escapeWindowsPaths = true
[DEBUG] (s) includeEmptyDirs = false
[DEBUG] (s) outputDirectory = C:\eclipse\workspace\foo\target\classes
[DEBUG] (s) overwrite = false
[DEBUG] (f) project = MavenProject: com.foo:foo:0.0.1-SNAPSHOT # C:\eclipse\workspace\foo\pom.xml
[LOOK] (s) resources = [Resource {targetPath: null, filtering: true, FileSet {directory: C:\eclipse\workspace\foo\src\main\resources, PatternSet [includes: {}, excludes: {ApplicationResources*.properties}]}},
[LOOK] Resource {targetPath: null, filtering: true, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}},
[LOOK] Resource {targetPath: null, filtering: false, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}},
[LOOK] Resource {targetPath: null, filtering: false, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession#eddac
[DEBUG] (f) supportMultiLineFiltering = false
[DEBUG] (f) useBuildFilters = true
[DEBUG] (s) useDefaultDelimiters = true
[DEBUG] -- end configuration --
If you look at the lines marked [LOOK], you'll see that maven-resources thinks that it has 4 tasks (the filter of 20 files, the filter of 16 files, and the 2 redundant copies of those 16 files).
So now I suspect that something (e.g., native2ascii-maven-plugin or other plugins or the maven build plan generator) is registering those tasks with maven-resources-plugin and that nothing in the system is bothering to notice that some of those tasks are redundant.