1

I write a scala program that processes some wiki xml data. I want to get SBT to download not only the libraries needed to run my program but also large xml data from wikipedia. How can I do this in my main program code or in the sbt build files? Thanks in advance

user4343712
  • 401
  • 1
  • 3
  • 8

1 Answers1

0

For downloading it during the dependency resolution, I think you would need a custom SBT plugin. Doing it in the main program code is the recommended way.

To accomplish this on the main program, you could:

  1. Look where the XML resources are? e.g.URL, auth tokens
  2. Search how to save a file from URL in Scala. See this answer.
  3. Call a function that downloads the required files during application start-up, i.e. main(). You might also want to check if the file already exists to avoid re-downloading.
Community
  • 1
  • 1
Johnny Everson
  • 8,343
  • 7
  • 39
  • 75