Netbeans doesn't recognize imported package - netbeans

I have 2 projects in netbeans, one of then import some classes of the other o should do it but when I try not get it to work.
Project 1 is called gprslibs and project 2 is called gprs, the project 2 import some some classes and packages of the projec 1. The problem is that netbeans doesn't reconize de package of the project 1.
I think that should be an easy problem but I don't find the answer.
Thanks for advance.

Seems like you want to import some packages and classes from Project1:gprslib into the project Project2:gprs
For this to work you will have to add the Project1:gprslib as a dependency in your Project2:gprs project
Step 1
Assuming you have two projects as mentioned above, gprslib and gprs. In your gprs project right click on the Libraries node and choose the Add Project.. option
Step 2
Select the gprslib project which you want to add as a dependency to your project
Step 3
After this step the packages and classes from gprslib project will become available to the gprs project even in the hints and help from NetBeans IDE.

Related

UI Test target does not recognize Swift package from custom framework in xcworkspace

I am developing several projects in a single workspace (monorepo). The workspace contains a shared framework that contains code shared between the projects. Some of the code depends on external packages that I import using the Swift Package Manager. Everything is working except that the packages aren't recognized when I use the UI testing target. When I run the UI tests for one of the projects it complains that the packages cannot be found (in the framework). Another solution that suits my needs is also welcome. Anyway, I'm using Xcode 11.3. To reproduce:
Create a new workspace.
Add a new project A and a new framework B into the workspace.
Add any dependency (for example SDWebImage) to the framework.
Add a Swift-file to the framework that just does import SDWebImage.
Now add framework B as a dependency to project A.
If you build project A or unit test project A, there is no problem. However, when you run UI tests on project A it complains that it cannot find the module SDWebImage in the Swift-file you added in point 4 above. Any idea how to solve this?
Edit: When I use Cocoapods instead it gives me the same error. When I use use_frameworks! it doesn't give me the error, but it crashes with "SDWebImage: image not found".
You have to manually add your B framework as a linked library in on your UI Tests target under Build Phases -> Link Binary With Libraries

How to make Intellij follow sbt GitHub dependencies?

I managed how to add github dependencies to my sbt project following the instructions in this link.
However, Intellij could not find the github dependencies.
After om-nom-nom sugestion, only Scala plugin is needed:
Installing the Scala plugin from a fresh idea install
Import project from external model -> SBT project
? use auto import ?
Register "unregistered Vcs root"
Set module SDK with your JDK folder and adopt it for the project
Write a main file and press ctrl+shift+F10
The step 4 is important because you won't need to keep the working copies of the sub-projects anymore.
Idea creates them inside ~/.IdeaIC13 folder.
This link talks about multi-root Projects and synchronous branch control.
ps. the SBT plugin somehow was disabled and ideia became cofused about a subproject with a (nested) subsubproject.

Import a project into another imported project

I found this statement in the help of a project that I want to import it named "storm-
election"
This is a simple demo app based on the storm-starter project. https://github.com/nathanmarz/storm-starter.
So, I imported storm-starter project successfully. How can I import storm-election project?
Can I import a project on another imported project ?
Eclipse 4.5 (starting from Mars M5) will include a mechanism that allows to nested projects under their parent one.
You can already give it a try by accessing the latest snapshot build of Eclipse Platform (which is a subset of the IDE, but which contains the change) http://download.eclipse.org/eclipse/downloads/drops4/N20150124-1500/ , when Mars M5 is ready, you'll be able to access from http://eclipse.org/downloads a full featured IDE which also contains this feature.
Reference https://bugs.eclipse.org/bugs/show_bug.cgi?id=427768
You cannot create a project under any project, like you create folder(s) under folder, folder(s) under project, file(s) under project and file(s) under folder.
All projects in a workspace are siblings no child and parent relationship exists between projects.
I am not able to see storm-election project in the link provided, but you can import this project in the same way as you imported storm-starter project.

