tag:blogger.com,1999:blog-1992444833303515722024-03-13T11:34:13.180-07:00EdooAll I wanna do =DAnonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-199244483330351572.post-59710945715390085182013-10-27T15:20:00.003-07:002013-10-27T15:20:39.694-07:00The best friend for Dev Team: Jenkins<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3o1P9VubBGRENNnNEERwfS2p-Vf0S3AbHyQGD5CKOiKHCNzSgJ7So52xnYl_SPddVoYvHlTyaFIN_n6OJe8GkO7G7OVsXyJdf_dPH6_BKP60WkybaUBXVT6mOhVHDp-EnsfVBPnqs5mYo/s1600/logo-jenkins.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="102" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3o1P9VubBGRENNnNEERwfS2p-Vf0S3AbHyQGD5CKOiKHCNzSgJ7So52xnYl_SPddVoYvHlTyaFIN_n6OJe8GkO7G7OVsXyJdf_dPH6_BKP60WkybaUBXVT6mOhVHDp-EnsfVBPnqs5mYo/s320/logo-jenkins.png" width="320" /></a></div>
<div style="text-align: center;">
(<a class="external-link" href="http://jenkins-ci.org/" rel="nofollow" style="background-color: white; color: #4b758b; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 17.328125px;">http://jenkins-ci.org/</a>)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Why I said that Jenkins is our best friend?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
First, Jenkins is a <a href="http://en.wikipedia.org/wiki/Continuous_integration">Continuous Integration</a> Server.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Jenkins is the team member who is the responsible and charge of to download the code from SCM, run test, build artifact, upload the artifacts in the repository manager (Nexus Repository, Archiva, Artifactory), run automation test and deploy.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As you can see Jenkins can do a lot of things for you, some of them I mentioned before even more things than that.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But, this is a just a tool. Your team need to develop some skills like write test, commit frequently and so on.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Also, you can install very useful plugins according your needs.</div>
<br />
<br />Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0tag:blogger.com,1999:blog-199244483330351572.post-30074571571033195652012-09-17T22:56:00.001-07:002012-09-17T22:56:58.348-07:00Working with Maven ProfilesImagine that you have the following structure in your project.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH0bXnDSe1TweP3lGKNgvEJnCA4oDGhmdcqsRkMRjB1Ncd1eA3nvwu1uDAQBKHCx5zzrkwFOtxnRS2ORmUIgaC0s4lf68JIQEAm1wZ7PqZjbHECIfiEkxdwXWDa1Frbtk8MeyJ6yJXpKe0/s1600/Captura+de+pantalla+2012-09-18+a+la%2528s%2529+00.33.31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH0bXnDSe1TweP3lGKNgvEJnCA4oDGhmdcqsRkMRjB1Ncd1eA3nvwu1uDAQBKHCx5zzrkwFOtxnRS2ORmUIgaC0s4lf68JIQEAm1wZ7PqZjbHECIfiEkxdwXWDa1Frbtk8MeyJ6yJXpKe0/s320/Captura+de+pantalla+2012-09-18+a+la%2528s%2529+00.33.31.png" width="306" /></a></div>
<br />
As you can see, I have config folder where I have two more folders <b>dev</b> and <b>prod.</b> Each one has two file with the same name but different values.<br />
<br />
<b><i>/config/dev/mail.properties</i></b><br />
<br />
<div class="p1">
<span class="s1">mail.server=</span>smtp.gmail.com</div>
<div class="p2">
mail.port=25</div>
<div class="p1">
<span class="s1">mail.from=abc@gmail.com</span></div>
<div class="p1">
<span class="s1">mail.to=</span>xyz@gmail.com</div>
<div class="p1">
<br /></div>
<br />
<b><i>/config/prod/mail.properties</i></b><br />
<br />
<div class="p1">
<span class="s1">mail.server=</span>smtp.mycompany.com</div>
<div class="p2">
mail.port=25</div>
<div class="p1">
<span class="s1">mail.from=emelendez@mycompany.com</span></div>
<div class="p1">
<span class="s1">mail.to=</span>emelendez@mycompany.com</div>
<div class="p1">
<br /></div>
<div class="p1">
Why do we do that?</div>
<div class="p1">
We have different environments and each one has his own configuration. Instead of re-write the file properties we can use profiles using maven. Configuration is attached bellow:</div>
<div class="p1">
<br /></div>
<br />
In your pom.xml file you need that:
<script src="https://gist.github.com/3741455.js"> </script>
If you want to build a new artifact using Dev profile you should run the following command:<br />
<b>mvn</b> -Pdev clean package -Dmaven.test.skip
Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0tag:blogger.com,1999:blog-199244483330351572.post-39503293525090113012012-09-17T21:46:00.003-07:002012-09-17T21:46:56.838-07:00Maven RepositoryNowadays, we are working in several project using Maven. But, sometimes we got problem looking for some artifacts that we want to use. For that reason, I'm going to share some repositories that I have got set up in my maven projects or Nexus Repository.<br/>
You can use the following code in your pom.xml<br />
<script src="https://gist.github.com/3741297.js"> </script>
<br />
NOTE: If you want to use in Nexus Repository or another Maven Repository, you will have to add each repository manually.Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0tag:blogger.com,1999:blog-199244483330351572.post-4651679744568590452012-06-09T20:45:00.000-07:002012-06-11T20:55:55.947-07:00Cloudbees PaaSSix months ago, I was looking for subversion server. I could have used Google code, but I had a problem with that, it is a public repository. So, I found <a href="http://www.cloudbees.com/">Cloudbees</a>.<br />
<br />
Cloudbees is a PaaS. What's Paas? Nowadays, we should know about <b>Platform as a Service. </b>But, it doesn't matter if you don't know it. We are for help us. Briefly, PaaS is a environment on cloud based on products from the providers. In this case, Cloudbees was built using Sonar, Jenkins, Subversion, Git, MySQL, Tomcat.<br />
<br />
What can I find on Cloudbees? You can find several products such as I have mentioned before, besides JFrog, SendGrid, AppDynamics, New Relic, Mongo HQ.<br />
<br />
I think that we can try it for demos and small project, maybe at university. Sometimes we need to application server, and using Cloudbees we can have source control management, database, application server, maven repository.<br />
<br />
We have to consider that Cloudbees provide a limit space, if you want more space you have to buy.<br />
Cloudbees, is a good service. And I hope you can use it.Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com1tag:blogger.com,1999:blog-199244483330351572.post-43577907188613713542012-06-09T19:57:00.001-07:002012-06-09T19:57:02.016-07:00Development EnvironmentIn this blog, I going to talk about some tools. Maybe, you has heard about those.<br />
<br />
Source Control Management (SCM)<br />
At the moment, we are several people that works with <a href="http://subversion.tigris.org/">Subversion</a> or <a href="http://git-scm.com/">Git</a>, both useful but perhaps one more popular than other.<br />
Using whatever, we can share our code with all the team, and we can work together. Also, is not necessary send files by email, because SCM is charge off the keep the last code, and if we make a mistake in the last code we can see all the historical code.<br />
<br />
Mercurial and CVS are also SCM.<br />
If we going to start with collaborative project and share our code, we can use Google Code or Github. I think that, both are goods products.<br />
<br />
<a href="http://maven.apache.org/">Maven</a><br />
Is a java tool. If we use maven we can manage our project's life cycle. we can use some commands for compile the code, create the artifact (jar, ear, war), run our test, upload the artifact to repository.<br />
<br />
Some commands:<br />
<br />
<script src="https://gist.github.com/2903593.js?file=maven.sh">
</script>
<br />
<br />
Besides, maven allow us run embedded server such as tomcat, jetty.<br />
Using maven, we can forget about search jars and their dependencies. Maven download the jar that we want to use and their dependencies too. That's awesome.<br />
<br />
<a href="http://www.sonatype.org/nexus/">Nexus</a><br />
Currently, we are working with maven projects. But, if we are big group and we are working in the same project. We can use Nexus Repository.<br />
Using that, we are allowed to create local repository for our projects and upload our artifacts (jar, ear, war). We can also create proxies repositories, i.e. for our project we need to use jboss libraries, but in the <a href="http://search.maven.org/#browse">Central Repository</a> we can't find this jar. We can add another repository, in this case: <a href="https://repository.jboss.org/nexus/content/repositories/releases/" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: verdana, sans-serif; font-size: x-small;" target="_blank">https://repository.jboss.org/<wbr></wbr>nexus/content/repositories/<wbr></wbr>releases/</a><br />
<br />
Here, others repositories:<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: xx-small;"><span style="font-family: verdana, sans-serif;"><a href="http://developer.ja-sig.org/maven2/" style="color: #1155cc;" target="_blank">http://developer.ja-sig.org/<wbr></wbr>maven2/</a></span></span><br />
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-size: xx-small;"><span style="font-family: verdana, sans-serif;"><a href="http://jasperreports.sourceforge.net/maven2/" style="color: #1155cc;" target="_blank">http://jasperreports.<wbr></wbr>sourceforge.net/maven2/</a></span></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-family: verdana, sans-serif; font-size: xx-small;"><a href="https://repository.jboss.org/nexus/content/repositories/releases/" style="color: #1155cc;" target="_blank">https://repository.jboss.org/<wbr></wbr>nexus/content/repositories/<wbr></wbr>releases/</a></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-family: verdana, sans-serif; font-size: xx-small;"><a href="http://repository.muleforge.org/release/" style="color: #1155cc;" target="_blank">http://repository.muleforge.<wbr></wbr>org/release/</a></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-family: verdana, sans-serif; font-size: xx-small;"><a href="http://nexus.openqa.org/content/repositories/releases/" style="color: #1155cc;" target="_blank">http://nexus.openqa.org/<wbr></wbr>content/repositories/releases/</a></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-family: verdana, sans-serif; font-size: xx-small;"><a href="http://repository.springsource.com/maven/bundles/release/" style="color: #1155cc;" target="_blank">http://repository.<wbr></wbr>springsource.com/maven/<wbr></wbr>bundles/release/</a></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<span style="font-family: verdana, sans-serif; font-size: xx-small;"><a href="http://mavensync.zkoss.org/maven2/" style="color: #1155cc;" target="_blank">http://mavensync.zkoss.org/<wbr></wbr>maven2/</a></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<br />
<a href="http://www.sonarsource.org/">Sonar</a><br />
Tool charge of keep measure about projects. Identify duplicate code, measure your code, measure complexity cyclomatic, identify bad practices and recommend how to solve. The last depend on the rule configured.<br />
<br />
In the following URL <a href="http://nemo.sonarsource.org/">http://nemo.sonarsource.org/</a> , you can see several open source projects.<br />
<br />
<a href="http://hudson-ci.org/">Hudson</a> or <a href="http://jenkins-ci.org/">Jenkins</a><br />
Is the most popular Continuous Integration (CI) server. Here, we can works with all tools that we have mentioned in this blog. We can download the maven project from the SCM and this will charge of looking for dependencies on Nexus Repository and update the last measures on Sonar server.<br />
<br />
We can automate several functions. CI server use jobs, could have one job for deploy on production environment, other for update measure on Sonar, the last maybe analyze our code each 1 hour.<br />
<br /></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
We can have this tools in our environment, but you shouldn't forget that we need practices and polices, in order to have a good control over the team and the projects.</div>Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0tag:blogger.com,1999:blog-199244483330351572.post-41223905625612556142012-06-09T17:37:00.001-07:002012-06-11T20:55:17.180-07:00Code Coverage with Sonar and Maven<div style="text-align: justify;">
Code coverage is a measure. This measure indicate us about the code that has been tested.
</div>
<div style="text-align: justify;">
Having 100% to code coverage, we can avoid risk while we change the code.
</div>
<div style="text-align: justify;">
What I need to analyze?
When I refer to analyze, I want to say that you need to do unit test and test all the scenarios that exist.
While you have high code coverage that's mean that you have more scenarios covered.
</div>
<div style="text-align: justify;">
Nowadays, we can use <a href="http://www.sonarsource.org/">Sonar</a> Analyzer Tool, it is a free tool.
</div>
<div style="text-align: justify;">
If you want to analyze your code and you use maven for your java projects. You only need to add this dependency:
</div>
<script src="https://gist.github.com/2903037.js?file=pom.xml">
</script>
<br />
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Finally, at root path you can use shell command.
<br />
<script src="https://gist.github.com/2903037.js?file=sonar.sh">
</script>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-kc81c6d0VIU/T9P6H3pL4DI/AAAAAAAAAU4/-Izya2tLXlE/s1600/1339292180634.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="284" src="http://1.bp.blogspot.com/-kc81c6d0VIU/T9P6H3pL4DI/AAAAAAAAAU4/-Izya2tLXlE/s320/1339292180634.png" width="320" /></a></div>
<br /></div>Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0tag:blogger.com,1999:blog-199244483330351572.post-4508975192344581162012-06-09T16:32:00.000-07:002012-06-09T17:40:22.136-07:00Gist by Github<div style="text-align: justify;">
I was looking for styles in order to put good style at my code in my blog.
</div>
<div style="text-align: justify;">
First, I tried with <a href="http://code.google.com/p/syntaxhighlighter/">SyntaxHighlighter</a>, it was useful in that moment but I needed to modify blog's source code. Fortunately, I found <a href="https://gist.github.com/">Gist</a>.
</div>
<div style="text-align: justify;">
Here, some example. I hope it will be useful.
</div>
<script src="https://gist.github.com/2903037.js?file=pom.xml">
</script>
<br />
<div style="text-align: justify;">
Note: You can use Gist using your GitHub account. But, if you haven't it, don't worry you can use it too.</div>Anonymoushttp://www.blogger.com/profile/03358728786418260523noreply@blogger.com0