WSO2 pizzashack does not build (maven dependency) - wso2

I have downloaded the last version of WSO2 API manager and try to run the tutorial.
When trying to build the PizzaShack sample with maven, I get this error
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/httpcomponents/wso2/httpclient/4.1.1-wso2v1/httpclient-4.1.1-wso2v1.pom
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal on project pizza-shack-web: Could not resolve dependencies for project com.pizzashack.client.web:pizza-shack-web:war:1.0.0:
Failed to collect dependencies at org.apache.httpcomponents.wso2:httpclient:jar:4.1.1-wso2v1:
Failed to read artifact descriptor for org.apache.httpcomponents.wso2:httpclient:jar:4.1.1-wso2v1: Could not transfer artifact org.apache.httpcomponents.wso2:httpclient:pom:4.1.1-wso2v1 from/to wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/): maven.wso2.org: Unknown host maven.wso2.org -> [Help 1]

Error says Unknown host maven.wso2.org
Make sure your computer has access to maven.wso2.org

Related

Build C++ project with Bazel offline (without internet connection)

I try to build the Bazel C++ Build Tutorial from the Bazel homepage (Getting Started) with this command but without any connection to the internet: bazel build //main:hello-world
The Jenkins Server will not have any connection to the internet so I can't do prefetching or similar. Is there a way how to prepare my C++ project on another computer and transfer the dependencies to the Jenkins Server to do it offline? How? I would just need what I got from the following error message respectively get the tutorial running:
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Repository rules_cc instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:267:6: in <toplevel>
C:/users/XXX/_bazel_XXX/dq2p42jq/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe
Repository rule http_archive defined at:
C:/users/XXX/_bazel_XXX/dq2p42jq/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip failed: class java.io.IOException Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
WARNING: Download from https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip failed: class java.io.IOException Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
ERROR: An error occurred during the fetch of repository 'rules_cc':
Traceback (most recent call last):
File "C:/users/XXX/_bazel_XXX/dq2p42jq/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip, https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip] to C:/users/XXX/_bazel_XXX/dq2p42jq/external/rules_cc/temp1363696983472254851/b1c40e1de81913a3c40e5948f78719c28152486d.zip: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
ERROR: Error fetching repository: Traceback (most recent call last):
File "C:/users/XXX/_bazel_XXX/dq2p42jq/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip, https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip] to C:/users/XXX/_bazel_XXX/dq2p42jq/external/rules_cc/temp1363696983472254851/b1c40e1de81913a3c40e5948f78719c28152486d.zip: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
ERROR: Skipping '//main:hello-world': no such package '#rules_cc//cc': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip, https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip] to C:/users/XXX/_bazel_XXX/dq2p42jq/external/rules_cc/temp1363696983472254851/b1c40e1de81913a3c40e5948f78719c28152486d.zip: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
WARNING: Target pattern parsing failed.
ERROR: no such package '#rules_cc//cc': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip, https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip] to C:/users/XXX/_bazel_XXX/dq2p42jq/external/rules_cc/temp1363696983472254851/b1c40e1de81913a3c40e5948f78719c28152486d.zip: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 501 Not Implemented"
INFO: Elapsed time: 30.974s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
currently loading: main
Update:
I tried prefetching and it doesn't work. What I did:
run bazel fetch //...
Copy the prefetched data from bazel info output_base directory from local to jenkins server (I had to recreate one sym link to the install dir).
I run bazel build --fetch=false //main:hello-world on jenkins without refatching. Now I get following error:
Loading:
Loading: 0 packages loaded
WARNING: /DEFAULT.WORKSPACE:1:17: External repository 'bazel_tools' is not up-to-date and fetching is disabled. To update, run the build without the '--nofetch' command line option.
ERROR: error loading package '': Every .bzl file must have a corresponding package, but '#bazel_tools//tools/build_defs/repo:http.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.
INFO: Elapsed time: 0.298s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
I found one solution for offline building a simple C++ projects with bazel.
First you have to download the rules_cc and rules_java libs, because these where the external dependent libs in the simple Bazel C++ tutorial project. I found no release for rules_cc so I downloaded the zip file from the url which was mentioned in the error message on the console when I was trying to use bazel build offline: https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip. The sha key was also mentioned in the error message when you try to use the lib locally with a wrong sha key (see below). The rules_java lib can be downloaded here: https://github.com/bazelbuild/rules_java/releases. The WORKSPACE specification is also mentioned there.
Then you have to add the following to your WORKSPACE file. Be aware, that you have to point to your local copy of the archive files for rules_cc and rules_java. And for rules_cc you have to mention in strip_prefix the root path of the archive file (the first and only root directory in the .zip file). The rules_java has no root directory:
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_cc",
urls = ["file:C:/tmp/b1c40e1de81913a3c40e5948f78719c28152486d.zip"],
strip_prefix = "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d",
sha256 = "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd",
)
http_archive(
name = "rules_java",
url = "file:C:/tmp/rules_java-4.0.0.tar.gz",
sha256 = "34b41ec683e67253043ab1a3d1e8b7c61e4e8edefbcad485381328c934d072fe",
)
You can run bazel fetch //... to fetch data locally on the machine, which has access to the internet. Then you can just copy prefetched data: from bazel info output_base directory on your local PC to bazel info output_base in the jenkins job.

