# Nexus returning HTML file instead of JAR or POM file

**URL:** <https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository, asset-download\
**Created:** [May 22, 2023, 4:43pm UTC](https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660 "2023-05-22T16:43:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnold.morein](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@arnold.morein](https://community.sonatype.com/u/arnold.morein)\
**Post date:** [May 22, 2023, 4:43pm UTC](https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660/1 "2023-05-22T16:43:08Z")

</div>

I’ve tried several different versions of Maven and the same error always happens. Nexus finds my artifact but the POM and JAR files are HTML pages with mostly javascript references but no actual content or error message.

I’ve tried two different URLs:

[http://name:8081/#browse/browse:class-maven-group](http://name:8081/#browse/browse:class-maven-group)  
[http://name:8081/repository/class-maven-group](http://name:8081/repository/class-maven-group)

and the results are the same. I’m assuming this is a server configuration issue?

---

<div class="post-metadata">

**Author:** ![djeanprost](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/djeanprost/32/2478_2.png) [@djeanprost](https://community.sonatype.com/u/djeanprost)\
**Post date:** [May 23, 2023, 4:01pm UTC](https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660/2 "2023-05-23T16:01:32Z")

</div>

Hello,

This isn’t a server side issue but a client configuration issue.  
You’re referring to the UI URL in maven instead of the URL to be used to download the artifacts.  
The URL you should use should be something like this: _[Https://server](Https://server):port/repository/your-repo-name_.

It should work like this.

---

<div class="post-metadata">

**Author:** ![slv\_b](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@slv\_b](https://community.sonatype.com/u/slv_b)\
**Post date:** [May 24, 2023, 2:31pm UTC](https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660/3 "2023-05-24T14:31:30Z")

</div>

![изображение](https://canada1.discourse-cdn.com/flex047/uploads/communitysonatype/original/2X/a/a2f3b6f54ea2cb8d43a5588cfb554433235494bd.png)  
I’m not too strong in java and maven, but for apt repositories it helped to remove this checkbox.  
Especially with keys with a key extension. They are always considered binary by the nexus, but often they are textual. Because of what, instead of a file, an html page was returned with a warning about the wrong content type

---

<div class="post-metadata">

**Author:** ![arnold.morein](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@arnold.morein](https://community.sonatype.com/u/arnold.morein)\
**Post date:** [May 24, 2023, 3:34pm UTC](https://community.sonatype.com/t/nexus-returning-html-file-instead-of-jar-or-pom-file/10660/4 "2023-05-24T15:34:14Z")

</div>

Turns out it was a combination of wrong URL syntax and invalid authentication setup. Since Maven couldn’t authenticate, Nexus was attempting to return an HTML page with error information; but all I got was an HTML file with JS references and no real text.
