Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when I deploy a project that contains a maven dependency of GitHub Packages. I get 401. #432

Closed
yaoqiangpersonal opened this issue Dec 18, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@yaoqiangpersonal
Copy link

Description:
I push a maven project to GitHub packages. I use default settings.xml. but it doesn't work. I have to add the GitHub profile to setting.xml and activate it. then it works well.

Task version:
actions/setup-java@v3

Platform:
Ubuntu

Repro steps:
Error: Non-resolvable import POM: Could not transfer artifact xxx from/to bom (https://maven.pkg.github.com/xxx/*): authentication failed for xxxxx, status: 401 Unauthorized @ line 56, column 16

Expected behavior:
I don't need to set settings. xml for each project

Actual behavior:
I have to set a custom settings.xml like this:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
	<servers>
		<server>
			<id>github</id>
			<username>${env.GITHUB_ACTOR}</username>
			<password>${env.GITHUB_TOKEN}</password>
		</server>
		<server>
			<id>gpg.passphrase</id>
			<passphrase>${env.GPG_PASSPHRASE}</passphrase>
		</server>
	</servers>
	<profiles>
		<profile>
			<id>github</id>
			<repositories>
				<repository>
					<id>github</id>
					<name>GitHub Apache Maven Packages</name>
					<url>https://maven.pkg.github.com/xxxxx/*</url>
				</repository>
			</repositories>
		</profile>
	</profiles>
	<activeProfiles>
		<activeProfile>github</activeProfile>
	</activeProfiles>
</settings>
@yaoqiangpersonal yaoqiangpersonal added bug Something isn't working needs triage labels Dec 18, 2022
@panticmilos panticmilos self-assigned this Dec 19, 2022
@panticmilos
Copy link
Contributor

hi @yaoqiangpersonal, thank you for the report. We will take a look at it.

@panticmilos
Copy link
Contributor

hi @yaoqiangpersonal could you provide us the public repo or a mock of it? If it's too much trouble you can also provide us with the workflow YAML

@panticmilos
Copy link
Contributor

hi @yaoqiangpersonal, just a gentle ping :)

@panticmilos
Copy link
Contributor

hi @yaoqiangpersonal, since there is no activity on this issue I will close it for now.

Feel free to reopen it, or continue the conversation here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants