Go Glide Error "The system cannot find the path specified" - go

I am trying to manage my Go project with glide.
I executed glide update, but got The system cannot find the path specified error as below.
C:\path\to\myproject\src>glide update
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching google.golang.org/appengine.
[INFO] --> Fetching cloud.google.com/go.
[INFO] --> Fetching golang.org/x/net.
[INFO] --> Fetching github.com/gin-gonic/gin.
[INFO] --> Fetching google.golang.org/api.
[INFO] --> Fetching golang.org/x/oauth2.
[INFO] --> Detected semantic version. Setting version for github.com/gin-gonic/gin to v1.1.4.
[INFO] --> Detected semantic version. Setting version for google.golang.org/appengine to v1.0.0.
[INFO] --> Detected semantic version. Setting version for cloud.google.com/go to v0.7.0.
[INFO] Resolving imports
[INFO] Found Godeps.json file in C:\Users\myhome\.glide\cache\src\https-github.com-gin-gonic-gin
[INFO] --> Parsing Godeps metadata...
[INFO] --> Fetching github.com/manucorporat/sse.
[INFO] --> Setting version for github.com/manucorporat/sse to ee05b128a739a0fb76c7ebd3ae4810c1de808d6d.
[INFO] --> Fetching github.com/mattn/go-isatty.
[INFO] --> Setting version for golang.org/x/net to f315505cf3349909cdf013ea56690da34e96a451.
[INFO] --> Fetching github.com/golang/protobuf.
[INFO] --> Setting version for github.com/golang/protobuf to 2402d76f3d41f928c7902a765dfc872356dd3aad.
[INFO] --> Fetching github.com/googleapis/gax-go.
[INFO] --> Fetching gopkg.in/go-playground/validator.v8.
[INFO] --> Setting version for gopkg.in/go-playground/validator.v8 to c193cecd124b5cc722d7ee5538e945bdb3348435.
[INFO] --> Fetching gopkg.in/yaml.v2.
[INFO] --> Fetching golang.org/x/sys.
[INFO] --> Fetching google.golang.org/grpc.
[INFO] --> Fetching google.golang.org/genproto.
[ERROR] Error scanning github.com\golang\protobuf\ptypes\any: open C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes\any: The system cannot find the path specified.
[ERROR] Failed to retrieve a list of dependencies: Error resolving imports
Actually there is not C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes directory, but I can not understand why this directory is missed.
My glide.yaml is as follows.
package: .
import:
- package: cloud.google.com/go
version: ^0.7.0
subpackages:
- bigquery
- civil
- package: github.com/gin-gonic/gin
version: ^1.1.4
- package: golang.org/x/net
subpackages:
- context
- package: golang.org/x/oauth2
subpackages:
- google
- package: google.golang.org/api
subpackages:
- iterator
- package: google.golang.org/appengine
version: ^1.0.0
subpackages:
- datastore
- log
- memcache
- remote_api
How can I fix?

I found the github.com/golang/protobuf version 2402d76f3d41f928c7902a765dfc872356dd3aad which github.com/gin-gonic/gin wants does not has ptype. I added below lines to glide.yaml.
- package: github.com/golang/protobuf
version: b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3
b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3 is the current newest commit.
The error has gone. But I am not sure this is the straightforward way because I still have the warning below.
[WARN] Conflict: github.com/golang/protobuf rev is currently b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3, but github.com/gin-gonic/gin wants 2402d76f3d41f928c7902a765dfc872356dd3aad
If another way is desirable, please advise me.

Related

Build with frontend-maven-plugin fails on mac M1: Could not download Node.js

