This is rather a normal behavior, Maven is using the file extension as artefact packaging
, from maven-deploy-plugin
, deploy-file
, packaging
option:
Type of the artifact to be deployed. Retrieved from the <packaging>
element of the POM file if a POM file specified. Defaults to the file extension if it is not specified via command line or POM.
Note: bold is mine.
Moreover, the classifier
option would indeed add an -
between the version and the string provided as classifier: that's maven convention.
In your case you want to specify a special packaging
, which would be jar.asc
if you really want the remote file to have as extension jar.asc
.
The following would hence work:
mvn deploy:deploy-file -Dfile=azerty-0.1.jar.asc -Dpackaging=jar.asc -DrepositoryId=your_id -Durl=http://your_repository -DgroupId=your_groupId -DartifactId=azerty -Dversion=0.1
Note the -Dpackaging=jar.asc
which effectively tells Maven the file extension would be jar.asc
.
As a general note, if you are using the repository as a build store, that would still be reasonable, otherwise in your case you would push to a Maven repository an artifact which would then be difficult (or rather weird) to import in a project.
If instead this is really an additional artifact of your project, you should look at the attach-artifact
goal of the build-helper-maven-plugin
, to effective define it as additional artifact, then Maven will automatically add it to its install
and deploy
phase.