In Netbeans IDE we have an option for maven dependencies called "Download Sources".
After download we can see a package icon in right bottom of that dependency means it is downloaded
But still I cannot see any .java file?
Does the "Download sources" mean something other than .java files?
I tried to see source code of a JSON parser in java .If you know somewhere easy I wonder if you tell me in comments.
NetBeans downloads the jar file with the sources from Maven central. It doesn't store individual Java files directly.
To view the downloaded source, you can expand the library node, navigate to the class you are interested in, then double click on it (or right click, then choose "Open").
Another way to jump to the source code is, to use "Goto Source" inside the editor where you use the classes.
Related
I'm working on a maven project in Spring tool suite(STS), issue is unable to navigate to other classes and methods (using ctrl+ mouse click), and its showing many error messages near import statements and other places in the class.
When clicked on the red cross mark which states error and select FIX project setup below is the message displayed on popup window.
The following proposals have been found to fix the unresolvable reference to 'Bootstrap'
Add archive 'lpa-core-1.2.5.jar - c:\Users\tom.m2\repository\com\lpa\lpa-core\1.2.5' to buildpath of 'lpa-realtime-service'
Please suggest how to include .m2 file automatically while build process to avoid the error messages and to navigate to other classes and methods using ctrl and mouse click.
It sounds like your project is not properly set up so that the IDE doesn't really configure its classpath correctly. Normally this would all happen automatically via m2e (i.e. Eclipse's maven support).
M2e is included in STS by default, so its probably installed, but somehow your project isn't treated as a maven project.
You can try to re-import it using the proper 'import wizard' which should set things up correctly for you.
Steps:
Delete the project from the workspace. Take care not to actually delete the files themselves. (There's a checkbox 'Delete project contents on disk', so don't select that).
clean out all the 'junk' data from your project. Delete all tese files / folders from your project .classpath, .project, .settings, target.
Now that you have a 'clean slate'. Import it using m2e. Menu: File >> Import >> Existing Maven Projects".
This should setup everything correctly.
I say should because it depends to a large degree on what is in the project itself. But this, in principle, is the correct way to import maven project into STS (or Eclipse in general).
I have trouble including the ShowcaseView library in my Android application with Android Studio.
On the GitHub repo (https://github.com/Espiandev/ShowcaseView), it says it should be easy to install with Maven. But when I search for showcaseview, Maven finds no result.
So I clone the repo on my computer and try to include it's library folder as a java library in my project's module dependencies. But when I try to use it in my code, it says
Cannot resolve symbol 'ShowcaseView'
My guess is because the actual ShowcaseView library is not compiling due to errors (the cloned repo is showing in multiple files the error
Cannot resolve symbol 'R'
event after adding the NineOldAndroids as a module dependency as showed on the GitHub repo.
Is there something I am missing?
You shouldn't include library folder as a java library.
try following way to add ShowcaseView library as a module to your project:
Go to file > Project Structure...
in the left panel select Modules and in the middle panel click plus icon and then select Import Module
from browsing dialog select path of ShowcaseView library
click next... to finish importing (but notice the directory /gen of library unchecked)
Then goto the Library section in left panel and select libs in middle panel
if the library robolectric-2.2-20130909.210745-40-jar-with-dependencies.jar existed in right panel then you should remove it.
Goto the Modules section and select your main project module in middle panel and click plus icon in right panel and select Module Dependency... then select ShowcaseView library that previously included.
Now you should rebuild your project...
Go to ShowcaseView Manifest and change the package name to com.espiandev.showcaseview
the rebuild, re-organize imports, R would resolve to the new package.
I'm a pretty experienced Eclipse user, and just moved to IntelliJ Idea (or at least, trying to).
In Eclipse I'm used to "Link with Editor" feature of Projects view. I've just found out that the similar feature in Idea is called "Autoscroll from source" (a bit vague, but OK). It highlights the currently opened file in the "Project" view.
Our project consists of approximately 30 Maven modules, so I'd like to find out, whether there is the same option for "Maven Projects" view. I checked the Maven options, but couldn't find anything like that.
EDIT
to see what I mean, take a look at this screenshot:
Project view is successfully synchronized, when I edit pom.xml of ws-consumer project, but the selection in Maven Projects still highlights the pom.xml of previous project.
I believe there's no such feature. You can create a new Enhancement Request here.
You can jump to the relevant project manually using Select Target feature - Alt F1 and then Maven Projects.
Hi by mistake I added cv210d.lib, cxcore210d.lib and highgui210d.lib as inherited values under the project configuration->Linker->input->Additional Dependencies settings.
But I cannot seem to remove them from the "inherited" additional dependencies. So each time I start a new project I get an error because these liberties cannot be found.
There is an option to ignore the inherited dependencies but I cannot do this as it contains values I do need.
So I am looking for a way to remove these unwanted values from the "inherited" additional dependencies.
You can find the file "Microsoft.Cpp.Win32.user" on your system and manually edit it as you want. Normally the file will be located at "C:\Users\%USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0" location. It is an xml file.
As was suggested I modified the property sheet in the property manager.
The reason I found it confusing though was that in the Property Manager view, there are three different ways to change the properties. Through clicking on the debug, release property sheets or the project properties . But when I opened each one I thought I was opening the same thing, as they look similar.
But the case is that, the properties from the debug and release property sheets are inherited to the project properties. And you cannot modify the inherited properties from the project properties.
Did you accidentally add it to "Linker > Input" under "Property Manager > AnyProject > AnyConfiguration > Microsoft.Cpp.Win32.user"?
Despite its strange position, this is the setting for all projects of the current user.
As soon as you put a wrong .lib file into Additional Dependencies it went to the inherited directory. You need to untick "Inherit from parent or project defaults". Then, to save inherited .lib files (such kernel.lib and etc.) you need to copy and paste all of them into the Additional Dependencies directory. So your computer cannot take the wrong .lib file and will use only Additional Dependencies which you wrote
You can open with notepad the .vcxproj file of your project and find the lib you want to remove. Then, Delete that library from the xml field.
I'm using Visual Studio 2008 and would like to create a sort of container project that holds a number of DLL's that must be installed with a solution. I want them to be in a separate project so that they can be easily attached to a solution as a group.
I created an empty project call TEST, added my DLL's to it with a Build Action of "Content", and set them to "Copy Always". That all works exactly as I want. The problem is that if I set the TEST project Output Type to "Console Application" or "Windows Application" that it won't build because there's no entry point. If I set the Output Type to "Class Library", it builds but I end up with an extra TEST.DLL file that I don't really want.
Is there anyway to sort of set the Output Type to "none"? I want the build actions to take place (so my DLL's get copied) but I don't want the dummy class assembly created. Any ideas?
Thanks!
Assumptions for the following step-by-step guide:
Let's assume that you have a solution with two projects:
Main: your main (start-up) project.
BundledDLLs: a library project which contains the .dlls that should end up in the main project's output directory.
Step-by-step guide:
The easiest way to achieve your goal inside Visual Studio is probably the following:
Add all .dlls to BundledDLLs and set their Copy to output directory to Copy if newer.
This is done in the Project Explorer and the Properties windows.
Configure BundledDLLs's output directory to be identical to Main's output directory.
This can be done in the Build tab of BundledDLL's Project Properties page. Enter something like the following in the Output Path textbox:
..\Main\bin\Debug
Set up BundledDLLs as a dependency of Main.
Do not add BundledDLLs as a project reference to Main, as you usually might; instead, use the Project Dependencies dialog to . This will tell the build tool that whenever Main is built, BundledDLLs needs to be built first.
Do this by right-clicking on the Main project node to open the context menu; select Project dependencies... from there. In the now opened dialog, first select Main from the drop-down list; then check BundledDLLs in the project list below. BundledDLLs is now registered as a dependency of Main.
P.S.: One disadvantage of not having an explicit assembly reference in Main is that some tooling might not recognise the dependency. For example, ClickOnce deployment might not work properly.
Add a post-build event to BundledDLLs that deletes the superfluous BundledDLLs.dll.
As you said, you don't want, and don't need, the dummy output generated when BundledDLLs is built. So add a post-build event that simply deletes this .dll once it's been created.
Open the Build events tab in BundledDLLs's Project Properties page, and enter something like the following in the post-build textbox:
DEL "$(TargetDir)\$(TargetName).*"
(In case you wondered: The reason why you didn't add this project as a project reference to Main earlier is because if you had done so, Main would be looking for BundledDLLs.dll, which it wouldn't be able to find since you don't actually want such a file to be generated.)
P.S.: One disadvantage of adding such a post-build step is that it might interfere with incremental builds. If your project keeps getting recompiled from scratch after this, you might be better off removing the post-build step and living with the extra BundledDLLs.dll in your solution's output directory.
Another option is to use a makefile project, which doesn't require you to build/link anything.
In your project properties (right click property in solution explorer and click "Properties"), under "Configuration Properties" and then under "General", choose "Makefile" from the "Configuration Type" drop-down menu. The build output will include the warning "The property 'NMakeBuildCommandLine' doesn't exist...Skipping" but the build will succeed without building any dll/exe/etc.
While other answers here may better address your specific need, specifying a makefile more directly answers the question title "Possible to create Visual Studio project with Output Type of none?" I hope this is useful for people who google something to that effect and land here.
Credit goes to Xeek in the #winapi freenode irc channel for sharing this tip.
Instead of putting them in a project, you can put the files in a Solution Folder. One of your projects can have a build action that does the copying, but since they won't be in a project, they won't try to "build".