0

这让我发疯了....我阅读并重新阅读了已经完成的关于该主题的帖子,以一种和另一种方式破坏了我的 pom 文件,但没有任何改变....我无法部署到 jcenter。 ...

我从一个非常简单的 pom 文件(由 创建mvn)开始,现在它更复杂,但仍然......没有上传......我现在整合了这里的评论所说的,但仍然......

顺便说一句,我已经设置了一个带有用户名和 API 密钥的 settings.xml 文件....与 bintray 网站上显示的完全一样...整个源代码在 github 上的https://github.com/nohkumado/ipx800Control.git下可用

这是实际的pom文件:

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
 <groupId>nohkumado</groupId>
 <artifactId>ipx800control</artifactId>
 <packaging>jar</packaging>
 <version>0.1.6</version>
 <name>IPX 800 support library</name>
 <url>https://github.com/nohkumado/ipx800Control</url>
 <inceptionYear>2015</inceptionYear> 
 <organization>
  <name>Noh Kuma Do</name>
 </organization>

 <description>ipx800control is a class that interfaces over local net with an Ipx800v3 domotic controller.</description>

<licenses>
 <license>
    <name>General Public License (GPL) version 3.0</name>
    <url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
 </license>
</licenses>

<developers>
  <developer>
     <name>Nohkumado</name>
     <email>nokumado@gmail.com</email>
     <roles>
        <role>Lead Developer</role>
     </roles>
  </developer>
</developers>

<dependencies>
 <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
  </dependency>
  <dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.0-alpha4</version>
  </dependency>
  </dependencies>

  <issueManagement>
   <system>GitHub Issue Tracker</system>
    <url>https://github.com/nohkumado/ipx800Control/issues</url>
  </issueManagement>

  <distributionManagement>
   <repository>
     <id>ipx800Control</id>
         <url>https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1</url>
     </repository>
    <snapshotRepository>
      <id>ipx800Control</id>
     <url>https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1</url>
     <!--url>https://api.bintray.com/content/nokumado/maven/ipx800Control/snapshots;publish=1</url-->
   </snapshotRepository>
  </distributionManagement>

 <scm>
   <connection>
       scm:git:git@github.com:nohkumado/ipx800Control.git
    </connection>
     <url>scm:git:git@github.com:nohkumado/ipx800Control.git</url>
      <developerConnection>
        scm:git:git@github.com:nohkumado/ipx800Control.git
      </developerConnection>
    <tag>HEAD</tag>
</scm>


<build>
 <plugins>
   <plugin>
   <artifactId>maven-release-plugin</artifactId>
    <version>2.4.1</version>
   <configuration>
    <useReleaseProfile>false</useReleaseProfile>
    <releaseProfiles>release</releaseProfiles>
   <autoVersionSubmodules>true</autoVersionSubmodules>
 </configuration>
  </plugin>
 </plugins>
</build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
    <plugins>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
        <id>attach-sources</id>
        <goals>
          <goal>jar</goal>
        </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
          <id>attach-javadocs</id>
          <goals>
        <goal>jar</goal>
          </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
      </build>
    </profile>
  </profiles>

</project>

这是 mvn deploy 日志的日志:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building IPX 800 support library 0.1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ ipx800control ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/devel/java/ipx800Control/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ ipx800control ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ ipx800control ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/devel/java/ipx800Control/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ ipx800control ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ ipx800control ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ ipx800control ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ ipx800control ---
[INFO] Installing /home/devel/java/ipx800Control/target/ipx800control-0.1.3-SNAPSHOT.jar to /home/devel/.m2/repository/nohkumado/ipx800control/0.1.3-SNAPSHOT/ipx800control-0.1.3-SNAPSHOT.jar
[INFO] Installing /home/devel/java/ipx800Control/pom.xml to /home/devel/.m2/repository/nohkumado/ipx800control/0.1.3-SNAPSHOT/ipx800control-0.1.3-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @    ipx800control ---
   Downloading:    https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1/nohkumado/ipx800control/0.1.3-SNAPSHOT/maven-metadata.xml

