jitpack / jitpack.io

Documentation and issues of https://jitpack.io
MIT License
2.54k stars 185 forks source link

Looking for pom.xml even though I have build.gradle #4066

Closed jonasns closed 2 years ago

jonasns commented 4 years ago

Hi,

I have been trying to fix this for a couple of days now, but I cannot figure it out. I have added other people's suggestions but to no avail. When testing on jitpack.io I keep getting this error:

Looking for pom.xml in build directory and ~/.m2 2019-11-16T10:18:42.975296401Z Exit code: 0 ERROR: No build artifacts found

Here's the full log file: https://jitpack.io/com/github/jonasns/thefairjournal_app/0.1/build.log And the GitHub public repository: https://github.com/jonasns/thefairjournal_app

According to the tutorial I should not need a pom.xml file if I use Gradle (https://jitpack.io/docs/BUILDING/), so I'm really stuck here.

The code is running fine in android studio without any errors until I add: dependencies { implementation 'com.github.jonasns:thefairjournal_app:master-SNAPSHOT' }

After I add that I get the error: ERROR: Failed to resolve: com.github.jonasns:thefairjournal_app:master-SNAPSHOT

Do you have any advice for me?

Best, Jonas

jitpack-io commented 4 years ago

Hi,

The issue seems to be that build artifacts are not installed into mavenLocal() (~/.m2/) so JitPack can't find them. The install task should be doing that and also it should generate a .pom file in the build directory. It might be that the https://github.com/dcendents/android-maven-gradle-plugin does not support Gradle 5 yet.

jitpack-io commented 4 years ago

android-maven-gradle-plugin readme page recommends using https://github.com/sky-uk/gradle-maven-plugin instead. This should work on JitPack, however will require a custom build command in jitpack.yml file. Looking into it

jitpack-io commented 4 years ago

@jonasns Is this an application or an Android library project?

jonasns commented 4 years ago

Hi @jitpack-io, Thank you for looking into this! I was trying to make a progressive web app of my homepage and put it into the Play Store. I found the following tutorial, which guided me to use jitpack: https://css-tricks.com/how-to-get-a-progressive-web-app-into-the-google-play-store/ Best, Jonas

jonasns commented 4 years ago

Perhaps I should wait until Gradle 5 is supported?

Vipinbalakrishnan commented 3 years ago

Hi @jitpack-io , Can you please update is the issue is fixed?

When I tried to publish my library in jitpack, I am facing same issue in AndroidStudio Arctic fox version.

I am using maven-publish plugin in module build.gradle file as plugins { id 'com.android.application' id 'maven-publish' }

and

gradle version in project build.gradle file classpath "com.android.tools.build:gradle:7.0.2"

Also tried integrating apply from: "https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/1.3.0/gradle-mavenizer.gradle"

Nothing seems to be working.

Error log:- BUILD SUCCESSFUL in 1m 13s 119 actionable tasks: 116 executed, 3 up-to-date Build tool exit code: 0 Looking for artifacts... Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2 Looking for pom.xml in build directory and ~/.m2 2021-10-01T15:49:00.208744998Z Exit code: 0

ERROR: No build artifacts found

Link to complete log file is here

Vipinbalakrishnan commented 3 years ago

@jonasns @jitpack-io

I am able to successfully release my library to jitpack.io by the following steps.

  1. Updated gradle plugin version to the latest in build.gradle file
    • of the project root in the dependencies section as below.

dependencies { classpath "com.android.tools.build:gradle:7.0.2" }

  1. Added jitpack.io repository to build.gradle file of the root as well as the library module of the project as below.



repositories { google() mavenCentral() maven { url "https://jitpack.io" } }


3. Added plugin maven-publish in the build.gradle file of the module as below along with library plugin.

plugins { id 'com.android.library' id 'maven-publish' }

  1. Added jitpack.yml in the root of the project for JAVA 11 support. Create a file with name as 'jitpack.yml' with the following content

jdk:

  1. Changed java version to 11 in build.gradle file of the app module and library module inside android {} as below New gradle plugin builds on java 11.

compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 }

  1. Added maven publication settings as below in the build.gradle of module



afterEvaluate { publishing { publications { // Creates a Maven publication called "release". release(MavenPublication) { from components.release groupId = 'com.github.Vipinbalakrishnan' artifactId = 'ribbonlayout' version = '1.1' } } } }

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

SharmaShubham07 commented 1 month ago

I was having the same issue today and finally it has been resolved

The thing i did is just deleted my .yml file and let the compiler find it manually and the isuue will be resolved.

Hope this finds you well and will help you.