How to configure Jenkins to serve more artifact file types inline

Most of our builds archive the readme and release notes as part of the build. In the past, these were mostly .txt and .html, which are served in the browser just fine when clicked (we have the resource root URL configured as well).

However, we’re switching to MarkDown for most of these files, and Jenkins is not serving those as content, instead causing them to be downloaded.

I don’t see any immediate configuration for this in the UI - where do I go to tell Jenkins to serve .md files as text/markdown?

Note: running Jenkins on RHEL using the official packages, so hosted in Jetty; I assume it’s a Jetty configuration thing, but not sure where to put a file (especially in a way that persists across package updates).

I think you may be expecting Jenkins to render the markdown formatted archived artifact as HTML in the browser. Jenkins doesn’t do that as far as I know.

I created a Declarative Pipeline that archived some output as a markdown file like this:

pipeline {
    agent {
        label '!windows'
    }
    tools {
        jdk 'jdk25'
    }

    stages {
        stage('Java version') {
            steps {
                sh 'java --version 2>&1 | tee java-version.md'
                archiveArtifacts artifacts: 'java-version.md'
            }
        }
    }
}

After building that Pipeline, the archived artifact is visible on the build page like this:

Screenshot 2025-11-07 034239

If I click the “view” link, the text of the file is rendered in my Chrome browser. If I click the java-verison.md link, the file is downloaded.

I assume that you want the file to be rendered as HTML from the content of the markdown file. As far as I understand it, Jenkins does not do that.

It might be possible to extend the Markdown Formatter plugin to do that, but it does not do that now as far as I know.

No, that is not what I expect, not in the sense that Jenkins does this anyway.

For an HTML file, clicking view shows the HTML source, and clicking the file serves it using the resource root URL, letting the browser apply its rendering to it.

For the MarkDown file, view behaves the same way (showing the raw contents), but clicking triggers a download, not a serving of the file on the resource root URL. We have a browser plugin for rendering MarkDown, but that does not get a chance to be applied this way.

Or, perhaps more accurately, the .md file may be served on the resource root URL by Jetty, but it decides it doesn’t know its mime type, resulting in the download.
I’m sure that will be configurable (i.e. telling Jetty that .md files are text/markdown), but with Jetty being bundled, I am not sure where that config would go, and whether it would need reapplying after every package upgrade.

If there is a jenkins package for use with Apache HTTPD that might be an alternative, but having to do a full Apache setup just for this one thing seems overkill.