ERROR: No build artifacts found - Maven Jitpack - java

Note: Before you mark this as duplicate please check all information as after 4 hours of search I couldn't find any close cases. All results were about Android Library or Gradle which is not correct on this case.
Links:
Build Log: https://jitpack.io/xyz/agmdev/AGMCore/3.3.1/build.log
Github Source: https://github.com/Ashenguard/AGMCore
Error:
Exit code: 0
Timed out after 20 min
ERROR: No build artifacts found
Project: Maven - Spigot
Version: 3.3.1
Today after finishing the coding, compiling, testing (All of them were successful on my PC) I decided it's time to upload it on Github and create the 3.3.1 release on jitpack.io so I or any other developer can use it in further projects as dependency.
Everything was ok until I started the new project depending on the new code I just uploaded.
But I faced the dependency not found on my IDE (Intelij) and I thought it is a connection issue or something similar, But after troubleshooting, I got to the Build being failure on jitpack.io.
Before you ask, I did test mvn install and it worked fine without any issue on my PC, but for some reason that I'm not aware of, jitpack fails...
What confused me more only thing that has been changed on pom.xml since the last successful build, is the version number
Possible issues that were not the issue in this case. (I'll update the list)
Packaging not being jar which was, Same as previous versions.
useIncrementalCompilation was not the issue as well.

This error can happen in multiple scenarios.
Scenario 1:
If the build fails
If there are no pom.xml or .pom files in build directory
If artifacts are not copied to $HOME/.m2/...
Scenario 2:
You can fix it by looking at https://github.com/jitpack/maven-modular
Scenario 3:
Try this jitpack example
Note: You can only solve it by yourself making sure you have double check your poms.
--- Updated --
Workaround:
Try to add JitPack repository and dependency in your pom.xml file:
JitPack repository:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
JitPack dependency:
<dependency>
<groupId>com.github.YourProjectName</groupId>
<artifactId>ID</artifactId>
<version>Tag</version>
</dependency>
Maybe it can fix the issue as you said it only occurs on JitPack.

After months of head-scratching, I found out the issue.
The issue was that Jitpack was not able to find one of the plugins I have used in the project, After adding the maven as a plugin repository the issue is gone and Jitpack is doing its job.
<pluginRepositories>
<pluginRepository>
<id>maven-snapshots</id>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
</pluginRepository>
<pluginRepository>
<id>maven-shade-plugin</id>
<url>https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin</url>
</pluginRepository>
</pluginRepositories>

Related

what happen when execute mvn install if there dont exist pom

I want to install pig-maven, I download it and run mvn install command, then it tell me an error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project pig-main: Failed to resolve dependencies for one or more projects in the reactor. Reason: Missing:
[ERROR] ----------
[ERROR] 1) org.apache.hive:hive-exec:jar:core:0.14.0-SNAPSHOT`
here is some relevant information in pom.xml:
<repositories>
<repository>
<id>repo.apache.snapshots</id>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
</repository>
<repository>
<id>repo.jboss.org</id>
<url>http://repository.jboss.com/nexus/content/groups/public/</url>
</repository>
</repositories>
...
<hive.version>0.14.0-SNAPSHOT</hive.version>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-exec</artifactId>
<version>${hive.version}</version>
<scope>compile</scope>
<classifier>core</classifier>
</dependency>
in specified snapshot repository I find it has some information of target jar but havent jar and pom. So then what should I do to install pig. The relate data as below:
What you are trying to install is the last version on github, it's a snapshot version and uses snapshots dependencies. You may try follow the tutorial of PIG and install a stable version.
It seems you are trying to install the development version of the project, however it depends on SNAPSHOT dependencies which are not available on your configured repositories.
Depending on what you really want you can:
As #grape_mao suggested, install a stable version using the proper guide (on the Github project go to releases and use the one you want)
If you really want to use this development version:
Find and configure a repository containing hive-exec-0.14.0-SNAPSHOT, the one your are showing does not contain the dependency or
Download and install yourself hive-exec-0.14.0-SNAPSHOT.jar from either a commit from the source code or a .jar file.

Maven how to add Git repos as dependency [duplicate]

This question already has answers here:
Can I use a GitHub project directly in Maven?
(3 answers)
Closed 2 years ago.
How do I add a Java library from its GitHub repo (the library uses Maven as a build system) as a dependency to my Maven project? Can I do that without downloading and compiling the library?
Now you can import a Java library from a GitHub repo using JitPack.
In your pom.xml:
Add repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Add dependency
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo name</artifactId>
<version>Release tag</version>
</dependency>
It works because JitPack will check out the code and build it. So you'll end up downloading the jar.
If the project doesn't have a GitHub release then its possible to use a commit id as the version.
At the moment there is no way you can do this unless the maintainer of the library provided a way to do this.
So on the title page of the library the should be an instruction containing the repository address like:
<repositories>
<repository>
<id>YOUR-PROJECT-NAME-mvn-repo</id>
<url>https://raw.github.com/YOUR-USERNAME/YOUR-PROJECT-NAME/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
And a dependency name:
<dependency>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
</dependency>
This means that all artifact of your project including your dependency will be searched in this repo.
You could also have a glance at pom.xml to check if there was an effort made to deploy artifacts to a remote repo. Typically the keywords are oss.sonatype.org or raw.github.com like in this case.
FYI, here is a way to provide a repo for your gihub artifact: Hosting a Maven repository on github.
Github now supports packages https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages
You can follow the steps above to deploy Jar files to github properly.
Another very nice thing about Jitpack is, it has a lookup button on the main page. And if you type the URL of your GitHub repository, it displays different commits of the source code, and you can select which commit/tag you want. The Jitpack creates pom dependencies for you.
It became dead simple.

How to solve maven 2.6 resource plugin dependency?

ERROR:
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Solutions Tried:
Updated project: not able to download from REPO of maven.
Tried putting perticular jar in that folder of .m2 repo.
Can provide references if you want.
Seems your settings.xml file is missing your .m2 (local maven repo) folder.
When using eclipse navigate to Window -> Preferences -> Maven -> User Settings -> Browse to your settings.xml and click apply.
Then do maven Update Project.
Right Click on Project go to -> Maven -> Update project ->select Force update project check box and click on Finish.
On windows:
Remove folder from C:\Users\USER.m2
Close and open the project or force a change on file: pom.xml for saving :)
If a download fails for some reason Maven will not try to download it within a certain time frame (it leaves a file with a timestamp).
To fix this you can either
Clear (parts of) your .m2 repo
Run maven with -U to force an update
I have faced the same issue. Try declaring missing plugin in the conf/settings.xml.
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Step 1 : Check the proxy configured in eclipse is correct or not ?
(Window->Preferences->General->Network Connections).
Step 2 : Right Click on Project-> Go to Maven -> Update the project
Step 3: Run as Maven Install.
==== By Following these steps, i am able to solve this error.
This fixed the same issue for me:
My eclipse is installed in /usr/local/bin/eclipse
1) Changed permission for eclipse from root to owner: sudo chown -R $USER eclipse
2) Right click on project/Maven right click on Update Maven select Force update maven project
I had exactly the same error. My network is an internal one of a company. The proxy has been disabled from the IT team so for that we do not have to enable any proxy settings. I have commented the proxy setting in settings.xml file from the below mentioned locations C:\Users\vijay.singh.m2\settings.xml
This fixed the same issue for me
This issue is happening due to change of protocol from http to https for central repository. please refer following link for more details. https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required
In order to fix the problem, copy following into your pom.ml file. This will set the repository url to use https.
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
I had exactly the same error. My network is an internal one of a company. I downloaded neon-eclipse for java developpers. These steps worked for me:
1- I downloaded a VPN client on my PC to be totally blinded from the network. Shellfire I used. Use free account and connect to Shellserver.
2- Inside the windows firewall, I added incoming rule for Eclipse. Navigate to where eclipse exe is found.
3- Perform Maven Update project.
Then the project was able to fetch from the maven repository.
hope it helps.
Tried everything. I deleted m2e and installed m2e version 2.7.0. Then deleted the .m2 directory and force updated maven. It worked!
Right click on your project under Package Explorer > Maven > Update Project > Select the checkbox that reads "Force updates of Snapshot/Releases" > Click on OK
This way you don't have to search around for your maven's settings.xml and if the cause is something else eclipse will automatically handle it whatever it may be. Expected path for user settings XML is shown by eclipse under: Window > Preferences > Maven > User Settings > User Settings (it is most likely, greyed out).
What worked for me was:
mvn -Dhttps.protocols=TLSv1.2 install
I faced the same issue and resolved by deleting the project that i created and then deleted the M2 folder in the local.
If you're connected to VPN, disconnect and then try.

NanoHTTPD Example Build Error

This question is really, really stupid as I have no experience with Maven.
I was interested in NanoHTTPD as an embedded web server in my project, but upon downloading the source and testing it out, I get the following error:
Failed to execute goal on project nanohttpd-samples: Could not resolve dependencies for project fi.iki.elonen:nanohttpd-samples:jar:2.0.2: The following artifacts could not be resolved: fi.iki.elonen:nanohttpd:jar:2.0.2, fi.iki.elonen:nanohttpd-webserver:jar:2.0.2: Failure to find fi.iki.elonen:nanohttpd:jar:2.0.2 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
I tried the -e flag and netbeans spat out a tonne more errors related to Maven, which none made sense.
I also tried putting together one that did not involve Maven myself, which it didn't work.
I Googled for an hour and absolutely no answers are avail. Results are <10 and none are related to nanohttpd.
I know Maven is similar to Ant, but I have no idea how it works.
Anyway,
NanoHTTPD > https://github.com/NanoHttpd/nanohttpd
I am using netbeans, with JDK 7 downloaded today on this new linux box.
Help is appreciated. Below is the error reproduced on Fedora Netbeans, Stock JDK7 + NB bundle.
Full resolution : http://img10.imageshack.us/img10/2061/screenshot0608201310360.png
Thank you!
I notice that there are 2 failing tests in the main (core) package of NanoHttpd. I've fixed those and the build runs cleanly on a Ubuntu VM.
I would suggest pulling the latest from master and trying the build again, should all be fixed.
Oh, and thanks ... without you running into this issue, I might not have known about build errors when running on a a linux platform!
You can try multiple things:
1: Try deleting the corresponding failed to download artifact directory
in your local repo. Next time I run the maven command the artifact
download is triggered again. Therefore I'd say it's a client side
setting. Local repo path:
Unix/Mac OS X – ~/.m2
Windows – C:\Documents and Settings{your-username}.m2
2: As specified in the settings reference, I guess what you need is to
change the default value of updatePolicy in Maven Settings, which is
daily. I am not sure if this applies to a failed download though.
Also, always is ok for snapshots not for releases.
<profiles>
<profile>
...
<repositories>
<repository>
<id>myRepo</id>
<name>My Repository</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
</repositories>
...
</profile>
</profiles>
...
</settings>
3: Use the -U in the build goal
4: Make sure you are using proper maven version Maven3/Maven2

Maven and db4o dependency

I'm intrigued to test new frameworks in the Java world, and decided to create a new project that takes advantage of Maven and db4o. I'm starting to get a hang of Maven, but I have a hard time adding db4o as a dependency to the project. First problem is that db4o doesn't exist in the official Maven repositories. Next up comes the problem that db4o seem to have recently restructured their whole site's URI:s, so I'm getting 'site not found' messages all the time when I try to navigate their site.
I found somewhere a potential Maven repository that should be at https://source.db4o.com/maven but I get all the time "Error reading archetype catalog https://source.db4o.com/maven Unable to locate resource in repository" when I try to access it.
So, any suggestions on how I'll get db4o up through Maven? I've managing Maven through Eclipse with the M2Eclipse plugin.
Works for me with the following snippet:
<project>
<repositories>
<repository>
<id>source.db4o</id>
<url>http://source.db4o.com/maven</url>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>com.db4o</groupId>
<artifactId>db4o-full-java5</artifactId>
<version>8.1-SNAPSHOT</version> <!-- latest version -->
</dependency>
...
</dependencies>
</project>
You won't see a dependency in m2eclipse unless the Maven repository has been indexed with the Nexus indexer...very few 3rd party repositories are.

Categories