The frontend-maven-plugin tries to download a node file which does not exist.
When I look into https://nodejs.org/dist/v10.15.3 I can only see a file named node-v10.15.3-darwin-x64.tar.gz
[INFO] --- frontend-maven-plugin:1.7.5:install-node-and-npm (install node and npm) # oauth-ui-authorization-code-angular-zuul ---
[INFO] Installing node version v10.15.3
[INFO] Downloading https://nodejs.org/dist/v10.15.3/node-v10.15.3-darwin-arm64.tar.gz to /Users/me/.m2/repository/com/github/eirslett/node/10.15.3/node-10.15.3-darwin-arm64.tar.gz
[INFO] No proxies configured
[INFO] No proxy was configured, downloading directly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] mymodule 2.2.6.RELEASE FAILURE [ 4.536 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.930 s
[INFO] Finished at: 2022-09-28T14:28:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.5:install-node-and-npm (install node and npm) on project mymodule: Could not download Node.js: Got error code 404 from the server. -> [Help 1]
[ERROR]
This is a bug in the frontend-maven-plugin.
An upgrade to the current version should help:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
...
Thanks to:
https://github.com/apache/druid/issues/10804
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/m1-mac-cant-build-wknd-tutorial-get-quot-could-not-download-node/m-p/399462

Maven - Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (1-pre-dist) on project

I'm using wso2 emm 2.2.0 Beta, Please refer the below error console. when I run the maven install I got maven assembly plugin issue.
So please let me know why it occurs? and give some suggestion to fix this problem.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WSO2 Mobile Device Manager (MDM) - Distribution 2.2.0-BETA2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- incremental-build-plugin:1.3:incremental-build (default) # wso2emm ---
[INFO] Verifying module descriptor ...
[INFO] Verifying parent modules...
[INFO] Verifying resources...
[INFO] Resources directory does not exist : /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution/src/main/resources
[INFO] Verifying sources...
[INFO] No sources to check ...
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # wso2emm ---
[INFO] Storing buildNumber: 27 Oct 2016 at timestamp: 1477554746130
[WARNING] Cannot get the branch information from the git repository:
Detecting the current branch failed: fatal: Not a git repository (or any of the parent directories): .git
[INFO] Executing: /bin/sh -c cd /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution && git rev-parse --verify HEAD
[INFO] Working directory: /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) # wso2emm ---
[INFO]
[INFO] --- maven-assembly-plugin:2.4:single (1-pre-dist) # wso2emm ---
[INFO] Reading assembly descriptor: /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution/src/assembly/dist.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.203s
[INFO] Finished at: Thu Oct 27 13:22:26 IST 2016
[INFO] Final Memory: 13M/188M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (1-pre-dist) on project wso2emm: Failed to create assembly: Error creating assembly archive dist: You must set at least one file.
If you want to build WSO2 EMM 2.2.0 Beta follows the below steps.
Clone the product-emm repo
git clone https://github.com/wso2/product-emm.git
Checkout the v2.2.0-BETA tag.
git checkout v2.2.0-BETA
Build from root pom. Go to project root folder and issue
mvn clean install
If you want just product zip you can build the distribution module for that go to project root -> modules ->distribution folder and issue mvn clean install from there. you can find the build zip file in distribution/target folder.
It seems like you are in master branch. The failing maven goal for you added after the emm beta tag creation. The reason for failing is, in build time it tries to connect to some resources in internet and your computer failed to connect to that resources on internet. If you really want to build the master branch (2.2.0-SNAPSHOT), just check your internet connection or firewall blockings.

Error resolving Resolving org.apache#apache;4

I'm running Spark Notebook and struggling with dependancies. The server runs in an Amazon VPC, so has no direct Internet access.
In order to load dependancies, created a repo in an S3 bucket and this works fine, getting all the POM's and JAR's until it gets to
Installing the s3:// URLStreamHandler via
java.net.URL.setURLStreamHandlerFactory
Creating a new Ivy URLHandlerDispatcher to handle s3:// URLs
[info] :: resolving dependencies :: org.scala-lang#scala;2.10.4
[info] confs: [compile, test, runtime]
[info] Resolving default#ffx-analytics_2.10;1.1 ...
[info] found default#ffx-analytics_2.10;1.1 in s3-repo
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[info] found org.scala-lang#scala-library;2.10.4 in s3-repo
[info] [2.10.4] org.scala-lang#scala-library;2.10.4
[info] Resolving com.github.nscala-time#nscala-time_2.10;1.4.0 ...
[info] found com.github.nscala-time#nscala-time_2.10;1.4.0 in s3-repo
[info] Resolving joda-time#joda-time;2.4 ...
[info] found joda-time#joda-time;2.4 in s3-repo
[info] Resolving org.joda#joda-convert;1.2 ...
[info] found org.joda#joda-convert;1.2 in s3-repo
[info] Resolving ua_parser#ua-parser;1.3.1-SNAPSHOT ...
[info] found ua_parser#ua-parser;1.3.1-SNAPSHOT in s3-repo
[info] Resolving org.yaml#snakeyaml;1.10 ...
[info] found org.yaml#snakeyaml;1.10 in s3-repo
[info] Resolving commons-collections#commons-collections;3.2.1 ...
[info] Resolving org.apache.commons#commons-parent;9 ...
[info] Resolving org.apache#apache;4 ...
[error] Server access Error: Connection timed out url=https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.jar
So I tried to download the JAR from another server (with internet access) like so:
ubuntu#ip-10-126-49-161:~$ wget https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.jar
--2015-09-07 00:37:42-- https://repo1.maven.org/maven2/org/apache/apache/4/apache-4.jar
Connecting to 172.16.100.11:8080... connected.
Proxy request sent, awaiting response... 404 Not Found
2015-09-07 00:37:45 ERROR 404: Not Found.
I cant find an apache-4.jar anywhere. Looking at the POM there is no JAR for it.
Any tips would be appreciated.
UPDATE #1:
I tried importing another JAR that lead down a similar path:
[info] Resolving net.sf.opencsv#opencsv;2.0 ...
[info] found net.sf.opencsv#opencsv;2.0 in s3-repo
[info] Resolving commons-codec#commons-codec;1.10 ...
[info] Resolving org.apache.commons#commons-parent;35 ...
[info] Resolving org.apache#apache;15 ...
When I look at the POM for Apache 35, it lists Apache 15 as a parent.
These parents appear to be a real nightmare. Hopefully it is just something simple I need to switch on to make this all work.
I found the answer here:
https://theholyjava.wordpress.com/2011/01/26/using-ivy-with-pom-xml/
"Ivy ignores the packaging=pom on the parent module and will always try to find a .jar for it, thus wasting precious time. The workaround is to create a fake, empty .jar, for example via echo “” > emptyJarToSatisfyIvy.jar."

