Maven: How do I install mvnsh? - maven

I suspect I'm going about this the wrong way entirely.
I heard about mvnsh, and wanted to give it a try, to decrease the lag when I build.
But I'm completely clueless about how one would do that. I'm still learning maven, and drawing false parallels between mvn and tools like gem, cabal, or cpan is still biting me, so I'm not sure what I need to do to install a command line tool like mvnsh.
It doesn't seem to make sense to stick it as a dependency in some arbitrary project's pom.xml.
I downloaded mvnsh-assembly-1.0.1.pom from the download page on the theory that that was involved so far, but so far, nothing I've tried has worked. mvn install -f mvnsh-assembly-1.0.1.pom downloaded a bunch of jars, then died. mvn artifact:install -f mvnsh-assembly-1.0.1.pom downloaded more jars, then died.
I really have no idea what I'm doing here. Should I even be using mvn to install mvnsh?

Just download the http://repo1.maven.org/maven2/org/sonatype/maven/shell/dist/mvnsh-assembly/1.0.1/mvnsh-assembly-1.0.1-bin.zip or the .tar.gz archive depends on you OS unpack it and put the bin folder of the distribution to you PATH after that you can start mvnsh .

Related

Nifi won't start

Can't get NiFi to even start, I think I've made a really obvious mistake, but there is no bin folder immedietly in the directory that I unzipped, which I downloaded from here
The file structure in the folder that I have is like this:
Clearly have a bit of a stupid problem, appreciate the help.
There is a bin folder nested away in nifi-nar-bundles, but the .bat doesn't run.
You need to download the binary zip or tar, not the source zip.
https://www.apache.org/dyn/closer.lua?path=/nifi/1.5.0/nifi-1.5.0-bin.tar.gz
or
https://www.apache.org/dyn/closer.lua?path=/nifi/1.5.0/nifi-1.5.0-bin.zip
Bryan has provided the simplest solution. However, if you are interested in building it from source, you can use Apache Maven to compile the source code you have downloaded into an executable application. The complete steps are here, but in summary:
Open a command prompt in this directory
Ensure Maven >= 3.1.0 and Java 8 are installed
Run the command mvn clean install -T2.0C -DskipTests (clean and install this application with 2 threads per core and skip running unit and integration tests)
When the build is complete, change the directory to nifi-assembly\target\nifi-1.5.0-bin\nifi-1.5.0\
You will now see the bin, conf, lib, logs, etc. directories
Run bin\nifi.bat start to start NiFi

sdk is not pulling down gradle

I'm looking to develop an application using gradle, groovy, maven other other products supported by sdkman. I'm using cygwin on a windows 10 machine. All seems good and updates most software packages that are needed. When I get to the point of installing gradle, sdk simply can't download ANY version of gradle. Is this a bug or am I missing something. Here's what I'm getting from my cygwin console.
Admin#Dale-PC ~
$ sdk install gradle
Downloading: gradle 2.14.1
In progress...
######################################################################## 100.0%
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /home/Admin/.sdkman/archives/gradle-2.14.1.zip or
/home/Admin/.sdkman/archives/gradle-2.14.1.zip.zip, and cannot find /home/Admin/.sdkman/archives/gradle-2.14.1.zip.ZIP, period.
Stop! The archive was corrupt and has been removed! Please try installing again.
Admin#Dale-PC ~
It seems as though sdk thinks it knows where it is however when it goes to pull it down, it doesn't pull down. Then sdk goes to unpack it and it can't find it. Any advice would be appreciated. Btw, I'm not going through a proxy and everything else seems to install just fine. It is just gradle that has the issue. Also, why is it trying to pull down an old version of gradle (2.14.1)?
I've downloaded the v2.14.1-all version, renamed the file to be gradle-2.14.1.zip.zip and placed it in the /home/Admin/.sdkman/archives/ directory and then did the install for gradle again. This time it found it and installed it as though it had downloaded the correct version. It's a solution for now.
v2.14.1 is the newest version of gradle. See here and here (3 is currently in beta-ish)
The filename .zip.zip seems erroneous. Possibly a defect in sdkman. Unsure if it was you who reported this on github, but: https://github.com/sdkman/sdkman-cli/issues/445

Making sure maven is running from scratch with a clean repo

I am pretty new to Maven and really not trying to fully learn it right now, just trying to install my java project.
I get some errors (it is from a Hadoop Crunch project) but the errors feel like they are referring to my older code that was doing a division and could be div by zero.
So anyway: Currrently I am dong mvn clean install but looks like there is something its cache still? is there a more powerful way of doing this such that I make sure nothing is coming from its cache, etc?
Look for your repo at C:\Users\youruser\.m2 or ~/.m2, you can delete that whenever you want but it will cause a "Download the Internet" the next time you do something.
That's obviously not the solution for daily use, the mvn clean install does compile and put the binaries of your project in your local repository from scratch, but if you have SNAPSHOT dependencies to separate projects (I'm not talking about submodules, I mean projects in some other directory) then you would need to go to those projects first and do mvn clean install there first so that your local repository has the latest binaries.

Maven re-build and deploy

I'm new to compiled web development, and I'm just trying to figure out the build/deploy process.... I've done:
mvn clean install
on a project, which built and deployed the project and now I can see it. If I want to make changes to the codebase, do I really need to run mvn clean install again to re-build and deploy the changes or is there a way to do a quicker build without using a "proper" IDE?
I'm using vim/gvim
Thanks!
Maven already handles the dependencies and only re-builds the necessary files... unless you throw away all previous build artifacts with clean! You should only need to use clean when you run into problems, or when you have checked out a different version from version control. Usually, mvn install should suffice.
You can integrate that with Vim; the simplest is to
:set makeprg=mvn
and then trigger a build with :make install.
Plugins build on that simplistic setup, e.g. check out:
maven-plugin
maven-ide

Eclipse crashed, files got corrupted, now I can't install or uninstall EGit plugin

I am trying to configure Eclipse for Windows to meet my workplace's requirements, and in doing so the program ran out of memory and crashed. I am trying again with a fresh install (deleted all files I could find related to Eclipse and recopied).
I have a Git perspective available, but it is completely blank. Git is not listed in my current plugins, and not present in my plugins folder that I can find. If I try to install it, however, I am told it already exists.
Eclipse Version: 3.6.2
EGit Version: 1.1.0.201109151100-r
You can usually fix a lot of problems like this by doing a
$ eclipse -clean
You may have to add this to your eclipse.ini file.
If this doesn't work, start from a clean install (the eclipse directory & the workspace).

Resources