Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classpath for Matisse #391

Open
BirgerK opened this issue Jun 11, 2018 · 6 comments
Open

Add classpath for Matisse #391

BirgerK opened this issue Jun 11, 2018 · 6 comments

Comments

@BirgerK
Copy link

BirgerK commented Jun 11, 2018

Hi there,

thanks for your work in this plugin! We're using it now every day currently in version 1.4.3.
Some days ago we moved our project from Maven to Gradle.

Since that move we have a problem while using Matisse. We need some custom libraries in the Design Editor. Somehow the Maven-based project injected our custom libraries into the Matisse-classpath and it worked out of the box.

By moving to a Gradle-based project, Matisse is now missing the custom libraries. We found a workaround which is not really scalable: We start netbeans with the argument -cp:a "/path/to/customlibrary.jar". Of course that's not really pretty....

I found the issue #88, which had a similar problem with Matisse. Maybe the defined compile-dependencies must be added to the Netbeans- or Matisse-classpath or something...

Do you have an idea for this problem? Is there already an issue which points to this? (I didn't found one)

Thanks for your help! Regards from Hamburg
Birger

@kelemen
Copy link
Owner

kelemen commented Jun 11, 2018

It was a long time ago since I used Matisse for anything but if I remember correctly, this is how it works (for):

In Tools/Palette/Swing AWT components:

  • If you just have a jar file, then you have to just use "Add from jar"
  • If you have a project containing the jar, then you have to build that project and use the "Add from Project" feature.

@BirgerK
Copy link
Author

BirgerK commented Jun 12, 2018

Thanks for your response and the HowTo. I added the dependencies-project to every Swing-Palette (Swing Containers, Swin Controls, Beans, Borders,...), but it doesn't help. It still can't find the components.

Maybe it's in the same place like #88?

@kelemen
Copy link
Owner

kelemen commented Jun 12, 2018

#88 is about internationalization support and it should still work. I have tried the Swing components and they work for me. It shouldn't matter where you add your component (I would add it to a new group), what matters is the class name. Check the class name in the .form file (you have to do this outside of NB, since NB will hide the .form file).

@BirgerK
Copy link
Author

BirgerK commented Jun 12, 2018

I checked the class names and they match. The exception shows exactly the name which was added to the palette.
But the exception stays.

It worked as a maven project. As a maven project the dependent library was loaded from a nexus.

Now the project is a grade Multiproject, where the dependent library is included as a subproject. Maybe the plugin is not including subproject-classes for Matisse?

@kelemen
Copy link
Owner

kelemen commented Jun 12, 2018

You have to add the particular subproject containing the component needed (and select that component when adding it to the palette) and not to root project.

@BirgerK
Copy link
Author

BirgerK commented Jun 13, 2018

Hi again,

some more explanation: My project is a multi-gradle-project with this directory-structure:

/
|- build.gradle
|- child-project-A
             |- build.gradle
|- child-project-B
             |- build.gradle

child-project-B contains some custom Swing-components which shall be used in project child-project-A. There the content of child-project-A/build.gradle is:

dependencies {
   compile project (':child-project-B')
}

I added also the subproject child-project-B to the NetBeans-Swing-Palette. By doing this, it doesn't work! The Swing-forms are missing their Component-Classes

Now I tried child-project-A/build.gradle with this content:

dependencies {
   compile group: 'org.example', name: 'mighty-swing', version: '1.+'
}

So child-project-A does now use a prebuild artifact from child-project-A and not a subproject. this approach works! The NetBeans-Swing-Palette is configured like before: "I added also the subproject child-project-B to the NetBeans-Swing-Palette". The only thing I changed is the way how the child-project get included into the classpath.

Does this help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants