Maven install plugin not found - maven

I have to add some .pom files to the local .m2 repository and I am working on an offline system.
After successfully installing maven (checked with mvn -v) i tried to install the desired files using mvn install:install-file -Dfile=<Path/to/pom>.
However, this leads to a NoPluginFoundforPrefixException, because the prefix "install" is apparently unknown. Trying to download it from the central repository after execution obviously fails since the computer is not connected to the internet.
How can I get mvn install to work?

For the first time you need to use internet, so that your local/central repository get all the plugins which required to use mvn install.
Then you can work on offline mode.

Related

Could not resolve dependencies for project org.thingsboard:application:jar:3.3.0-SNAPSHOT

Want install ThingsBoard Community Edition on windows
when insatll maven this error appear
Could not resolve dependencies for project org.thingsboard:application:jar:3.3.0-SNAPSHOT: Could not find artifact org.thingsboard:dao:jar:tests:3.3.0-SNAPSHOT in central
How can solve this problem
install jdk add it in path
go to directory path run cmd then mvn clean install -Dmaven.test.skip=true
if error happend run mvn clean install -Dskiptests

Is it possible to install rpm package from a Nexus yum repo using Maven?

I would like to create a zip with some files and rpm packages using Maven assembly plugin and I would like to know if there is a way to download the rpm from a Nexus yum repository with the pom.xml (as a dependency or anything else).
I have found the rpm-maven-plugin but it can only create an rpm, it can't download it from Nexus.
I have found the solution, I used mvn wagon:
mvn wagon:upload-single -Dwagon.serverId=<ServerID> -Dwagon.url=http://<ServerUrl>/repository/<NexusReposirory>/<RPM file name> -Dwagon.fromFile=<RPM file>

Apt repository within Sonatype Nexus 3

Trying to use Nexus 3.15.2 as a local/offline package manager. Npm and Maven repos are OK. But, also want to use as an APT repository. It has yum repository feature but not apt repository type. Tried to use nexus-repository-apt plugin with docker container by following these instructions https://github.com/sonatype-nexus-community/nexus-repository-apt, but i could not make it.
Nexus Version: Sonatype Nexus OSS 3.15.2-01
Nexus Apt Repository Plugin: nexus-repository-apt-1.0.10
What I'm missing?
I followed the instructions given in the link, but this time used version 3.16 instead of 3.15. I even created the image and run it successfully, and created Apt repository and upload packages finally. Do not know why it forbids me to upload apt packages even if I could make the container running in version 3.15. Anyway, works fine with the version 3.16.

Is there any difference between run maven as sudo and without sudo?

I am using maven and JavaFX Maven Plugin. Maven will download jar from repository and save it to ~/.m2 directory. But if I use maven as sudo. For example, if I type sudo mvn com.zenjava:javafx-maven-plugin:2.0:fix-classpath, is there any difference with the command without sudo? Does maven download the plugin and save it to ~/.m2 as well?
I ask this question because I run this command both under sudo and no-sudo. It seems maven will re-download the plugin each time.
I think your question is related to this one.
So the answer to your question, would be if you are not changing the home directory while executing sudo, maven will download plugins to your user .m2 directory.

How to install artifacts into the local gradle filestore

Can anyone tell me how to install an artifact/project into the local gradle filestore?
gradle install
installs it to the local maven repository but I need to have it in
~/.gradle/caches/artifacts-15/filestore
It's a pure cache, and you can't install into it (by design). If you could, reproducibility would suffer (build works on one machine but not on another).
If you install it to your local maven repository and refer to the repository in you gradle build file, you will have solved your problem.
See
Is there a way to install jar local gradle repository, as it in mave (maven install:install-file
EDIT: You don't even have to install the jar into your maven repo:
https://stackoverflow.com/a/13531958/260122

Resources