Maven eclipse - mutli project dependencies not appearing

I have a bunch of maven projects which all are part of a parent project. When I import the parent project into eclipse, I was expecting the child projects source folders to be listed in my parent project, however they are not. They also don't appear in the "Maven Dependencies" section.
Is this the correct behavior or am I missing something. If it is the correct behavior, then what is the best practice around doing this?
Should I be importing each project into eclipse and then editing the build path for my parent project to include them all? I really don't like this approach because I want to do everything through maven.
Note: I am not using mvn eclipse:eclipse to generate my project files, I am using the maven plugin directly in eclipse IDE as: Import existing maven projects
Thanks!
Import your parent project then close it (right click on the project in the package explorer > close project). Select it and go to file > import > maven > existing maven projets here you should see the list of the child projects, select the wanted ones then finish.
Now in your package explorer you should have :
A project parent-project where you work on the pom-parent and eventually on the src-parent
One project per child-project where you work on the corresponding pom-child and src-child
If some dependencies are missing try to update the projects (right click on the projects in the package explorer maven > update project)
Normally you don't have to edit the build path in eclipse it must be handle by the maven nature of the project (the maven nature is often represent by a M on the icons of the projects)
Normally, if you don't import "dependencies" projects, Eclipse simply uses the jars presents in your local repo (.m2).
However, I don't get what you mean by "I have a bunch of maven projects which all are part of a parent project".
Projects are not part of each other. And the child projects sources should not be listed in the sources folders. You only uses the bytecode.
If you want to "see all your sources" :
However, you can have a complete "view" of the code if you export your sources as sources jars.
If you want to be able to debug across your projects :
You then have to import all your projects in Eclipse. If a project is closed, Eclipse will use the jar like if the project was not there. If the project is open, it will use the project (not sure exactly how, but it works smoothly).

Importing projects into Eclipse

I have this simple question how to import whole project source into Ecplise so I can browse it easily? Specifically, I have downloaded Maven source code http://maven.apache.org/download.html and I just want to view it same as other projects in my Eclipse.
I've tried to import it with use of two possible options (as archive and as a project) without luck.
Thank you in advance!
Maven itself is a Mavenized multi-module project, Generally there are two ways to import a Mavenized project into a IDE like eclipse:
Pre-requirment:
Suppose you have installed Maven 3 and setup environment variable
properly.
if you use Eclipse, you also need add M2_REPO to you
Build Path -- Classpath Variable, check out here for how to
setup. this tells Eclipse where to find jar dependencies stored in
local maven repository.
Option 1 -- Import as Java Project:
Open a command prompt and go to the extracted source folder, run mvn eclipse:eclipse
and waiting for it finish, make sure it doesn't popup any message start with [ERROR], this
will download all required jar dependencies from internet to you
local maven repository and create .project and .classpath for Eclipse
to use when doing import.
In eclipse, go to File -- Import -- General -- Existing Project into
Workspace, select the extracted source folder as root directory. This
will import a group of projects into Eclipse as bunch of regular java
projects (i.e. project icon inside Package Explorer watermarked with a
capital J).
Option 2 -- Import as Maven Project:
Alternatively, if yo got m2e plugin installed in Eclipse, you can
directly import the extracted project folder, go to File -- Import --
Maven -- Existing Maven Projects, select the extracted source folder
as Root Directory. This will import a group of projects into Eclipse
as bunch of Maven projects (project icon inside Package Explorer
watermarked with a Capital M).
Hope this helps.
The maven repository versions are not uploaded in the exact format they are on disc (from where the the mvn deploy goal is run. I can think of 3 options assuming I understand your question correctly:
You can find the open source project if it exists and get all the
source and project from there.
On an existing project, you go the dependencies, right click on one
and select browse source. Not the same as having the show project
here you can build and run however.
You can download the sources from the maven repo and then
reconstruct the project. I'm not not sure how feasible this
actually is and I have never tried it. I would probably find other
ways before trying this.