Maven - Reactors (Aggregation)

I have a maven project with a following directory structure:
trunk
| pom.xml
| coreutils
| | pom.xml
| | src
| budgetCap
| | pom.xml
| | src
The content of trunk/pom.xml is :
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
hxttp://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Ant2Maven</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Parent Pom</name>
<modules>
<module>coreutils</module>
<module>budgetCap</module>
</modules>
In this structure, "budgetCap" is dependent on "coreutils",i.e. pom.xml of "budgetCap" contains a dependency of "coreutils"
Now I have two methods to build this project
First Method
Aggregation using Reactor
I will be inside trunk
So first of all I do mvn clean
shakim:trunk shakim.md$ mvn clean
Maven deletes the target folder of the two module in this order:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] coreutils
[INFO] budgetCap Maven Webapp
[INFO] Parent Pom
Now when i do mvn install
shakim:trunk shakim.md$ mvn install
Maven starts building modules in the following order:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] coreutils
[INFO] budgetCap Maven Webapp
[INFO] Parent Pom
In the given order, coreutils gets installed in the local repository successfully.
But budgetCap fails at the compilation giving an error that maven is unable to locate a class which was supposed to be produced by coreutils
the error message is as follows:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building budgetCap Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # budgetCap ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # budgetCap ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING]/Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java: /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java uses unchecked or unsafe operations.
[WARNING]/Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/SingletonAggregator.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/core/BudgetCapServer.java:[41,34] package com.adiquity.request.utils does not exist
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/utils/Utils.java:[9,34] package com.adiquity.request.utils does not exist
[ERROR] /Users/shakim.md/shakim/maven/ops/adq_services/trunk/budgetCap/src/main/java/com/adiquity/budgetCap/log/data/parser/ConversionParser.java:[16,34] package com.adiquity.request.utils does not exist
Briefly speaking this package package com.adiquity.request.utils is actually present in coreutils, which this module budgetCap must have located successfully, but it is not.
Second Method
Go inside coreutils and do a
shakim:coreutils shakim.md$ mvn clean install
Go inside budgetCap and do a
shakim:budgetCap shakim.md$ mvn clean install
budgetCap compiles successfully without reporting any kind of error.
My question is that I want to use Reactors in Maven and I am unable to figure out why the build fails on using 1st method whereas 2nd method of building completes smoothly??
I am not sure how to use reactors, do we need to include anything in pom of coreutils and budgetCap signifying that pom of trunk is the parent.
Note: I don't want to use inheritance in this project

Chinese character encoding issues - Heroku