jacocoagent.jar starts up fails: agent library failed to init: instrument

recently I'm learning jacocoagent,
I used the following command to start my project,
```nohup java -javaagent:/root/qa_charlyne/jacocoagent.jar=includes=*,output=file,destfile=/root/qa_charlyne/jacoco.exec -jar diff-code-coverage.jar > difflog.txt 2>&1```
but i failed to start up jacocoagent.jar:
Failed to find Premain-Class manifest attribute in /root/qa_charlyne/org.jacoco.agent-0.8.5.jar
Error occurred during initialization of VM
agent library failed to init: instrument
i don't know why ,i need help
The jacoco jar file without classifier from maven repo (ex. org.jacoco.agent-0.8.5.jar) is not the one that should be used as an agent.
Instead use the one with "runtime" classifier (ex. org.jacoco.agent-0.8.5-runtime.jar).
Link to central maven repo: https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.5/

Jenkins - What is consoleFull?

I have a problem for building using Jenkins.
When I uploaded a patch code, build FAILED with this error.
jenkins 3:51 PM
Patch Set 1:
[FAILED] Ant Build -> http://jenkins.lge.com:8086/jenkins/job/AgentApp/1329/consoleFull
What the consoleFull means?
It's just a link - where you can find full console output (logs). Just open http://jenkins.lge.com:8086/jenkins/job/AgentApp/1329/consoleFull -> and check the errors.

how to build wso2 from platform directory

I download code from github, and try to run "mvn compile" from platform, then I got following error:
D:\wso2\platform-master>mvn compile
Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-dependents:4.2.0-SNAPSHOT (D:\wso2\platform-master\dependencies\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\dependencies\commons\charon\2.0.0-SNAPSHOT of D:\wso2\platform-master\dependencies\pom.xml does not e
xist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-components:4.2.0-SNAPSHOT (D:\wso2\platform-master\components\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\components\jaggery of D:\wso2\platform-master\components\pom.xml does not exist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-features:4.2.0-SNAPSHOT (D:\wso2\platform-master\features\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\features\jaggery\features of D:\wso2\platform-master\features\pom.xml does not exist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-products:4.2.0-SNAPSHOT (D:\wso2\platform-master\products\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\products\integration\security-verifier of D:\wso2\platform-master\products\pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
When you say, you downloaded code from GitHub, I guess you cloned https://github.com/wso2/platform
WSO2 currently uses SVN as the main source repository and therefore I recommend you to use the SVN repository. Following has the current WSO2 Carbon code.
https://svn.wso2.org/repos/wso2/carbon/
Before checking out the code, please make sure you understand how the SVN repository is structured.
There are many resources on the web about building WSO2 Carbon from source. Please search on the web. Here is my answer given to a similar question about building from source.
FYI: WSO2 just released Carbon 4.2.0 and therefore we currently use the 4.2.0 branches.
https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0
https://svn.wso2.org/repos/wso2/carbon/orbit/branches/4.2.0
https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.2.0

wso2 governance registry build fail

i'm trying to build wso2 governance registry by src files with maven 3, but after many retries i'm stuck too.
I had dowload all required libraries, and fixed all duplicate child in pom files, but whem i'm trying to build i obtain this error.
"[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.
2-beta-5:attached (dist) on project axis2-kernel: Failed to create assembly: Err
or creating assembly archive docs: You must set at least one file. -> [Help 1]
[ERROR]"
and previously
"[FATAL] Non-readable POM C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml: C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml (Impossibile trovare il file specificato) #
for project at C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml for project at C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml"
I'm trying to build with maven 2 but, even if console output message shows "BUILD SUCCEFFULL" i can found bin folder and relative wso2server.bat file.
Anyone can help me?
Please clone below repos and run an mvn clean install -e on each and everyone accordingly.
https://github.com/wso2/carbon4-kernel.git
https://github.com/wso2/carbon-registry.git
https://github.com/wso2/carbon-governance.git
https://github.com/wso2/carbon-governance-extensions.git
https://github.com/wso2/carbon-store
Then build G-Reg from the source!
Note: Current G-Reg developer snapshot :https://github.com/wso2/product-greg.git