Source Tree resolve conflicts with an external tool

2018-05-21 12_55_29-Sourcetree-blue - Internet Explorer

Source Tree supports multiple external tools to compare differences and resolve conflicts between files. By default you can choose any of this:

Source tree tools

But In this entry I’m going to show how to use it with Meld. 

Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects.

In linux systems it’s very useful and it’s my preffered tool (only when I can’t use diff and merge tools from my IDE).

How to configure

Got to main menú an select Tools > Options > Tab Diff  and into selection option External Diff  pick Custom and into field Difff Command set the path to your meld binary (I’m on windows and my case is Meld.exe), next into field Arguments set this:

\"$LOCAL\" \"$REMOTE\"

Now for Merge Tool, select the same binary (Meld.exe) and set this into filed Arguments:

 
--auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\" 

Now if you choose anyfile in your project you can check the diff selecting External Diff or CTRL+D over your file, and meld it’s executed:

extdifmeld

And it’s the same for files in conflict, select your file with the context menu Resolve conflicts > Launch External Merge Tool, now you can view side to side the differences between versions.

extmergemeld

And thats all, cheers

 

Anuncios

SAP PI Naming Convention

When I start on PI development I feeling very confused by the naming convention of their components, a couple years ago I was thinking if it is a best naming convention but I don’t found anything about it.

Talking to other consultants of PI/PO they are agree this naming is a responsibility of the organization standards, but in some times it’s not the best.

For example, when you implement a Java proxy if you naming convention it’s not clear the java code is very awful and I don’t like that. In the organization when I work this is very common mistake, because every release of new service interface has problems with the other develoment teams to integrate your systems, only by the naming convetion is too large or dificult to read.

I’ve been developing services interfaces around of five years and recently I found (in my opinion) the best naming convention for SAP PI/PO in this website.

The document is like a cheetshet and it’s very clear to read, definitely I recommend this.

If you has problems to access I leave a copy of the document here

Cheers

SAP PO mapping Sync SOAP to JDBC

Well, this time I would like to share this tip to create a service interface to retrieve data from Database with SAP PO/PI.

When you develop the message types to get SQL data you must to check the names and the structure of the Data Types, for example, this is a simple structure to do this query:

SELECT VC_PEDIMENTO, INVNUM, VC_PRC_FILE_FLG
FROM MYTABLE WHERE (INVNUM='4900005421')

For the request sender message type you can write your own structure with any label names:

2018-03-07 11_00_30-MM_ConsultarPedidos_ECC_to_DLX_req_ Display Message Mapping Seguir leyendo

Sonar Scanner inspect multi module java project (Mixed eclipse with maven style) from command line

Well, recently I was need to review legacy project to do meassuring the code quality java.

There are a project with multi module structure based on old eclipse syle mixed with maven structure, I have 3 modules (2 in eclipse and 1 in maven) all of them are used to build the final artifact and I needed to do code inspection with sonarqube.

For example:

\tmp\root
├───module1
├───module2
├───mvnmodule
    └───src

Fortunly sonar can manage this, let’s gets started.

Requirements

  • A sonarqube instance (version 6.6)
  • Sonar scanner tool (version 3.0.3)
  • Compiled classes for projects to analize

Steps

  1. Login into sonar instance and select your profile (at the top rigth corner) then click on My profile
  2. Create a new token on tab Security, write a name for the token and click on Generate and copy the token string, becareful but you won’t be able to see this string again.
  3. Conigure your sonar scanner, open the instalation folder (where you uncompress it) and edit the file conf/sonar-scanner.properties, add the host and login token string:
    #Configure here general information about the environment, such as SonarQube DB details for example
    #No information about specific project should appear here
    
    #----- Default SonarQube server
    sonar.host.url=http://localhost:9000
    
    #----- Default source code encoding
    sonar.sourceEncoding=UTF-8
    
    #----- Security (when 'sonar.forceAuthentication' is set to 'true')
    sonar.login=57e0bf00a0af633f5c0534fc72535c16f2f0fc3b
    
    
  4. Create a project configuration file into your source code folder, go to project folder and create a file named sonar-project.properties, set the properties to binaries (compiled classes) and the source code per module, previously you need it compile the project with their modules. I use eclipse to build each of them. The content of file is something like these:
    #Required project data fron sonar
    sonar.projectKey=com.abc:my-project
    sonar.projectName=abc-my-project
    sonar.projectVersion=1.0
    sonar.sourceEncoding=UTF-8
    
    #sonar.modules=PalacioHierro
    sonar.modules=module1,module2,mvnmodule
    
    sonar.java.source=1.7
    
    #Lib Dir (Opcional) ej: path/library.jar,path/to/classes/dir
    sonar.libraries=module2/lib
    
    # Project Language ( by default is Java)
    sonar.language=java
    
    # Properties can obviously be overriden for
    # each module - just prefix them with the module ID
    module1.sonar.projectName=my-project-m1
    module1.sonar.java.source=1.7
    module1.sonar.sources=src,WebContent
    module1.sonar.java.binaries=build/classes
    
    module2.sonar.projectName=my-projct-m2
    module2.sonar.java.source=1.7
    module2.sonar.sources=src
    module2.sonar.java.binaries=build/classes
    
    mvnmodule.sonar.projectName=mvn-webapp
    mvnmodule.sonar.java.source=1.7
    mvnmodule.sonar.sources=src/main/java,src/main/resources,src/main/webapp
    mvnmodule.sonar.java.binaries=target/classes
    
    sonar.skipDesign=true
    sonar.skipPackageDesign=true
    sonar.profile=my-profile
    
  5. Start the inspection, open an terminal and go to your root project folder and execute sonnar-scanner, this will start the code inspection (maybe take a long time, depend of  size of their projects) at the end you must see in the log something like this “ANALYSIS SUCCESSFUL, you can browse http://loaclhost:9000/dashboard/index/com.abc
  6. In the dashboard, on the code cactegory, you can see the result for the three modules.
    2018-01-25 19_06_14-Code - eph-tarjeta-palacio

That’s it.

Cheers!

Setup CI Server in Cloud for Java projects with code coverage and inspection

logos CI

Yep!  I was wating a long time to wirte about this topic, but finally I’m going to show  how to setup your own Continous Integration Server (aka CI) using cloud services, all of them with free accounts.

Only consider the scope of the functionality is very limited because all services we’re using are free, but if pay for it you can do much more.

I don’t going to explain what is or what are the feautres of the CI server, only I want to say the CI is a concept created by Martin Fowler in 2006 and like he’s mention in her website:

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.”

Well, let’s get started. We’re going to configure and integrate the next services, so you only need your Github or Bitbucket account.

The demo project

Seguir leyendo

SAP PI – Build and Deploy EAR on SAP NWDS

Create EAR application


  1. In NWDS create new project File > New project > Dynamic Web Project, and set project name SingleWebApp and check option Add project to an EAR then select button New….
  2. In ear dialog window set project ear name SingleAppEAR leave default options and select Finish.
  3. In the first dialog, into the field EAR project name the ear application name is selected, now click on Finish. 2016-05-07 11_38_22-New Dynamic Web Project Seguir leyendo