import com.opensymphony.xwork.Preparable;
import com.opensymphony.xwork.Validateable;
import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang.StringUtils;
/**
* Upload an artifact using Jakarta file upload in webwork. If set by the user a pom will also be generated. Metadata
return ERROR;
}
+ String pomFilename = filename;
+ if( classifier != null && !"".equals( classifier ) )
+ {
+ pomFilename = StringUtils.remove( pomFilename, "-" + classifier );
+ }
+ pomFilename = FilenameUtils.removeExtension( pomFilename ) + ".pom";
+
if ( generatePom )
{
try
{
- File generatedPomFile = createPom( targetPath, filename );
+ File generatedPomFile = createPom( targetPath, pomFilename );
consumers.executeConsumers( repoConfig, generatedPomFile );
}
catch ( IOException ie )
if ( pomFile != null && pomFile.length() > 0 )
{
try
- {
- String targetFilename = filename.replaceAll( packaging, "pom" );
- copyFile( pomFile, targetPath, targetFilename );
- consumers.executeConsumers( repoConfig, new File( targetPath, targetFilename ) );
+ {
+ copyFile( pomFile, targetPath, pomFilename );
+ consumers.executeConsumers( repoConfig, new File( targetPath, pomFilename ) );
}
catch ( IOException ie )
{
projectModel.setVersion( version );
projectModel.setPackaging( packaging );
- filename = FilenameUtils.removeExtension(filename) + ".pom";
- File pomFile = new File( targetPath, filename);
-
+ File pomFile = new File( targetPath, filename);
pomWriter.write( projectModel, pomFile );
return pomFile;