r1178 - trunk/wp-maven-plugin/src/main/java/org/nuiton/wikitty/plugin
Author: mfortun Date: 2011-08-19 10:53:55 +0200 (Fri, 19 Aug 2011) New Revision: 1178 Url: http://nuiton.org/repositories/revision/wikitty/1178 Log: *little change in deploy-jar goal Modified: trunk/wp-maven-plugin/src/main/java/org/nuiton/wikitty/plugin/WPDeployJarMojo.java Modified: trunk/wp-maven-plugin/src/main/java/org/nuiton/wikitty/plugin/WPDeployJarMojo.java =================================================================== --- trunk/wp-maven-plugin/src/main/java/org/nuiton/wikitty/plugin/WPDeployJarMojo.java 2011-08-19 08:22:52 UTC (rev 1177) +++ trunk/wp-maven-plugin/src/main/java/org/nuiton/wikitty/plugin/WPDeployJarMojo.java 2011-08-19 08:53:55 UTC (rev 1178) @@ -106,13 +106,6 @@ */ protected String serverUrl; - /** - * File to deploy. - * - * @parameter expression="${fileToDeploy}" - * @required - */ - protected File fileToDeploy; /** * Whether to run the "chmod" command on the remote site after the deploy. @@ -121,7 +114,7 @@ * @parameter expression="${maven.site.chmod}" default-value="true" * @since 2.1 */ - private boolean chmod; + protected boolean chmod; /** * The mode used by the "chmod" command. Only used if chmod = true. @@ -130,7 +123,7 @@ * @parameter expression="${maven.site.chmod.mode}" default-value="g+w,a+rX" * @since 2.1 */ - private String chmodMode; + protected String chmodMode; /** * The options used by the "chmod" command. Only used if chmod = true. @@ -139,10 +132,10 @@ * @parameter expression="${maven.site.chmod.options}" default-value="-Rf" * @since 2.1 */ - private String chmodOptions; + protected String chmodOptions; /** @component */ - private WagonManager wagonManager; + protected WagonManager wagonManager; /** * The current user system settings for use in Maven. @@ -151,7 +144,7 @@ * @required * @readonly */ - private Settings settings; + protected Settings settings; /** * @parameter expression="${session}" @@ -161,9 +154,9 @@ */ protected MavenSession mavenSession; - private PlexusContainer container; + protected PlexusContainer container; - private Repository repository; + protected Repository repository; /** * All available wagons. @@ -174,15 +167,22 @@ protected Map<String, Wagon> wagons; /** @component */ - private SettingsDecrypter settingsDecrypter; + protected SettingsDecrypter settingsDecrypter; - private ProxyInfo proxyInfo; + protected ProxyInfo proxyInfo; - private Wagon wagon; + protected Wagon wagon; + protected File fileToDeploy; + @Override protected void init() throws Exception { + + String file = getProject().getBuild().getDirectory(); + file+=File.separator+WPJarMojo.EXTERNALIZE_PREFIX+applicationName+".jar"; + fileToDeploy= new File(file); + repository = new Repository( serverId, serverUrl @@ -202,18 +202,14 @@ wagon = getWagon(repository, wagonManager); - try { - configureWagon(wagon, repository.getId(), settings, container, getLog()); - } catch (TransferFailedException e) { - throw new MojoExecutionException("Unable to configure Wagon: '" + repository.getProtocol() + "'", e); - } - } @Override protected void doAction() throws Exception { + + if (getLog().isDebugEnabled()) { getLog().debug("Deploying to '" + repository.getUrl() + "',\n Using credentials from server id '" + repository.getId() + "'"); @@ -221,6 +217,9 @@ try { + + configureWagon(wagon, repository.getId(), settings, container, getLog()); + AuthenticationInfo authenticationInfo = wagonManager.getAuthenticationInfo(repository.getId()); getLog().debug("authenticationInfo with id '" + repository.getId() + "': " + (authenticationInfo == null ? "-" : authenticationInfo.getUserName()));
participants (1)
-
mfortun@users.nuiton.org