# Maven Deploy 401

**URL:** <https://forum.gitea.com/t/maven-deploy-401/12008>\
**Category:** Actions\
**Created:** [March 17, 2026, 2:16pm UTC](https://forum.gitea.com/t/maven-deploy-401/12008 "2026-03-17T14:16:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanz](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hanz](https://forum.gitea.com/u/hanz)\
**Post date:** [March 17, 2026, 2:16pm UTC](https://forum.gitea.com/t/maven-deploy-401/12008/1 "2026-03-17T14:16:19Z")

</div>

Hello Gitea forum,

i am currently trying to setup gitea actions with the maven repository described by this tutorial: [https://docs.gitea.com/usage/packages/maven](https://docs.gitea.com/usage/packages/maven "https://docs.gitea.com/usage/packages/maven"). this is my current build.yml file:

```auto
name: SwingSupport Building by Gitea Actions
run-name: SwingSupport Building by Gitea Actions
on: 
  push:
    branches:
      - main

jobs:
  Build SwingSupport:
    runs-on: native
    steps:        
      - name: Checkout
        run: git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@url/${{ github.repository }}.git
          
      - name: Build and Deploy with Maven
        run: |
          cd ./${{ github.event.repository.name }}/        
          mvn -s /var/lib/gitea-runner/maven_settings.xml -Downer=${{ github.repository_owner }} clean deploy -DskipTests

```

and i am currently struggling with a 401 exception:

```auto
Failed to deploy artifacts: Could not transfer artifact :pom:1.0.3 from/to gitea : status code: 401, reason phrase: Unauthorized (401) -> [Help 1]

```

my settings.xml from /var/lib/gitea-runner/maven\_settings.xml

the token is use is generated from a user called runner specifically created for this token.

```auto
<settings>
  <servers>
    <server>
      <id>gitea</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <value>token {the token i generated from the web ui}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
  </servers>
</settings>

```

does anybody know how to fix the 401 error? Best regards hanz

PS: If I can provide additional information to complete the picture please let me know.
