You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by lc...@apache.org on 2012/05/04 09:45:22 UTC
svn commit: r1333828 - in /incubator/npanday/trunk:
components/dotnet-executable/src/main/java/npanday/executable/
components/dotnet-executable/src/main/java/npanday/executable/impl/
components/dotnet-plugin/src/main/java/npanday/plugin/ plugins/maven-...
Author: lcorneliussen
Date: Fri May 4 09:45:22 2012
New Revision: 1333828
URL: http://svn.apache.org/viewvc?rev=1333828&view=rev
Log:
[NPANDAY-488] Packaging for Web Applications (also Azure Web Roles)
o moved the hard-coded versions to the poms
o versions still have to be retrieved dynamically
Modified:
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/NetExecutableFactory.java
incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java
incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java
incubator/npanday/trunk/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/NetExecutableFactory.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/NetExecutableFactory.java?rev=1333828&r1=1333827&r2=1333828&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/NetExecutableFactory.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/NetExecutableFactory.java Fri May 4 09:45:22 2012
@@ -64,15 +64,15 @@ public interface NetExecutableFactory
NetExecutable getPluginExecutable(
MavenProject project, Artifact artifact, VendorRequirement vendorRequirement,
- ArtifactRepository localRepository, File parameterFile, String mojoName, File targetDir ) throws
+ ArtifactRepository localRepository, File parameterFile, String mojoName, File targetDir, String npandayVersion ) throws
PlatformUnsupportedException,
ArtifactResolutionException,
ArtifactNotFoundException;
public NetExecutable getPluginRunner(
MavenProject project, Artifact pluginArtifact, Set<Artifact> additionalDependencies,
- VendorRequirement vendorRequirement, ArtifactRepository localRepository, List<String> commands,
- File targetDir ) throws
+ VendorRequirement vendorRequirement, ArtifactRepository localRepository, List<String> commands, File targetDir,
+ String npandayVersion ) throws
PlatformUnsupportedException,
ArtifactResolutionException,
Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java?rev=1333828&r1=1333827&r2=1333828&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/impl/NetExecutableFactoryImpl.java Fri May 4 09:45:22 2012
@@ -214,8 +214,8 @@ public class NetExecutableFactoryImpl
public NetExecutable getPluginRunner(
MavenProject project, Artifact pluginArtifact, Set<Artifact> additionalDependencies,
- VendorRequirement vendorRequirement, ArtifactRepository localRepository, List<String> commands,
- File targetDir ) throws
+ VendorRequirement vendorRequirement, ArtifactRepository localRepository, List<String> commands, File targetDir,
+ String npandayVersion ) throws
PlatformUnsupportedException,
ArtifactResolutionException,
@@ -240,7 +240,7 @@ public class NetExecutableFactoryImpl
commands.add( "pluginArtifactPath=" + pluginArtifactPath );
return getArtifactExecutable(
- project, createPluginRunnerArtifact(), dependencies, vendorRequirement, localRepository, commands, targetDir
+ project, createPluginRunnerArtifact( npandayVersion ), dependencies, vendorRequirement, localRepository, commands, targetDir
);
}
@@ -376,7 +376,7 @@ public class NetExecutableFactoryImpl
public NetExecutable getPluginExecutable(
MavenProject project, Artifact pluginArtifact, VendorRequirement vendorRequirement,
- ArtifactRepository localRepository, File parameterFile, String mojoName, File targetDir ) throws
+ ArtifactRepository localRepository, File parameterFile, String mojoName, File targetDir, String npandayVersion ) throws
PlatformUnsupportedException,
ArtifactResolutionException,
ArtifactNotFoundException
@@ -385,7 +385,7 @@ public class NetExecutableFactoryImpl
Artifact loaderArtifact = artifactFactory.createDependencyArtifact(
"org.apache.npanday.plugins", "NPanday.Plugin.Loader",
- VersionRange.createFromVersion( "1.5.0-incubating-SNAPSHOT" ),
+ VersionRange.createFromVersion( npandayVersion ),
ArtifactType.DOTNET_EXECUTABLE.getPackagingType(), null, "runtime"
);
dependencies.add(
@@ -402,15 +402,16 @@ public class NetExecutableFactoryImpl
commands.add( "mojoName=" + mojoName );//ArtifactId = namespace
return getPluginRunner(
- project, loaderArtifact, dependencies, vendorRequirement, localRepository, commands, targetDir
+ project, loaderArtifact, dependencies, vendorRequirement, localRepository, commands, targetDir,
+ npandayVersion
);
}
- private Artifact createPluginRunnerArtifact()
+ private Artifact createPluginRunnerArtifact( String npandayVersion )
{
return artifactFactory.createDependencyArtifact(
"org.apache.npanday.plugins", "NPanday.Plugin.Runner",
- VersionRange.createFromVersion( "1.5.0-incubating-SNAPSHOT" ),
+ VersionRange.createFromVersion( npandayVersion ),
ArtifactType.DOTNET_EXECUTABLE.getPackagingType(), null, "runtime"
);
}
Modified: incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java?rev=1333828&r1=1333827&r2=1333828&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java (original)
+++ incubator/npanday/trunk/components/dotnet-plugin/src/main/java/npanday/plugin/AbstractMojo.java Fri May 4 09:45:22 2012
@@ -28,11 +28,9 @@ import npanday.executable.NetExecutableF
import npanday.vendor.VendorRequirement;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -77,6 +75,11 @@ public abstract class AbstractMojo
container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
+ // TODO: get npandayVersion injected somehow
+ private String npandayVersion = "1.5.0-incubating-SNAPSHOT";
+
+ // TODO: get the version of the actual plugin to run; this can be external to NPanday!!!
+ private String pluginVersion = "1.5.0-incubating-SNAPSHOT";
/**
* Executes the mojo.
@@ -161,14 +164,15 @@ public abstract class AbstractMojo
Artifact artifact = getArtifactFactory().createDependencyArtifact(
getMojoGroupId(),
getMojoArtifactId(),
- VersionRange.createFromVersion( "1.5.0-incubating-SNAPSHOT" ),
+ VersionRange.createFromVersion( pluginVersion ),
ArtifactType.DOTNET_MAVEN_PLUGIN.getPackagingType(),
null,
"runtime"
);
getNetExecutableFactory().getPluginExecutable(
- project, artifact, vendorRequirement, localRepository, paramFile, getClassName(), targetDir
+ project, artifact, vendorRequirement, localRepository, paramFile, getClassName(), targetDir,
+ npandayVersion
).execute();
}
catch ( PlatformUnsupportedException e )
Modified: incubator/npanday/trunk/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java?rev=1333828&r1=1333827&r2=1333828&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java (original)
+++ incubator/npanday/trunk/plugins/maven-mojo-generator-plugin/src/main/java/npanday/plugin/generator/MojoGeneratorMojo.java Fri May 4 09:45:22 2012
@@ -117,6 +117,9 @@ public class MojoGeneratorMojo
/** @parameter default-value="false" */
private boolean skip;
+ // TODO: get npandayVersion injected somehow
+ private String npandayVersion = "1.5.0-incubating-SNAPSHOT";
+
public void execute()
throws MojoExecutionException
{
@@ -144,7 +147,7 @@ public class MojoGeneratorMojo
Artifact artifact = artifactFactory.createDependencyArtifact(
"org.apache.npanday.plugins",
"NPanday.Plugin.MojoGenerator",
- VersionRange.createFromVersion( project.getVersion() ),
+ VersionRange.createFromVersion( npandayVersion ),
ArtifactType.DOTNET_EXECUTABLE.getPackagingType(),
null,
"runtime"
@@ -152,7 +155,7 @@ public class MojoGeneratorMojo
netExecutableFactory.getPluginRunner(
project, artifact, null, vendorRequirement, LocalRepositoryUtil.create( localRepository ), commands,
- targetDir
+ targetDir, npandayVersion
).execute();
}
catch ( PlatformUnsupportedException e )