I am trying to use gRPC proto file to generate stub code for inter-service communication. Everything is okay and when I run mvn clean install, it installs everything and builds successfully.
But still now protos files are in red color and can’t go definition when I click to go to it’s definition. It says me Cannot find declaration to go. When build is successful then why it is not possible to find declaration in IntelliJ IDEA?
I clean every cached on IDE and indexing is also successful. I also cleared m2 cache.
Is there anything to find this solution so that I can go to proto class definition?
Any help will be appreciated.
Thanks.
Your IntelliJ IDEA needs to generate Project setup. So you need to execute the main plugin goal, which is idea:idea.
Use this command. It will helped me.
mvn -U idea:idea
Here
-U = Forces a check for missing releases and updated snapshots on remote repositories
Related
The solution which needs bootstrapping is supplied as java code. Absolutely sure that this is necessary.
Receivers of the solution are guaranteed to have a suitable JDK
However, receivers of the solution are unable to install Maven (they don't know how to and cannot be taught)
My idea is to include some sort of Maven with the project, such that can be set up in a script like so:
set up maven repo as a folder under the solution folder (using relative reference)
set up anything else maven needs (don't know what, exactly)
call /path/to/maven/mvn compile -f /path/to/oneAndOnly/pom.xml
java /target/MySolutionClas
I am aware of: https://dzone.com/articles/embedding-maven but it gets confusing when he talks about configuring the portable maven into the pom.xml - wait, how is that pom.xml going to mean anything if maven is not configured yet?
(PS: I mean no disrespect to the author. I probably got it all wrong)
One could include a shell script that would setup maven if it is not already present.
The same for building and packaging encapsulating the complexities of the setup to just runing a couple of scripts.
Maven Wrapper aims to do just that, similar to the gradle wrapper seen in many gradle projects.
Running the wrapper goal of the maven wrapper plugin will generate a mvnw script in your project that can be run in place of a globally installed mvn command.
It's part of the maven 3.7.0 release, and documented more fully here: https://maven.apache.org/plugins/maven-wrapper-plugin/index.html
See https://github.com/takari/maven-wrapper for maven < 3.7.0
I try to avoid asking questions that won't help many other people, but I've been at this for far too long to not ask for help. I'm trying to use this clojure wrapper for a java package as a dependency in my project, but I'm hitting a lot of errors because there's no project.clj.
I've tried using the lein-git-deps plugin with the following keys in my project.clj:
:plugins [[lein-git-deps "0.0.1-SNAPSHOT"]]
:git-dependencies [["https://github.com/lunkdjedi/clj-ta-lib"]]
Running $ lein git-deps gives me the following:
Setting up dependency for [https://github.com/lunkdjedi/clj-ta-lib]
Running git pull on .lein-git-deps
Running git checkout master in .lein-git-deps
but nothing changes in my local directory, except now there's an empty .lein-git-deps/ dir. I'm assuming this didn't work because of the missing project.clj.
I've been able to clone the project and call $ mvn package clojure:repl which successfully compiled and opened a REPL instance, in which I could use the wrapper perfectly. When I run $ lein install it gives me:
Couldn't find project.clj, which is needed for install
but when I run $ mvn install it gives me a BUILD SUCCESS and can be found in ~/.m2/repositories/clj-ta-lib.
I put :dependencies [[clj-ta-lib/clj-ta-lib "0.0.1"]] in my project.clj and restart the REPL but when I call (use 'clj-ta-lib.core) I get:
CompilerException java.lang.Exception: namespace 'clj-ta-lib.core' not found, compiling:(*cider-repl app*:71:13)
Edit:
No longer getting the previous error, but still getting this one:
CompilerException java.lang.IllegalArgumentException: No matching ctor found for class com.tictactec.ta.lib.meta.PriceHolder, compiling:(clj_ta_lib/core.clj:13:3)
The stuff you say you've done sounds pretty reasonable. It's a shame the project isn't hosted on clojars or on maven central, but at least there's a pom to allow you to publish or install it easily yourself. mvn install is the right thing to do, and when I clone the project myself and install it, everything installs fine just as you say it does.
However, I can't reproduce your error when trying to use the library. After installing it, I created a new project that depends on the just-installed artifact, and in a repl inside that project, I can use the library's classes just fine. Or, well, I don't know how to use these functions as intended, but the functions are available for my use:
user=> (use 'clj-ta-lib.core)
nil
user=> ta
#<core$ta clj_ta_lib.core$ta#c668834>
So I'd say, make sure you really did follow all the steps you say you did, and that your repl has been started cleanly inside of the project that depends on your library.
As mentioned here, https://mvnrepository.com/artifact/com.tictactec/ta-lib/0.4.0 just add [com.tictactec/ta-lib "0.4.0"] to the dependencies
in your project.clj.
:dependencies [[com.tictactec/ta-lib "0.4.0"]]
It's a copy of this post with adding information (because it's not a copy of another questions like this).
I just instaill last version of Intellij idea on the new computer and can't make Maven work properly with empty project.
When it starts Maven try to download all it's plugins, but it stuck in infinite download. I try to add some dependcy and get infinity download of that dependcy
I have found a lot of peoples with such problems like this and a lot of others, but this solution doesn't work for me.
I already install last version of Maven instead of Maven inserted in idea:
Also I try to update information from main repository manual in idea Maven settings and got such error:
transfer for nexus-maven-repository-index.properties failed
There is post with problem like this, but it doesn't work for me either.
And if I try to use Maven from Terminal like this:
mvn -U idea:idea
(also I try to add proxy settings as arguments here) I've got such problems:
Failed to retrieve plugin descriptor for
org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin
org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
And a lot of problems like this with other plugins.
Try to use proxy in settings.xml and as commands in idea settings of Maven:
As #Tunaki already said add of proxy helped in most of cases, but not mine.
My settings.xml:
I found the problem. The connection was being blocked my the computer's firewall. Turning off Windows Firewall and Avast Internet Security makes it work without any proxy.
I don't know if this is going to get downvoted to oblivion as I can't provide a great deal of specific information. But in a nutshell. I have a maven project which has dependencies of other projects. One of the files coming in seems to be running on old code somehow. When de-bugging through. It stops on blank lines etc. It's like it's cached an old jar file somewhere or something. I have tried...
Deleting the contents my .m2 repository folder
Deleting all my temp files and anything that might reference the project from my tomcat directory.
reindexing the local repository
mvn clean install
mvn compile -pl service-module -am
mvn dependency:purge-local-repository
mvn dependency:purge-local-repository -DreResolve=false
mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
setting the updatePolicy in settings.xml to 'always'
I have been at it for hours now and have made absolutely no progress.
Does anybody know any other solutions to this sort of problem?
Check the transitive dependency. Check for unexpected overrides or different packaging of the same library (e.g. something like XX-all and XX-part at the same time.)
Use an IDE (that understands Maven) to look up the class name and see how many implementations are found.
Check the actual command line of the JVM, the JRE library folder and the Tomcat library folder for rogue stuff.
Use this trick to find out the actual path the class is loaded from during debugging. (Use debugger facilities like value watch or expression window.)
I am looking at an internal Maven application I am building in IntelliJ (same results in Eclipse), and everything looks perfectly clean.
I run clean and compile from IntelliJ (using IntelliJ build or using IntelliJ Maven support) and everything compiles fine.
However when I run the build from the command line (mvn clean compile) I am getting build exceptions (see below).
The command line seems to be looking for a genericized parameter (to the "with" method), which we are indeed passing in correctly. However it is complaining as if we were passing in a non-generic parameter.
Obviously mvn on the command line is using a different version of the "with" method than IntelliJ.
Is there any way to ask Maven to tell me which version of a class it is using, in terms of group, artifact and version of the containing jar?
Here is the precise error
[ERROR] \dev\try-deploy-1\src\main\java\com\victor\webui\WebUserInterface.java:[147,47]
attribute(java.lang.String,org.hamcrest.Matcher<java.lang.String>) in
org.openqa.selenium.lift.Matchers cannot be applied to
(java.lang.String,org.hamcrest.Matcher<java.lang.Object>)
Is it possible that you have another version of the class somewhere? try adding a comment on a new line in the file so the line number changes, and re-run the maven compile to see if it still gives the same line number for the error.
In Eclipse, sorry I know you are using IntelliJ, the maven build usually does an offline build that's why it's so fast. There is a way to force it to do a clean with all the jars though and I use that when I get in a bind. It is the Update Project command and it has a box to force the update of snapshots and releases. Maybe Intellij has something like that? Also I'd verify the version you are using on command line is the same as the one IntelliJ is using (I have a few versions installed). You can check Settings in IntelliJ and
mvn -v
on the command line. Finally I'd make sure the settings.xml files you are using for command line and IntelliJ are the same file.
Good luck.