No plugin found for prefix 'C' in the current project and in the plugin groups - maven-2

Currently, I am using Maven Tool to create a zip file of a downloaded folder from Github https://github.com/Saulis/teamcity-gerrit-trigger
The command that I use is
mvn [folder name]
However, I faced error while running the command:
No plugin found for prefix 'C' in the current project and in the
plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available
from the repositories)
Is there anyone face the same issue with me? What is this error about?
How can I solve this error? Thanks in advance.

Thanks for the reply #YohanesGultom.
It really helpful as it correct my mistakes.
I change directory to the folder that I want to assemble a zip binary with pom.xml in the same hierarchy. Then, I run the command as [> mvn package] and did some changes on proxy settings under C:\Users\ .. \ .m2. Finally, I get the zip binary assembled.
Thanks!!

In my case I solved the problem checking for empty spaces e.g.
mvn... -Dconfigfile=[unwanted empty space]C:\SOME-DIRECTORY
Additionally pay attention on / and \. This depends on your OS.

Related

OpenRefine sample extension not building

I'd like to write my own OpenRefine extension
Before starting any implementation, I just want to build the sample extension from OpenRefine just to get me started.
However, I'm getting the Maven error
Could not resolve dependencies for project org.openrefine:sample:jar:3.0-SNAPSHOT: org.openrefine:main:jar:3.0-SNAPSHOT was not found in https://oss.sonatype.org/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of snapshots has elapsed or updates are forced ->
I simply cloned the OpenRefine repo and ran mvn compile from the extensions/sample folder.
any tips?
ok, I think the sample project has a wrong version in the pom.xml. it should be\
<version>3.6-SNAPSHOT</version>
I fixed the issue in this PR https://github.com/OpenRefine/OpenRefine/pull/4395

Downloading from github - there seems to be a directory missing (azure-iot-sdk-c)