I have a small JRuby Sinatra app that uses the Jieba for JRuby gem to tokenize a Chinese sentence.
When running the app on my local machine I do not have any encoding issues:
curl --data "text=Ruby China,对!经是国内最权威的 Ruby 社区,拥有国内所有资深的 Ruby 工程师。&key=myKey" http://localhost:9292
# => ["Ruby", "China", "经是", "国内", "权威", "社区", "拥有", "所有", "资深", "工程师"]
However, when I push the app to Heroku, I am having encoding issues:
curl --data "text=Ruby China,对!经是国内最权威的 Ruby 社区,拥有国内所有资深的 Ruby 工程师。&key=XWtrws324FGH675BV" http://secure-wildwood-3084.herokuapp.com
# => ["\"Ruby\", \"China\", \" \", \" 。\""]
I've tried to force the encoding to UTF-8 .force_encoding("utf-8") but still have the issue. I have also tried setting the LANG config variable on Heroku to LANG: zh_CN.UTF-8 but that does not make a difference.
The method I use to deploy the app is in the README. This is the output when pushing the app to Heroku:
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 292 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Java app detected
-----> Installing OpenJDK 1.6... done
-----> executing /app/tmp/cache/.maven/bin/mvn -B -Duser.home=/tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf -Dmaven.repo.local=/app/tmp/cache/.m2/repository -DskipTests=true clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sinatra-jruby-heroku 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # jruby-heroku ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # jruby-heroku ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/src/main/resources
[INFO]
[INFO] --- jruby-rake-plugin:1.6.7:jruby (install-bundler) # jruby-heroku ---
[INFO] Successfully installed bundler-1.7.3
[INFO] 1 gem installed
[INFO]
[INFO] --- jruby-rake-plugin:1.6.7:jruby (bundle-install) # jruby-heroku ---
[WARNING] JRuby limited openssl loaded. http://jruby.org/openssl
[WARNING] gem install jruby-openssl for full support.
[INFO] Fetching gem metadata from http://rubygems.org/..........
[INFO] Rubygems 1.8.15 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.0.7 or higher to enable parallel gem installation.
[INFO] Installing jieba-jruby 0.0.1
[INFO] Installing jruby-rack 1.1.4
[INFO] Installing json 1.8.0
[INFO] Installing rack 1.4.1
[INFO] Installing rack-protection 1.2.0
[INFO] Installing tilt 1.3.3
[INFO] Installing sinatra 1.3.2
[INFO] Installing trinidad_jars 1.0.2
[INFO] Installing trinidad 1.3.4
[INFO] Using bundler 1.7.3
[INFO] Your bundle is complete!
[INFO] Gems in the groups development and test were not installed.
[INFO] It was installed into ./vendor/bundle
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # jruby-heroku ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # jruby-heroku ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # jruby-heroku ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # jruby-heroku ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # jruby-heroku ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/target/jruby-heroku-1.0.jar
[INFO]
[INFO] --- maven-dependency-plugin:2.3:copy (default) # jruby-heroku ---
[INFO] Configured Artifact: org.jruby:jruby-complete:1.6.7:jar
[INFO] Copying jruby-complete-1.6.7.jar to /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/target/dependency/jruby-complete.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # jruby-heroku ---
[INFO] Installing /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/target/jruby-heroku-1.0.jar to /app/tmp/cache/.m2/repository/br/com/tomasmuller/jruby-heroku/1.0/jruby-heroku-1.0.jar
[INFO] Installing /tmp/build_bfb3b1dc-701f-4558-8560-9617ff535adf/pom.xml to /app/tmp/cache/.m2/repository/br/com/tomasmuller/jruby-heroku/1.0/jruby-heroku-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.742 s
[INFO] Finished at: 2014-10-17T22:39:20+00:00
[INFO] Final Memory: 11M/513M
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> console, jruby, rake, web
-----> Compressing... done, 72.2MB
-----> Launching... done, v20
http://secure-wildwood-3084.herokuapp.com/ deployed to Heroku
To git#heroku.com:secure-wildwood-3084.git
504ab7d..2f4b7c0 master -> master
looking at the output/project it seems to be using fairly old JRuby bits and pieces, in this case what matters most is the JRuby version (you probably do have a different one locally): 1.6.7 https://github.com/diasks2/jieba-heroku/blob/master/pom.xml#L14
I would bring that to JRuby 1.7.16 and bundle update others from the following output as well :
[INFO] Installing jruby-rack 1.1.4
[INFO] Installing json 1.8.0
[INFO] Installing rack 1.4.1
[INFO] Installing rack-protection 1.2.0
[INFO] Installing tilt 1.3.3
[INFO] Installing sinatra 1.3.2
[INFO] Installing trinidad_jars 1.0.2
[INFO] Installing trinidad 1.3.4

Resources