Uploading:      https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1/nohkumado/ipx800control/0.1.3-SNAPSHOT/ipx800control-0.1.3-20151022.200837-1.jar
   2/8 KB   
  4/8 KB   
  6/8 KB   
  8/8 KB   

 Uploading:  https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1/nohkumado/ipx800control/0.1.3-SNAPSHOT/ipx800control-0.1.3-20151022.200837-1.pom
  2/4 KB   
  4/4 KB   

 [INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.757 s
[INFO] Finished at: 2015-10-22T22:08:39+02:00
[INFO] Final Memory: 16M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ipx800control: Failed to deploy artifacts: Could not transfer artifact nohkumado:ipx800control:jar:0.1.3-20151022.200837-1 from/to ipx800Control (https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1): Failed to transfer file: https://api.bintray.com/content/nokumado/maven/ipx800Control;publish=1/nohkumado/ipx800control/0.1.3-SNAPSHOT/ipx800control-0.1.3-20151022.200837-1.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

~/.m2/repository 的内容(看起来对我有效......)

insgesamt 96
-rw-r--r-- 1 devel devel  8155 Okt 21 10:06 ipx800control-0.1.3-SNAPSHOT.jar
-rw-r--r-- 1 devel devel 53875 Okt 18 01:52 ipx800control-0.1.3-SNAPSHOT-javadoc.jar
-rw-r--r-- 1 devel devel  3311 Okt 18 01:37 ipx800control-0.1.3-SNAPSHOT.pom
-rw-r--r-- 1 devel devel  8594 Okt 18 01:52 ipx800control-0.1.3-SNAPSHOT-sources.jar
-rw-r--r-- 1 devel devel   772 Okt 22 22:08 maven-metadata-ipx800Control.xml
-rw-r--r-- 1 devel devel  1118 Okt 22 22:08 maven-metadata-local.xml
-rw-r--r-- 1 devel devel   290 Okt 22 22:08 _remote.repositories
-rw-r--r-- 1 devel devel   193 Okt 22 22:08 resolver-status.properties

所以我仍然被困住......并且仍然对这里出了什么问题一无所知....从 0.0.version 切换到 0.version 它似乎工作得更好......

所以非常感谢任何帮助!

4

2 回答 2

0

Bintray 是一个分发平台,不适用于 SNAPSHOT 版本。不允许将 SNAPSHOT-s 部署到 Bintray。

如果您需要一个存储库来处理 SNAPSHOT,那么 Artifactory 等Artifact Repository将是一个更好的选择。你甚至可以免费将它用于 Maven 和 Gradle 项目,或者在云端使用 Artifactory 的免费 oss.jfrog.org 实例,只要你将 OSS 项目发布到 Bintray 的 JCenter 即可

于 2015-10-22T20:28:38.380 回答
-1

首先,正如@JBaruch 指出的那样,Bintray 只处理发布,所以甚至不用费心上传快照。

我可以通过 Maven 发布到 Bintray 就好了。

<distributionManagement>在 POM 中的样子是这样的:

<distributionManagement>
    <repository>
      <id>bintray</id>
      <name>Bintray</name>
      <!-- publish=1 or 0 doesn't really matter, you can publish 
           through Bintray UI later if you set publish=0 -->
      <url>https://api.bintray.com/maven/<my username>/maven/<my Bintray package>/;publish=0</url>
    </repository>
</distributionManagement>

在 mysettings.xml中,我的凭据被指定为:

<server>
  <id>bintray</id>
  <username><my username></username>
  <password><my api key></password> <!-- NOT my Bintray password -->
</server>

这假设您已经在 Bintray 上的 Maven 存储库下创建了一个 Bintray 包。

除了该部分之外,我没有<repository>定义任何标签(在 POM 中或 中) ,因为它必须在那里。settings.xml<distributionManagement>

于 2015-10-17T17:29:11.010 回答