Visit my.sonatype.com for documentation on Nexus Repository version 2.
By default when Nexus Repository 2 downloads files into proxy repositories it validates that the downloaded file's contents match what is expected based on the file's MIME type.
This works well for most normal file types, but occasionally you may find that you need to make Nexus aware of new MIME types, or add additional file extensions into ones it already processes.
Nexus Repository 2.3 and newer
Nexus Repository 2.3 contains a new feature which allows you to do this.
To use this feature, just create a file called "nexus.mimetypes" in "<nexus_root>/nexus/WEB-INF/classes". To add a mime type add a line with this format:
bz2: application/x-bzip2,application/x-bzip
Note that no whitespace is allowed in the comma delimited list of mime types. The first content type listed is the default, if no accept header is present for the artifact request this will be the content type sent back.
To override a mime type definition use this format:
override.html: text/xhtml,application/xml
The set of default MIME types Nexus Repository 2.3 ships with is as follows:
jar: application/zip
zip: application/zip
war: application/zip
ear: application/zip
pom: application/xml,application/x-maven-pom,text/xml
xml: application/xml,text/xml
tar: application/x-tar
swc: application/zip
swf: application/x-shockwave-flash
gz: application/x-gzip,application/x-tgz
tgz: application/x-tgz,application/x-gzip
bz2: application/x-bzip2
tbz: application/x-bzip2
You will need to restart nexus after making changes to the nexus.mimetypes file.
Nexus Repository 2.2 and older
Perform the following steps:
1) Extract and the default mime-type.properties from the nexus-api.jar. This can be found in BASEDIR/nexus/WEB-INF/lib/nexus-api-2.x.jar.
2) Copy this file into ${nexus_root}/conf (where the nexus.properties and jetty.xml files are located).
3) Edit to add additional MIME type mappings, or change existing ones
4) Restart Nexus Repository