我试图使用 github 包,我遵循了他们基本教程中的所有步骤,但我无法部署,我已经查看了几个站点来解决这个问题,但没有一个有效。
部署错误:
未能部署工件:找不到工件
我的settings.xml(来自 github 包教程):
<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
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/HenryFabio/maven-packages/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>HenryFabio</username>
<password>my token =)</password>
</server>
</servers>
</settings>
我的pom.xml(这只是一个测试项目):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.henryfabio</groupId>
<artifactId>github-packages</artifactId>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/HenryFabio/maven-packages/</url>
</repository>
</distributionManagement>
</project>
堆栈跟踪:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project github-packages: Failed to deploy artifacts:
Could not find artifact com.henryfabio:github-packages:jar:1.0 in github (https:
//maven.pkg.github.com/HenryFabio/maven-packages/) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on proje
ct github-packages: Failed to deploy artifacts: Could not find artifact com.henr
yfabio:github-packages:jar:1.0 in github (https://maven.pkg.github.com/HenryFabi
o/maven-packages/)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.jav
a:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
25)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347
)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy arti
facts: Could not find artifact com.henryfabio:github-packages:jar:1.0 in github
(https://maven.pkg.github.com/HenryFabio/maven-packages/)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.jav
a:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
25)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347
)
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Faile
d to deploy artifacts: Could not find artifact com.henryfabio:github-packages:ja
r:1.0 in github (https://maven.pkg.github.com/HenryFabio/maven-packages/)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (Defaul
tArtifactDeployer.java:146)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployM
ojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:157)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.jav
a:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
25)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347
)
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy a
rtifacts: Could not find artifact com.henryfabio:github-packages:jar:1.0 in gith
ub (https://maven.pkg.github.com/HenryFabio/maven-packages/)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.
java:301)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.
java:213)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy (DefaultR
epositorySystem.java:386)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (Defaul
tArtifactDeployer.java:142)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployM
ojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:157)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.jav
a:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessor
Impl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
25)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347
)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find
artifact com.henryfabio:github-packages:jar:1.0 in github (https://maven.pkg.gi
thub.com/HenryFabio/maven-packages/)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFail
ed (ArtifactTransportListener.java:48)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.ru
n (BasicRepositoryConnector.java:369)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put (BasicRep
ositoryConnector.java:288)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.
java:295)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.
java:213)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy (DefaultR
epositorySystem.java:386)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (Defaul
tArtifactDeployer.java:142)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployM
ojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:157)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347
)