How to debug wso2 api manager code in idea - wso2-api-manager

I am trying to run API Manager 4.0.0 from source code, I download product-am and carbon-apimgt from github. How can i debug source code in idea or eclipse ?

First of all, you have to build the product. Follow these steps in order to build the product locally.
Make sure you have installed Java and Maven in your machine.
Download or clone carbon-apimgt repository from
https://github.com/wso2/carbon-apimgt.
Go to carbon-apimgt directory and run mvn clean install command in the terminal. (You can ignore unit tests by running mvn clean install -Dmaven.test.skip=true)
Copy the build version to the clipboard (ex:- 9.12.3-SNAPSHOT)
Download or clone product-apim from https://github.com/wso2/product-apim
Replace the value of carbon.apimgt.version in pom.xml file with the value you copied. (ex:- <carbon.apimgt.version>9.12.3-SNAPSHOT</carbon.apimgt.version>)
Go to product-apim directory and run mvn clean install command in the terminal. (You can ignore integration tests by running mvn clean install -Dmaven.test.skip=true which will save your time)
The built pack can be found in product-apim/modules/distribution/product/target directory.
After building the pack, extract the content in the zip file and run sh bin/api-manager.sh --debug 5005 command.
I recommend JetBrains Intellij IDEA to debug the code easily. So, open the carbon-apimgt project in IDEA. Then Add Configuration > Add new... > Remote JVM Debug > OK. After adding the configuration, you can click on the debug button and start debugging.

Related

How to use dotnet tool during Travis-CI build?

I'm trying to use dotnet-warp as a global tool in my .NET Core Travis-CI build, because I like the idea of a single executable so much better than a folder full of 75ish files.
I can successfully add the tool and verify there's a tools/dotnet folder in the $PATH...
But the log indicates that because .NET Core has been added recently, I'll need to restart or logout before I can actually use the tool.
Is anyone aware of a way to make this work in the Travis-CI environment?
Ran into the same issue, using the info from the Travis CI Installing Dependencies page and this comment on an issue about it, adding the following following to to my .travis.yml solved the problem:
before_script:
- export PATH=$PATH:/home/travis/.dotnet/tools
My build log:
$ export PATH=$PATH:/home/travis/.dotnet/tools
$ dotnet tool install -g dotnet-warp
You can invoke the tool using the following command: dotnet-warp
Tool 'dotnet-warp' (version '1.0.9') was successfully installed.
The command "dotnet tool install -g dotnet-warp" exited with 0.
$ cd ./src/[my project]/
The command "cd ./src/[my project]/" exited with 0.
$ dotnet-warp
Running Publish...
Running Pack...
Saved binary to "[my project]"
The command "dotnet-warp" exited with 0.

How to run the meteor project which git cloned from the Github in different OS

I've created a meteor project in my Windows system,then it be pushed to my Git repository.
Now I need to git clone to my Mac system and run it, but when I CD into the project folder and use "meteor" order in terminal line, It shows: "you need to creat APP ...", why? what should I do to run the project in my Mac system?
Many thanks~~~
Have you tried following the tutorial?
I think meteor create is what you need.

pom.xml no such file or directory

