Sonarlint CLI: How to analyze multiple java files with sonarlint CLI - sonarlint

I have a large java code. I want to analyze selected java files with sonarline cli. For single file, it is working fine.
Single file:
sonarlint --src "src/com/abc/**/myjava1.java"
Now suppose I have two java files and want to analyze with sonarlint cli
Multiple file:
sonarlint --src "src/com/abc/**/myjava1.java, src/com/xyz/**/myjava2.java"
But this does not analyze any file.
Please suggest how to analyze two or more files / directories using sonarlint CLI

You can use "{,}" syntax for multiple files. For instance, try:
sonarlint --src "{src/com/abc/**/myjava1.java,src/com/xyz/**/myjava2.java}"

Related

appsetting.json and appsettings.Release.json files are not merging after ran the Azure DevOps CI pipeline for .Netcore3.1 project

I have .netcore 3.1 project and in that we have appsettings.json and appsettings.Release.json files for configurations based on the environment.
here is the launchSettings.json file,
I'm still able to see these two files in CI artifacts and not at all merging these two files after running the Azure DevOps CI pipeline for this project .
here is the CI artifacts,
we are using .Netcore 3.1 and I'm not sure why it is not working.
Could you please help me?
CI pipeline Azure devops not merge these three file into single file. this file merge when you publish you code.
appsettings.json , release.json and development.json this file merg when you publish you code. its not merg when you use CI pipeline.
More information read these Microsoft documents on json-variable file

Services and env in manifest file?

I have a web (online calculator for an example) which developed by my fellow tem members. Now they want to deploy in PCF using manifests.
Languages used : python, php and javascipt.
I gone through the docs about pcf with manifest.yml
In that I don't have any idea about services and env.
What is that services and how can I find the services for the above project and also how can I find the environment variables?
And tell whether these fields are mandatory to run the project in PCF.
To your original question:
What is that services and how can I find the services for the above project and also how can I find the environment variables? And tell whether these fields are mandatory to run the project in pcf.
Does your app require any services to run? Services would be things like a database or message queue. If it does not, then you do not need to specify any services in your manifest. They are optional.
Similarly, for environment variables, you would only need to set them if they are required to configure your application. Otherwise, just omit that section of your manifest.
At the end of the day, you should talk with whomever developed the application or read the documentation they produce as that's the only way to know what services or environment variables are required.
In regards to your additional questions:
1)And also I have one more query...like in our application we used python ok! In that we use lots of pacakages say pandas,numpy,scipy and so on...how can I import all the libraries into the PCF ??? Buildpacks will contain version only right?
Correct. The buildpack only includes Python itself. Your dependencies either need to be installed or vendored. To do this for Python, you need to include a requirements.txt file. The buildpack will see this and use pip to install your dependencies.
See the docs for the Python buildpack which explains this in more detail: https://docs.cloudfoundry.org/buildpacks/python/index.html#pushing_apps
2)And also tell me what will be the path for my app name if Java I can enclose jar files
For Java apps, you need to push compiled code. That means, you need to run something like mvn package or gradle assemble to build your executable JAR or WAR file. This should be a self contained file that has everything necessary to run your app, compile class files, config, and all dependent JARs.
You then run cf push -p path/to/my-app.jar (or WAR, whatever you build). The cf cli will take everything in the app and push it up to Cloud Foundry where the Java buildpack will install things like the JVM and possibly Tomcat so you app can run.
what should I do for application devloped using pyhton , JavaScript and php....
You can use multiple buildpacks. See the instructions here.
https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html
In short, you can have as many buildpacks as you want. The last buildpack in the list is special because that is the buildpack which will set the start command for your application (although you can override this with cf push -c if necessary). The non-final buildpacks will run and simply install dependencies.
3) we were using postgresql how can I use this in pcf with my app
Run cf marketplace and see if there are any Postgres providers in your Marketplace. If there is one, you can just do a cf create-service <provider> <plan> <service name> and the foundation will create a database for you to use. You would then run a cf bind-service <app> <service name> to bind the service you create to your app. This will generate credentials and pass them along to your app when it starts. You app can then read the credentials out of VCAP_SERVICES and use them to make connections to the database.
See here for more details:
https://docs.cloudfoundry.org/devguide/services/application-binding.html
https://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES

Azure Devops Build SSIS task

I have created an SSIS package using VS 2017 and added the project to Azure Devops. I am trying to setup a build task in Azure Devops using the SQL Integration Service add in. Everything I am doing is setup on my machine which includes the Agent Pool etc. When trying to setup parameters for the SSIS build the Devenv Version selection only gives me 12 and 14. VS2017 doesn't appear. As a result it appears that when I do a build the incorrect version on devenv is used and the build (even though it doesn't say its failed) fails.
The version the build is using is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.com but should be using C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE>Devenv.com
How do I get to DEVENV config parameter to include the Hosted VS2017 version?
The following web page gives an idea of what I am trying to achieve: -
http://chamindac.blogspot.com/2018/09/build-and-deploy-ssis-with-azure-devops.html
I ended up using a powershell script instead.
The script has one line to run the build.
&"${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com" "C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS.sln" /rebuild
I place the code in a .ps1 file and put it into the root of my repo. I then used the Powershell config to reference the file and it worked.
I did a similar thing for the deployment where I used : -
ISDeploymentWizard /S /SP:C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS\bin\Development\POC_SSIS.ispac /DS:serverName /DP:/SSISDB/POC_SSIS/POC_SSIS

Is there any command or way to find out the location of my JUnit?

i have a MacBook Pro and have downloaded java version 1.8 and selenium also. But im unable to find JUnit. Can i get the command to check the location of my JUnit. I have tried using a code to check whether JUnit is installed and the output is successful.
JUnit is not part of the standard JDK content; same for selenium.
Thus: you have to do something to pull the JUnit jar to your system. Either by downloading it manually yourself; or by using a build system like Maven or Gradle that can take care about resolving "dependencies" and downloading required artifacts automatically for you.
But in order to locate jar files on your system, you can simply turn to find command, like:
find / -type f -name "*.jar"
which should list you JAR files existing in your file system. You can read here about this and other tools that help you find files in your file system using the command line.

Store environment-specific OSGI Configurations for CQ

I'd like to store the Felix configurations we've made in SVN and have them applied to CQ in the packages produced by an automated build. To do this I have been following the instructions found in this CQ5 OSGI Configuration Document to create sling:OsgiConfig configuration nodes that get checked into SVN.
How can I store environment-specific configurations? For example, I want a different logging configuration for the DEV environment than the PROD environment will use. I would like to store the config for both environments in SVN ideally and have the environment pick which config to use somehow based on the environment.
How can I do that--or is there a different approach that I should be using for environment-specific configurations?
To have environment-specific configurations, you should use Run Modes in CQ5 - there is plenty of information here on how to achieve this_page
Hope this helps.