|
205 | 205 |
|
206 | 206 | import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory; |
207 | 207 | import com.github.eirslett.maven.plugins.frontend.lib.InstallationException; |
208 | | -import com.github.eirslett.maven.plugins.frontend.lib.NpmRunner; |
209 | 208 | import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig; |
| 209 | +import com.github.eirslett.maven.plugins.frontend.lib.YarnRunner; |
210 | 210 | import com.typesafe.config.Config; |
211 | 211 | import org.jooby.funzy.Throwing; |
212 | 212 |
|
213 | 213 | import java.util.Arrays; |
214 | 214 | import java.util.Map; |
215 | 215 | import java.util.Objects; |
216 | | -import java.util.Optional; |
217 | 216 | import java.util.function.Function; |
218 | 217 | import java.util.stream.Collectors; |
219 | 218 |
|
@@ -348,17 +347,16 @@ public Yarn(String nodeVersion, String yarnVersion) { |
348 | 347 | protected NodeTask newTask(FrontendPluginFactory factory, Config conf, ProxyConfig proxy, |
349 | 348 | Map<String, String> env, String nodeVersion) throws InstallationException { |
350 | 349 | Function<String, String> property = key -> conf.hasPath(key) ? conf.getString(key) : null; |
351 | | - factory.getNPMInstaller(proxy) |
352 | | - .setNpmVersion(yarnVersion) |
353 | | - .setNodeVersion(nodeVersion) |
354 | | - .setNpmDownloadRoot(conf.getString("yarn.downloadRoot")) |
355 | | - .setUserName(property.apply("yarn.username")) |
356 | | - .setPassword(property.apply("yarn.password")) |
357 | | - .install(); |
358 | | - NpmRunner npm = factory.getNpmRunner(proxy, conf.getString("yarn.registryURL")); |
| 350 | + factory.getYarnInstaller(proxy) |
| 351 | + .setYarnVersion(yarnVersion) |
| 352 | + .setYarnDownloadRoot(conf.getString("yarn.downloadRoot")) |
| 353 | + .setUserName(property.apply("yarn.username")) |
| 354 | + .setPassword(property.apply("yarn.password")) |
| 355 | + .install(); |
| 356 | + YarnRunner yarn = factory.getYarnRunner(proxy, conf.getString("npm.registryURL")); |
359 | 357 | return (cmd, args) -> { |
360 | 358 | String cmdline = cmd + " " + Arrays.asList(args).stream().collect(Collectors.joining(" ")); |
361 | | - npm.execute(cmdline, env); |
| 359 | + yarn.execute(cmdline, env); |
362 | 360 | }; |
363 | 361 | } |
364 | 362 |
|
|
0 commit comments