I've got a problem when I am building my project. I uses the springsource tools (STS) version 3.1.0 on Linux platform. After I imported my project to the STS, the springsource tools told me that "No such file or directory" at the pom.xml file. The file is actually exist in the correct path. I think the project is working fine because I've tried to import the same project with the same procedure in the other computer.
When I use console to compile the project with maven, all of them are complied successfully.
I've also tried the following but still not work:
1. reinstall the STS.
2. re-import the project.
3. create a user profile and re-import project.
4. use older version of STS (3.0.0)
I want to import the project to my computer so that I can work with.
Please suggest to resolve the problem. Thanks!
Had "No such file or directory" error on pom.xml in Eclipse Luna SR1.
Tracked it down to be caused by faulty resolution of other projects within the workspace by M2E.
So there are 2 solutions:
Either close the other project in the workspace (a dependency of the project in error).
Or disable workspace resolution by M2E on the project in error (right-click on the project, Maven --> Disable Workspace Resolution).
Obviously, if you need both projects open then option 2. is the way to go. The dependent project then takes the dependency from the local Maven repo, so to refresh it, you have to build and install the dependency into the local repo (mvn install).
I have the same issue. Still didn't find any smart solution, but this sometimes works for me:
Close eclipse
Go to console and do a maven clean install with update flag "mvn clean install -U"
Reboot the computer (logging out and back in didn't help)
Start eclipse and refresh and rebuild your projects

SBT - Unable to save file on Windows 7

I'm running a lift web app using sbt. After I run the following command - container:start and modify any css files and save them I get the message that "The file is opened in another program". I checked the process and SBT is keeping the file open. When I exit the SBT I'm able to save the file. I've no idea why this is happening. Am I missing out with any settings?
I used MSI installer from SBT download page to install SBT. I tried using different editors but same problem persist. Is there a problem with SBT?

Deploy SNAPSHOT artifact and sources to Nexus from Maven command line

I am trying to deploy one EXE file and it's zipped source file to Sonatype Nexus using maven command line. Files must be deployed as SNAPSHOTs.
So, I have 2 files:
-testXYZ.exe and source file
-testXYZ.zip
Using maven 2.2.1 and command described here:
mvn deploy:deploy-file -Durl=file:///home/me/m2-repo \
-DrepositoryId=some.repo.id \
-Dfile=./path/to/artifact-name-1.0.jar \
-DpomFile=./path/to/pom.xml \
-Dsources=./path/to/artifact-name-1.0-sources.jar \
-Djavadoc=./path/to/artifact-name-1.0-javadoc.jar
I can deploy EXE, but cannot deploy source, because maven 2.2.1 is using deploy-plugin v2.5 and this command is not supported until v2.7.
It is not allowed to me to use newer versions of maven, so I try different approach.
Using these two subsequent commands I can deploy these two artifacts, but, source cannot be downloaded from nexus.
call mvn deploy:deploy-file -DgroupId=com.xyz -DartifactId=testXYZ -Dversion=1.1.116-SNAPSHOT -Dpackaging=zip -Dfile=testXYZ.zip -Dclassifier=sources -Durl=http://build:8081/nexus/content/repositories/snapshots -DrepositoryId=nexus
call mvn deploy:deploy-file -DgroupId=com.xyz -DartifactId=testXYZ -Dversion=1.1.116-SNAPSHOT -Dpackaging=exe -Dfile=testXYZ.exe -Durl=http://build:8081/nexus/content/repositories/snapshots -DrepositoryId=nexus
After deploy, i search for testXYZ and click on artifact source download link.
Nexus says:
"Item not found on path
"com.xyz:testXYZ:1.1.116-SNAPSHOT:c=sources:e=jar"!"
Problem is the way maven upload these artifacts:
Line form log file while source is uploading:
Uploaded: http://build:8081/nexus/content/repositories/snapshots/com/xyz/testXYZ/1.1.116-SNAPSHOT/testXYZ-1.1.116-20120106.111705-1-sources.zip
Line form log file while Main artifact is uploading:
Uploaded: http://build:8081/nexus/content/repositories/snapshots/com/xyz/testXYZ/1.1.116-SNAPSHOT/testXYZ-1.1.116-20120106.111709-2.exe
Notice 111705-1 and 111705-2. Last number must be the same if we wish Nexus can generate correct links.
This approach is described here:
Deploying an artifact, its sources and javadoc using maven's deploy:deploy-file plugin
and here:
http://maven.apache.org/plugins/maven-install-plugin/examples/installing-secondary-artifacts.html
and it working for fixed versions(for example 1.1.116), but not for SNAPSHOTs.
Exe and Zip files can be deployed to Nexus (like jar files), if fixed version is used.
So, question is:
Is there a way to deploy artifact and source SNAPSHOTs from command line to Sonatype Nexus and to be sure that these files can be downloaded by clicking on sources and artifacts links?
Note:
If I disable timestamps suffix, this can work, but I do not want to do this.
-DuniqueVersion=false
Thanks,
Marjan
I found partial solution for this problem. I can call specific version of maven-deploy-plugin like this:
mvn org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file...
This way, artifacts and sources SNAPSHOTs can be deployed to Nexus avoiding any problems with download, but it behave like
-DuniqueVersion=false
is still there.

Resources