Update of /var/cvs/applications/app-base/plugin/src/main/java/org/mmbase/mojo
In directory
james.mmbase.org:/tmp/cvs-serv10989/plugin/src/main/java/org/mmbase/mojo
Modified Files:
DeployJar.java InstallJar.java InstallResources.java
Log Message:
details
See also:
http://cvs.mmbase.org/viewcvs/applications/app-base/plugin/src/main/java/org/mmbase/mojo
Index: DeployJar.java
===================================================================
RCS file:
/var/cvs/applications/app-base/plugin/src/main/java/org/mmbase/mojo/DeployJar.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- DeployJar.java 16 Feb 2009 21:26:55 -0000 1.2
+++ DeployJar.java 16 Feb 2009 23:29:34 -0000 1.3
@@ -93,23 +93,8 @@
*/
private Map repositoryLayouts;
- /**
- * URL where the artifact will be deployed. <br/>
- * ie ( file://C:\m2-repo or scp://host.com/path/to/repo )
- *
- * @parameter expression="${url}"
- */
- private String url;
-
- /**
- * Whether to deploy snapshots with a unique version or not.
- *
- * @parameter expression="${uniqueVersion}" default-value="true"
- */
- private boolean uniqueVersion;
-
/**
@@ -144,17 +129,16 @@
tempFile.deleteOnExit();
Model model = new Model();
- model.setModelVersion( "4.0.0" );
- model.setGroupId( groupId );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- model.setPackaging( packaging );
- model.setDescription( "POM was created from
mmbase:install-jar" );
- fw = new FileWriter( tempFile );
- tempFile.deleteOnExit();
- new MavenXpp3Writer().write( fw, model );
- metadata = new ProjectArtifactMetadata( artifact, tempFile );
- artifact.addMetadata( metadata );
+ model.setModelVersion("4.0.0");
+ model.setGroupId( groupId);
+ model.setArtifactId( artifactId);
+ model.setVersion(version);
+ model.setPackaging(packaging);
+ model.setDescription("POM was created from mmbase:deploy-jar"
);
+ fw = new FileWriter(tempFile);
+ new MavenXpp3Writer().write( fw, model);
+ metadata = new ProjectArtifactMetadata( artifact, tempFile);
+ artifact.addMetadata(metadata);
} catch (IOException e ) {
throw new MojoExecutionException( "Error writing temporary pom
file: " + e.getMessage(), e );
} finally {
@@ -170,16 +154,21 @@
ArtifactRepositoryLayout layout = ( ArtifactRepositoryLayout )
repositoryLayouts.get( repositoryLayout );
- if (url == null) {
- url =
project.getDistributionManagement().getSnapshotRepository().getUrl();
- }
- if (repositoryId == null) {
- repositoryId = "mmbase-snapshots";
- }
+ String url = version.endsWith("SNAPSHOT") ?
+
project.getDistributionManagement().getSnapshotRepository().getUrl() :
+ project.getDistributionManagement().getRepository().getUrl();
+
+ String repositoryId = version.endsWith("SNAPSHOT") ?
+
project.getDistributionManagement().getSnapshotRepository().getId() :
+ project.getDistributionManagement().getRepository().getId();
+
+ boolean uniqueVersion = version.endsWith("SNAPSHOT") ?
+
project.getDistributionManagement().getSnapshotRepository().isUniqueVersion() :
+
project.getDistributionManagement().getRepository().isUniqueVersion();
+
ArtifactRepository deploymentRepository =
repositoryFactory.createDeploymentArtifactRepository(repositoryId, url, layout,
uniqueVersion);
-
try {
deployer.deploy( file, artifact, deploymentRepository,
localRepository);
} catch (ArtifactDeploymentException e) {
Index: InstallJar.java
===================================================================
RCS file:
/var/cvs/applications/app-base/plugin/src/main/java/org/mmbase/mojo/InstallJar.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- InstallJar.java 16 Feb 2009 21:26:55 -0000 1.2
+++ InstallJar.java 16 Feb 2009 23:29:34 -0000 1.3
@@ -81,7 +81,7 @@
String groupId = project.getGroupId() + ".jars";
- Artifact artifact = artifactFactory.createArtifactWithClassifier(
groupId, artifactId, version, packaging, null);
+ Artifact artifact =
artifactFactory.createArtifactWithClassifier(groupId, artifactId, version,
packaging, null);
ArtifactMetadata metadata = null;
@@ -92,17 +92,16 @@
tempFile.deleteOnExit();
Model model = new Model();
- model.setModelVersion( "4.0.0" );
- model.setGroupId( groupId );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- model.setPackaging( packaging );
- model.setDescription( "POM was created from
mmbase:install-jar" );
- fw = new FileWriter( tempFile );
- tempFile.deleteOnExit();
- new MavenXpp3Writer().write( fw, model );
- metadata = new ProjectArtifactMetadata( artifact, tempFile );
- artifact.addMetadata( metadata );
+ model.setModelVersion( "4.0.0");
+ model.setGroupId( groupId);
+ model.setArtifactId( artifactId);
+ model.setVersion(version);
+ model.setPackaging(packaging);
+ model.setDescription("POM was created from
mmbase:install-jar");
+ fw = new FileWriter(tempFile);
+ new MavenXpp3Writer().write(fw, model);
+ metadata = new ProjectArtifactMetadata( artifact, tempFile);
+ artifact.addMetadata(metadata);
} catch (IOException e ) {
throw new MojoExecutionException( "Error writing temporary pom
file: " + e.getMessage(), e );
} finally {
Index: InstallResources.java
===================================================================
RCS file:
/var/cvs/applications/app-base/plugin/src/main/java/org/mmbase/mojo/InstallResources.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- InstallResources.java 16 Feb 2009 22:53:00 -0000 1.2
+++ InstallResources.java 16 Feb 2009 23:29:34 -0000 1.3
@@ -115,7 +115,7 @@
File target = new File(webapp, templatesTarget);
getLog().info("Copying " + templates + " to " + target);
int[] result = copyDirectory(templates, target, true);
- getLog().info("Copied " + result[0]+ " file. " + result[1]
+ " files were not modified");
+ getLog().info("Copied " + result[0] + " files. " +
result[1] + " files were not modified");
}
File blocks = new File(project.getBasedir(), "blocks");
if (blocks.isDirectory()) {
@@ -127,7 +127,7 @@
File target = new File(webapp, blocksTarget);
getLog().info("Copying " + blocks + " to " + target);
int[] result = copyDirectory(blocks, target, true);
- getLog().info("Copied " + result[0]+ " file. " + result[1]
+ " files were not modified");
+ getLog().info("Copied " + result[0]+ " files. " +
result[1] + " files were not modified");
}
} catch (IOException ioe) {
throw new MojoExecutionException(ioe.getMessage(), ioe);
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs