downloadMavenSources static method

Future<void> downloadMavenSources(
  1. List<MavenDependency> deps,
  2. String targetDir
)

Downloads and unpacks source files of deps into targetDir.

Implementation

static Future<void> downloadMavenSources(
    List<MavenDependency> deps, String targetDir) async {
  final tempDir = await currentDir.createTemp('maven_temp_');
  await _runMavenCommand(
    deps,
    [
      'dependency:unpack-dependencies',
      '-DexcludeTransitive=true',
      '-DoutputDirectory=../$targetDir',
      '-Dclassifier=sources',
    ],
    tempDir,
  );
  await tempDir.delete(recursive: true);
}