- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从 .proto
自动生成和部署 Java 库- 文件。第一部分,从我的.proto
生成Java源代码-files 已经可以工作,并且 Jar 任务生成三个 .jar
-文件:example.jar
, example-javadoc.jar
和example-sources.jar
(在 /build/libs
中)。但是,发布到 Bintray 失败。
plugins {
id 'java-library'
id "maven-publish"
id "com.jfrog.bintray" version "1.8.4"
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation("io.grpc:grpc-netty:1.21.0")
implementation("io.grpc:grpc-protobuf:1.21.0")
implementation("io.grpc:grpc-stub:1.21.0")
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
news(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId "de.example"
artifactId "example"
version "0.0.1-test.1"
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
publications = ["news"]
publish = true
pkg {
repo = "example-mvn"
name = "example"
userOrg = "example"
licenses = ["Apache-2.0"]
version {
name = "0.0.1-test.1"
vcsTag = "example_0.0.1-test.1"
}
}
}
生成的 jar 应该发布到 Bintray 但执行 gradle bintrayUpload -DBINTRAY_USER=xxx -DBINTRAY_API_KEY=xxx --stacktrace
产生以下错误:
> Task :publishNewsPublicationToMavenLocal FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishNewsPublicationToMavenLocal'.
> Failed to publish publication 'news' to repository 'mavenLocal'
> Failed to install artifact de.example:example:jar:0.0.1-test.1: /home/jowan/.m2/repository/de/example/example/0.0.1-test.1/example-0.0.1-test.1.jar (No such file or directory)
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':publishNewsPublicationToMavenLocal'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:117)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:184)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ResolveIncrementalChangesTaskExecuter.execute(ResolveIncrementalChangesTaskExecuter.java:84)
at ...
Caused by: org.gradle.api.artifacts.PublishException: Failed to publish publication 'news' to repository 'mavenLocal'
at org.gradle.api.publish.internal.PublishOperation.run(PublishOperation.java:38)
at org.gradle.api.publish.maven.tasks.PublishToMavenLocal.publish(PublishToMavenLocal.java:50)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at ...
Caused by: org.gradle.api.GradleException: Failed to install artifact de.example:example:jar:0.0.1-test.1: /home/jowan/.m2/repository/de/example/example/0.0.1-test.1/example-0.0.1-test.1.jar (No such file or directory)
at org.gradle.api.publication.maven.internal.action.AbstractMavenPublishAction.publish(AbstractMavenPublishAction.java:106)
at org.gradle.api.publication.maven.internal.action.MavenInstallAction.publish(MavenInstallAction.java:27)
at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher.execute(AbstractMavenPublisher.java:68)
at org.gradle.api.publish.maven.internal.publisher.AbstractMavenPublisher.publish(AbstractMavenPublisher.java:45)
at org.gradle.api.publish.maven.internal.publisher.StaticLockingMavenPublisher.publish(StaticLockingMavenPublisher.java:38)
at ...
Caused by: org.sonatype.aether.installation.InstallationException: Failed to install artifact de.example:example:jar:0.0.1-test.1: /home/jowan/.m2/repository/de/example/example/0.0.1-test.1/example-0.0.1-test.1.jar (No such file or directory)
at org.sonatype.aether.impl.internal.DefaultInstaller.install(DefaultInstaller.java:279)
at org.sonatype.aether.impl.internal.DefaultInstaller.install(DefaultInstaller.java:201)
at org.sonatype.aether.impl.internal.DefaultInstaller.install(DefaultInstaller.java:158)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.install(DefaultRepositorySystem.java:436)
at org.gradle.api.publication.maven.internal.action.MavenInstallAction.publishArtifacts(MavenInstallAction.java:39)
at ...
Caused by: java.io.FileNotFoundException: /home/jowan/.m2/repository/de/example/example/0.0.1-test.1/example-0.0.1-test.1.jar (No such file or directory)
at org.sonatype.aether.impl.internal.DefaultFileProcessor.copy(DefaultFileProcessor.java:122)
at org.sonatype.aether.impl.internal.DefaultInstaller.install(DefaultInstaller.java:266)
... 89 more
* Get more help at https://help.gradle.org
最佳答案
终于发现问题了:配置工作正常,但是在错误的环境中执行。我正在 Windows 上工作,但从 Ubuntu 子系统调用了 gradle bintrayUpload -DBINTRAY_USER=xxx -DBINTRAY_API_KEY=xxx --stacktrace
。从 Windows 内部调用它效果很好。
关于java - Gradle bintrayUpload 找不到生成的 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56858793/
我在运行 gradlew install 时遇到以下错误。 Failed to capture snapshot of input files for task 'javadoc' during up
我正在尝试将我的库发布到 bintray。但是创建的jar文件只包含一个META-INF文件夹,没有类文件。 我已按照 https://github.com/bintray/gradle-bintra
我正在尝试从 .proto 自动生成和部署 Java 库- 文件。第一部分,从我的.proto生成Java源代码-files 已经可以工作,并且 Jar 任务生成三个 .jar -文件:example
我正在学习本教程 https://antoniocappiello.com/2015/11/11/publish-your-library-to-jcenter-in-3-steps/发布我的第一个库
我想将我的图书馆上传到 jecenter。我已经创建了 bintray 帐户等并遵循了此处提到的所有步骤。 我在我的应用程序模块和库模块中做了以下更改。 //库build.gradle apply p
我遵循了将我的 AAR 文件发布到 JCenter 所需的每个步骤,然后使用 https://github.com/danielemaddaluno/gradle-jcenter-publish 将其
在更新gradle和android studio之前,我曾使用tutorial的这些任务将我的库上载到Bintray: 第一:gradlew install 第二个:gradlew bintrayUp
我正在尝试将 Android 库发布到 jcenter。我关注了https://github.com/danielemaddaluno/gradle-jcenter-publish教程。在我尝试执行之
我很长一段时间都面临这个错误: Execution failed for task ':lib-change-scene:bintrayUpload'. Could not create packag
我正在尝试将我的库上传到 jCenter。我正在学习本教程: http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-m
我的版本有什么问题? bintray.gradle apply plugin: 'com.jfrog.bintray' version = '0.1' task sourcesJar(type: Ja
我正在开发一个 android 库项目。我想将我的库上传到 JCenter。我已经创建了 bintray 帐户等并遵循了所有提到的步骤 here . 我在我的应用程序模块和库模块中做了以下更改。 应用
我是一名优秀的程序员,十分优秀!