I install the Apache Maven on Ubuntu server with Apt with sudo apt install maven
I am new to Linux but as I am understanding this installation produces an m2 repository.
what is want is the following:
first how to find and inspect this m2?
second how to replace this m2 with an m2 repository that I have download to my desktop?
By default, maven's local repository is located in the user's home directory. In fact it's actually named ".m2" directory, instead of just "m2". It is a hidden directory. If you are not in your home directory, issue "cd ~" first. Then issue "ls -al" to see the presence of .m2 directory.
If for any reason, you do not see that "m2" directory after issuing above command, it simply means that you did not built or run any project that requires maven to get triggered and create that .m2 folder.
ps: Replacing the existing .m2 folder with the one you have on your desktop may not be a good idea. Instead, simply run the project (that you think requires the needed dependencies). This will build the .m2 directory afresh along with everything that app needs.
Related
We have a Jenkins Build server running on Ubuntu 14.04 x64 which is processing three other projects just dandy. We are integrating a fourth Node.js project but due to fact the outside contractor developing it put all the project files inside a folder of the repository. So to clarify, the root of the repository is a single folder; in which the actual project root is located.
Jenkins checks the repository out but when it runs the NPM commands for install and build fails as its looking for the package.json in the repository root versus the subfolder where all the necessary files are located.
There is lots of information out there on use case which have some similarities as mine, but nothing which provided a solution which worked for me.
I've tried using the full path when executing the shells commands, altering the projects workspace to the subfolder, even researched a way to checkout the specific folder using Git which appears to not be a trivial thing.
I cannot believe there isn't a way to execute a Jenkins build into the checkout repositories as if a specific subfolder was the root (CWD) for all the scripts being executed in the shell instance.
Any help would be greatly appreciated!!!
As hinted in the comment, the solution is to cd into the subfolder before the calls to npm.
I probably missed something here. I'm using Node 0.10.1 on Win7/64bit and installed grunt 0.4.1 with
npm install grunt
npm install -g grunt-cli
npm install -g grunt-init
Then I tried to install a template while in folder %USERPROFILE%
git clone git#github.com:gruntjs/grunt-init-gruntfile.git ~/.grunt-init/gruntfile
But git wants a passphrase for key [current folder]. So I just created a folder
%USERPROFILE%\.grunt-init\gruntfile\
and copied
https://raw.github.com/gruntjs/grunt-init-gruntfile/master/template.js
to it. Now I switched to the project folder and was able to start grunt-init with
grunt-init gruntfile
DOM involved? n
files concatenated or minified? Y
package.json? n
any changes? N
Process ends with "Done, without errors", but no file ist created, or at least I can't find it.
dont know how to clone into your userhome on windows, but IMPORTANT(!) you also need to copy the whole "root" directory ( https://raw.github.com/gruntjs/grunt-init-gruntfile/master/root) to '%USERPROFILE%.grunt-init\gruntfile\'
you know that this init-template will just create a gruntfile.js for you? (inside the root-directory you can see that). if you want to create a node-module, jquery-plugin and so on, use one of the other templates (grunt-init-node, grunt-init-jquery) and so on.
creating your own template is easy. just create a new folder in '%USERPROFILE%.grunt-init' with your template-name. add the template.js. add a root-directory where all the files are which you want to be copied, maybe add a rename.json (for folder and file-renamings) and maybe change some stuff in the template.js.
I think you are have few a different issues here - from your comments it looks like you are using a Windows.
The first issue is that you can't clone the repository. Having tried this myself, I found the problem was fixed by setting up a valid ssh key on my github account. So to clone this repository you need to create a github account and install ssh keys on both your machine and your github account. Github's documentation on how to do this is very good and can be found here for Windows https://help.github.com/articles/set-up-git#platform-windows.
The second issue is that the git clone command you are using won't work on a Windows machine as it supplies a path to a Linux home directory ~/.grunt-init/gruntfile.
From your comments I am guessing the %USERPROFILE%.grunt-init\gruntfile\ is the correct install directory for Windows and so changing your working directory to that and using the command git clone git#github.com:gruntjs/grunt-init-gruntfile.git should install it.
You may also consider working using Cygwin which allows you to use a linux working environment on a windows machine.
Happy node hacking.
I have a debian package that I built that contains a tar ball of the files, a control file, and a postinst file. Its built using dpkg-deb and it installs properly using dpkg.
The modification I would like to make is to have the installation directory of the files be determined at runtime based on an environment variable that will be set when dpkg -i is run on the deb file. I echo out the environment variable in the postinst script and I can see that its set properly.
My questions:
1) Is it possible to dynamically determine the installation directory at runtime?
2) If its possible how would I go about this? I have read about the rules file and the mypackage.install files but I don't know if either of these would allow me to accomplish this.
I could hack it by copying the files to the target location in the posinst script but I would prefer to do it the right way if possible.
Thanks in advance!
So this is what I found out about this problem over the past couple of weeks.
With prepackaged binaries you can't build a debian package with a destination directory dynamicall determined at runtime. I believe that this might be possible if installing a package that is built from source where you can set the install directory using configure. But in this case since these are embedded Ubuntu machines they don't have make so I didn't pursue such an option. I did work out a non traditional method (hack) for installing that did work. Since debian packages simply contain a tar ball relative to / simply build your package relative to a directory under /tmp. In the postinst script you can then determine where to copy the files from the archive into a permanent location.
I expected that after rebooting and the automatic deletion of the subdirectory under /tmp that dpkg might not know that the file package existed. This wasn't a problem. When I ran 'dpkg -l myapp' it showed as still installed. Updating the package using dpkg/apt-get also worked without a hitch.
What I did find is that if you attempted to remove the package using 'dpkg -r myapp' that dpkg would try and remove /tmp which wasn't good. However /tmp isn't easily removed so it never succeeded. Plus in our situation we never remove packages but instead simply upgrade them.
I eventually had to abandon the universal package due to code differences in the sources resulting in having to recompile per platform but I would have left it this way and it did work.
I tried using --instdir to change the install directory of the package and it does relocate the files but dpkg fails since the dpkg file can't be found relative to the new instdir. Using --instdir is sort of like a chroot. I also tried --admindir and --root in various combinations to see if I could use the dpkg system relative to / but install relocate the files but they didn't work. I guess rpm has a relocate option that works but not Ubuntu.
You can also write a script that runs dpkg-deb with a different environment for 6 times, generating 6 different packages. When you make a modification, you simply have to run your script, and all 6 packages gets generated and you can install them on your machines avoiding postinst hacking!
Why not install to a standard location, and simply use a postinst script to create symbolic links to the desired location? This is much cleaner, and shouldn't break anything in dpk -I.
I have a shell account on a Linux server (running Ubuntu 8.04) with user level permissions (but no root priveleges). The system has Git 1.5.x installed. I wish to run a more current version of git. I can compile from source and install in my home directory but would like the git commands to invoke my local, more current install, rather than the older system wide installation of Git.
How do I go about doing this?
Add the directory containing your git binary to the front of your $PATH. For example, if you installed to ~/bin, add $HOME/bin to the front of your path. You can do that in your shell config file; for bash, add this to .bashrc:
export PATH="${HOME}/bin:$PATH"
I'm trying to "portablize" git, so I want to send the required executables from the make process of git to my hosted web server. Can I do that? Do you think the executables will work?
The way I do it is to:
get all Git dependencies (as listed in this Solaris package site, but this works for any Unix platform)
compile those dependencies with --prefix=/home/myuser and install them in the usr/local/lib of my home directory
then compile Git (still avoiding any reference to a system path like /usr/local/lib, but only using the lib and include within my homedir)
and install Git in the /home/myuser/git directory
I can then copy only /home/myuser/git and /home/myuser/usr/local (and $prefix/libexec/git-core as Jakub mentions in the comments) to any other similar server, knowing it will work in isolation from any existing system libraries.