mirror of https://github.com/apache/archiva.git
MRM-856 - Artifact Upload replaces all instances of the name "jar" with "pom" when trying to change the file extension
* Use FilenameUtils from commons-io to properly strip the extension git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@673284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b4e15d6eb1
commit
571c96c635
|
@ -62,6 +62,7 @@ import com.opensymphony.webwork.ServletActionContext;
|
|||
import com.opensymphony.xwork.ActionContext;
|
||||
import com.opensymphony.xwork.Preparable;
|
||||
import com.opensymphony.xwork.Validateable;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
/**
|
||||
* Upload an artifact using Jakarta file upload in webwork. If set by the user a pom will also be generated. Metadata
|
||||
|
@ -446,9 +447,10 @@ public class UploadAction
|
|||
projectModel.setArtifactId( artifactId );
|
||||
projectModel.setVersion( version );
|
||||
projectModel.setPackaging( packaging );
|
||||
|
||||
File pomFile = new File( targetPath, filename.replaceAll( packaging, "pom" ) );
|
||||
|
||||
|
||||
filename = FilenameUtils.removeExtension(filename) + ".pom";
|
||||
File pomFile = new File( targetPath, filename);
|
||||
|
||||
pomWriter.write( projectModel, pomFile );
|
||||
|
||||
return pomFile;
|
||||
|
|
Loading…
Reference in New Issue