org.apache.tools.ant.types.Commandline.Argument Java Examples
The following examples show how to use
org.apache.tools.ant.types.Commandline.Argument.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BasicSupport.java From ci.maven with Apache License 2.0 | 6 votes |
protected void installLicense() throws MojoExecutionException, IOException { if (licenseArtifact != null) { Artifact license = getArtifact(licenseArtifact); if (!hasSameLicense(license)) { log.info(MessageFormat.format(messages.getString("info.install.license"), licenseArtifact.getGroupId() + ":" + licenseArtifact.getArtifactId() + ":" + licenseArtifact.getVersion())); Java installLicenseTask = (Java) ant.createTask("java"); installLicenseTask.setJar(license.getFile()); Argument args = installLicenseTask.createArg(); args.setLine("--acceptLicense " + assemblyInstallDirectory.getCanonicalPath()); installLicenseTask.setTimeout(30000L); installLicenseTask.setFork(true); int rc = installLicenseTask.executeJava(); if (rc != 0) { throw new MojoExecutionException(MessageFormat.format(messages.getString("error.install.license"), licenseArtifact.getGroupId() + ":" + licenseArtifact.getArtifactId() + ":" + licenseArtifact.getVersion(), rc)); } } } }