I am working thru this Tutorial
(https://learn.microsoft.com/en-us/azure/iot-develop/quickstart-send-telemetry-central?pivots=programming-language-ansi-c)
Was able to perform all steps to install the SDK and samples.
In the next step - when I ran the sample code:
cmake\iothub_client\samples\pnp\pnp_temperature_controller\Debug\pnp_temperature_controller.exe
Encountered an error that states:
The system cannot find the path specified.
When I look into my directory system & follow the path of the sample code above I see that the path ends at
cmake\iothub_client\samples\pnp\pnp_temperature_controller\
This section is missing
\Debug\pnp_temperature_controller.exe
Missing:
(Directory: "Debug"
File: "pnp_temperature_controller.exe")
Have I done something wrong or is this missing from the repository. I somehow think that I did something wrong but I cannot see where.
Any help on this would be helpful. Thanks
Weng
Are you able to complete the step3 under Install the SDK and samples successfully?
cmake -Bcmake -Duse_prov_client=ON -Dhsm_type_symm_key=ON -Drun_e2e_tests=OFF
cmake --build cmake
Please ensure you have installed cmake and path is updated in your machine.
I had the same issue initially and then checked the cmake version and appears to be not added to the system Path.
Once cmake is installed and updated the PATH, I tried the example again and able to run it successfully.
Output from the Azure IoT Central page device telemetry graph.

maven repository and dependencies download

I've used standard maven command mvn clean install and according to logs (in the same console window) dependencies were loaded and artifacts were installed to my dedicated directory for maven repository P:\.m2\repository. Maven build process succeeded.
I'm using maven 2.2.1
Here is the problem. Repository directory is empty. What I'm missing?
Thanks.
Some reasons:
Someone deleted the folder (or it's content)
Maven installed the files in a different place
I suggest to run mvn again with the option -X. Running mvn clean -X should be enough to see the paths which it uses to locate dependencies (install will download many more files but we need to see only one).
Note: P:\ sounds like a network drive. Even if this is your home folder (i.e. not shared with other people), this isn't a very good idea since it will cause a lot of network traffic and make your builds slow and brittle (in case of network problems).
Did you change the repository location in your m2_install_dir/conf/settings.xml?
If not, try to locate your files in something like:
C:\Documents & Settings\your_username.m2
or C:\Users\your_username.m2
I think you are using something like gitbash and its stripping off the backslashes in your repo value. run maven install with -X. check if you have a directory called P:\.m2repository

IntelliJ IDEA "cannot resolve symbol" and "cannot resolve method"

What are common causes for IntelliJ IDEA not being able to resolve built-in JVM types and methods? For example, when I mouse over String the tooltip says "Cannot resolve symbol 'String'". It's as if IntelliJ has doesn't know where the JVM is.
By the way, I am running OS X 10.6.6. Everything was working fine until I ran the system update this morning.
Most likely JDK configuration is not valid, try to remove and add the JDK again as I've described in the related question here.
First check if you have configured JDK correctly:
Go to File->Project Structure -> SDKs
your JDK home path should be something like this:
/Library/Java/JavaVirtualMachine/jdk.1.7.0_79.jdk/Contents/Home
Hit Apply and then OK
Secondly check if you have provided in path in Library's section
Go to File->Project Structure -> Libraries
Hit the + button
Add the path to your src folder
Hit Apply and then OK
This should fix the problem
I was facing the same problem when import projects into IntelliJ.
for in my case first, check SDK details and check you have configured JDK correctly or not.
Go to File-> Project Structure-> platform Settings-> SDKs
Check your JDK is correct or not.
Next, I Removed project from IntelliJ and delete all IntelliJ and IDE related files and folder from the project folder (.idea, .settings, .classpath, dependency-reduced-pom). Also, delete the target folder and re-import the project.
The above solution worked in my case.
For me, I had to remove the intellij internal sdk and started to use my local sdk. When I started to use the internal, the error was gone.
I tried almost everything but nothing was helping with the ibm jdk 1.8. to fix this issue. then I found an article from https://youtrack.jetbrains.com/issue/IDEA-279214/Cannot-resolve-symbol-String-when-using-IBM-JDK-180 and it worked like charm!!!
so sharing original help credit goes to #Serge Barano. incase anybody needs and not able to able to resolve the issue using previous solutions like me.
according to the article answer is:
IBM JDK has a weird layout and the jar with the String class is in bin directory for some reason:
d:\dev\ibm_sdk80\jre\bin\default\jclSC180\vm.jar
If you add it to the JDK classpath in IntelliJ IDEA, the issue should resolve:
For me, IntelliJ could autocomplete packages, but never seemed to admit there were actual classes at any level of the hierarchy. Neither re-choosing the SDK nor re-creating the project seemed to fix it.
What did fix it was to delete the per-user IDEA directory ( in my case ~/.IntelliJIdea2017.1/) which meant losing all my other customizations... But at least it made the issue go away.
First of all you should try File | Invalidate Caches and if it doesn't help, delete IDEA system directory. Then re-import the Maven project and see if it helps.
For me ,
File -> project structure -> Project Language Level (11) selection worked. Local variable syntax for lambda paramters.
In my case, cloning repo from the remote was the easiest way to solve this issue.

maven jetty plug in mvn:jetty ServletContext.getRealPath("") and ServletRequest.getRealPath("") to point to target _instead_ of source folders?

SUMMARY: The goal is to find the path to the WEB-INF folder in the target folder for maven-jetty-plugin that is compatible with other servers as well. The ServletContext.getRealPath("") works beautifully for, e.g., Tomcat, or mvn jetty:run-war. Thank you
Misha
Dear All:
This is related to
http://tickets.openmrs.org/browse/TRUNK-1760
It can be easily tested with the following commands:
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-light-struts-archetype -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany -DartifactId=myproject
cd myproject
patch -p0 < diff
cd myproject
mvn clean install -DskipTests && mvn jetty:run
Please find the diff file here:
http://old.nabble.com/file/p29815681/diff
Now, navigate to
http://localhost:8080/
in a browser and this will point to
!!! /home/misha/workspace/myproject/src/main/resources
Should this not, instead, point to?
./target/classes
or
./target/myproject-2.1.0-M1/WEB-INF/classes
Is it possible to modify this behavior?
Thank you so much
Yours
Misha Koshelev
It seems one work around, per Jan Bartel's very helpful post on the user at jetty dot codehaus dot org mailing list, is to use
mvn jetty:run-exploded
I believe one of the disadvantages of this method is the extra time that it will take to first assemble a WAR and then to run it.
Thank you
Misha
p.s. Reference to Jan Bartel's post:
http://markmail.org/message/445huiwr6vljblxn