Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #402 from grtjn/391-update-xcc-jar
Browse files Browse the repository at this point in the history
Fixed #391: replaced xcc jar, improved jar lookup
  • Loading branch information
paxtonhare committed Mar 10, 2015
2 parents 5e6fad2 + 125da74 commit 92a5a17
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Binary file not shown.
26 changes: 18 additions & 8 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,12 @@ def recordloader
prop_string << %Q{-D#{k}="#{v}" }
end

runme = %Q{java -cp #{ServerConfig.expand_path("../java/recordloader.jar")}#{path_separator}#{ServerConfig.expand_path("../java/marklogic-xcc-5.0.2.jar")}#{path_separator}#{ServerConfig.expand_path("../java/xpp3-1.1.4c.jar")} #{prop_string} com.marklogic.ps.RecordLoader}
# Find the jars
recordloader_file = find_jar("recordloader")
xcc_file = find_jar("xcc")
xpp_file = find_jar("xpp")

runme = %Q{java -cp #{recordloader_file}#{path_separator}#{xcc_file}#{path_separator}#{xpp_file} #{prop_string} com.marklogic.ps.RecordLoader}
logger.info runme
`#{runme}`
end
Expand All @@ -791,7 +796,13 @@ def xqsync
prop_string << %Q{-D#{k}="#{v}" }
end

runme = %Q{java -Xmx2048m -cp #{ServerConfig.expand_path("../java/xqsync.jar")}#{path_separator}#{ServerConfig.expand_path("../java/marklogic-xcc-5.0.2.jar")}#{path_separator}#{ServerConfig.expand_path("../java/xstream-1.4.2.jar")}#{path_separator}#{ServerConfig.expand_path("../java/xpp3-1.1.4c.jar")} -Dfile.encoding=UTF-8 #{prop_string} com.marklogic.ps.xqsync.XQSync}
# Find the jars
xqsync_file = find_jar("xqsync")
xcc_file = find_jar("xcc")
xstream_file = find_jar("xstream")
xpp_file = find_jar("xpp")

runme = %Q{java -Xmx2048m -cp #{xqsync_file}#{path_separator}#{xcc_file}#{path_separator}#{xstream_file}#{path_separator}#{xpp_file} -Dfile.encoding=UTF-8 #{prop_string} com.marklogic.ps.xqsync.XQSync}
logger.info runme
`#{runme}`
end
Expand All @@ -815,22 +826,21 @@ def corb
modules_database = @properties['ml.modules-db']
install = find_arg(['--install']) == "true" || uris_module == '""'

# Find the XCC jar
matches = Dir.glob(ServerConfig.expand_path("../java/*xcc*.jar"))
raise "Missing XCC Jar." if matches.length == 0
xcc_file = matches[0]
# Find the jars
corb_file = find_jar("corb")
xcc_file = find_jar("xcc")

if install
# If we're installing, we need to change directories to the source
# directory, so that the xquery_modules will be visible with the
# same path that will be used to see it in the modules database.
Dir.chdir(@properties['ml.xquery.dir']) do
runme = %Q{java -cp #{ServerConfig.expand_path("../java/corb.jar")}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
runme = %Q{java -cp #{corb_file}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
logger.info runme
`#{runme}`
end
else
runme = %Q{java -cp #{ServerConfig.expand_path("../java/corb.jar")}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
runme = %Q{java -cp #{corb_file}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
logger.info runme
`#{runme}`
end
Expand Down
6 changes: 6 additions & 0 deletions deploy/lib/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,9 @@ def parse_json(body)
return body
end
end

def find_jar(jarname, jarpath = "../java/")
matches = Dir.glob(ServerConfig.expand_path("#{jarpath}*#{jarname}*.jar"))
raise "Missing #{jarname} jar." if matches.length == 0
matches[0]
end

0 comments on commit 92a5a17

Please sign in to comment.