Easy way to set Maven repository on home Tomcat - maven

I have created a test artifact. Maven finds it on the local machine. Now I want to publish it on my home site. May anyone advice on it or on documentation.
I tried the manual way but failed to find good description of things like .pom files. The maven-automated way is not very clear documented either. Thank you in advance.

That turned out being very simple - I copied folder "sample" from C:\Users\admin.m2\repository\ to ...\Tomcat7.0\webapps\ROOT\maven2\ and was able to run the test build on another computer via http. Apparently there may be same simple but more elegant ways.

Related

Download maven2 repository for offline use

We are developing offline due to limited internet resources and would like to run once every several months a whole grab of an external repository (e.g repo1.maven.org/maven2 - Disk space isn't an issue).
Today I'm using a simple POM that contains a lot of common dependencies that we are using, I've set my local maven to use a mirror to proxy thru a local nexus repository to cache locally and this is how I'm grabbing for offline use - but that isn't very effective.
I'm now looking for a command line tool that allow me to run searches on maven repositories so that I can write a script that grab them all to my local nexus installation and would like to hear if there is any or if there is another way to achieve that.
Thanks
Not a whole solution (yet) but I'm using httrack to grab the whole content of repo1.maven.org/maven2 - That is already better than nothing :)
In general, there is a goal in Maven dependency plugin called "go-offline"
So it allows to grab all the project dependencies and to store them in local .m2 repo.
You can find more information here.
If you want to run Maven and tell it to behave like the network does not exist you can run it with "-o" option (offline mode). So that if there is no dependency installed locally, Maven won't even try to go to network and bring it - but will fail the build.
On the opposite, if you want to force Maven to check and bring new versions (otherwise they already should be in your repo), you can use "-U" option.
I'm not really sure I've got the point about general search-and-download use case. Usually people install Nexus or Artifactory once in a network so that each dependency will be downloaded only once. In local development machines people usually just work with filesystem and don't maintain tools like this.
Now if you want to copy the whole repository from internet (for copying it later to some other network or something) you can just use crawlers like Apache Nutch for example or craft your own script that will recursively download all the files.

copying local source code to jenkins Workspace

I want to set up a small cucumber (maven) project in Jenkins in my company. The source code is local on my machine and not on any subversion system. I have already created a new job in jenkins. While configuring I am asked to give path to my pom.xml. But I dont know how do I give path.
Also I triggered Jenkins build without even configuring it properly, and therefore it has generated Workspace (Arbeitsbereich in german) for me. Now I think I just need to copy my source code to the created Workspace, but I dont know how do I do that exactly.
May be I am doing something really dumb here :( could someone please help ?
Jenkins default directory would be '~/.jenkins' where your jobs should be located. you can follow this link to use a custom directory as your work space.
After that, you can specify the path of your application pom.xml file relatively to your custom workspace location.

Use artifact outside of maven

Well, this is kind of embarrassing. I am in the process of mavenizing our build processes and just don't know how the access the result of a build. I build, let's say, a jar file and mvn deploy it. So it ends up as some blah-0.1.2.jar in our company maven repository, which is just a webdav share. Now how would you pass that on to someone else to use? Just pry it from target/blah-0.1.2.jar can't be the answer. I found several suggestions to use variants of mvn dependency:get but they were all just close and didn't feel right. There must be a way to use all those nice versions of blah-*.jar that end up in the repository for purposes other than a maven dependency. Preferably from the command line and maybe even without maven. Hm, a webdav client doesn't look too bad except for snapshots. What would you suggest?
Creating a script that makes a dependency:get call is probably going to be closest to your desired outcome. You can specify the destination of your downloaded jar this way.
If you are looking for an easy way to share builds between people in/outside of your company then you can look into setting up some automated build software like Bamboo or something similar. A new build gets triggered any time a commit is made to the section where your project resides in whatever version control system you use. An artifact is then made available for each successful build and are available via Bamboo's web interface. Bamboo can be configured to run with your maven pom's.
While they can bit a bit of pain to set up, going the automated build route will take a lot of the sting out of sharing your builds in the future.

Reloading JSP Changes in Eclipse/STS

I'm just getting into GAE and I'm using STS (derivative of Eclipse). I'm currently getting a project set up to use Spring and Apache Tiles under GAE. I've got it mostly configured properly and it seems to work. My biggest problem is figuring out how others handle day-to-day developing in this kind of environment.
I make tons of changes to the front-end JSPs but so far it seems like I have to stop the GAE server and restart it every time I make a small change to a JSP. Having to restart when I make changes to the controller is fine, but having to restart it for a simple JSP change is driving me crazy.
Is there a way to have the GAE environment reload JSP changes in Eclipse/STS?
I'm using Maven for AppEngine project, so whenever I build the project, there will be a project target directory generated/updated which is where the server will load the files from. When I tried to update my jsp/css/js files, I always open the file in that directory and update it there. Once I'm satisfied with the it, I will copy the changes to my source file.
Essentially, I think for you, you can find out where is your target directory, and try to edit your files from there.
I'm not sure if my workaround is suitable for you but maybe you can get one or two here.
Apart from that, there are people using JRebel which is a hotdeploy tool. There is a AppEngine version of JRebel there, but I suspect it is not free...
I'd suggest to take a look at JRebel. Even if it is commercial software, it will save you a lot of nerves for this kind of development
You need to set parameter:
server.jsp-servlet.init-parameters.development=true
(Put it into application.properties if you use spring boot)

Is there something similar to Maven Cargo but for AppAssembler?

I want to deploy a generated Maven AppAssembler assembler/ directory to somewhere in a file system, SSH, or whatnot. Can Cargo do that for me, or is there an equivalent deployment tool that will let me glob a bunch of files (in this case the target/appassembler/ directory) and deploy them to a destination?
I have a couple command-line applications that run as scheduled tasks (via cron or Windows Scheduler), and I want to deploy them out to these remote locations (in one case via SSH, and another a network share \\servername\C$\whatever\). I don't know how I can accomplish that, since all of the deployment plugins I have been looking at cater to web applications and app containers or Remote repos like Nexus.
Try maven copy plugin - it has excellent networking support (scp,FTP,HTTP).
You might also find useful maven sshexec plugin.
I know this question is quite old, but since someone else might also be interested in this:
I don't have a complete/concrete example for this, since I never tried it, but maybe the maven assembly plugin could be used for this, with the dir assembly format?

Resources