GithubHelp home page GithubHelp logo

Comments (15)

Zaijo avatar Zaijo commented on June 18, 2024 1

Sorry. I posted many partial results so I deleted it all. I need to sit down, isolate as much as possible and send you a report. That's what I'll do.

from java.

simonbrowndotje avatar simonbrowndotje commented on June 18, 2024 1

It's also worth pointing out that you don't need to create the entire Structurizr model in a single pass ... you can have multiple Java programs that each append different information to a single model, as described at https://github.com/structurizr/java/blob/master/docs/usage-patterns.md

from java.

Zaijo avatar Zaijo commented on June 18, 2024

Yesterday I also tried adding the documentation java source coude into parent POM, but this didn't help, because all maven parent project plugins execute before module build and plugins.

from java.

dhawken avatar dhawken commented on June 18, 2024

Hello, i have been dealing with the same issue and wound up creating a completely separate project that has all my spring boot service jars as dependencies. I have created a component finder per service, scoped by package, and played with a variety of finder strategies to get results. I'm still getting weird class not found exceptions on things outside of the service packages, but at least I have a separation of components correlating to the services.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

Exactly the same here. Yes, these ClassNotFound exceptions dependencies are wierd. Do you have any ideas about these exceptions?

Did your finder strategies ever return anything useful? For me only PetClinic (the example) worked. Any packaged spring boot app as dependency din't work for me.

from java.

dhawken avatar dhawken commented on June 18, 2024

I am trying to track them down - I've had weird ones on jaxrs which shouldn't happen, and others on static inner classes. Not sure yet what the deal is.

The finder strategies have been interesting:

  • using the SprintComponentFinderStrategy returns good stuff, and also allows me to do like the sample and hook them up to the relevant containers (Repository to a manually created database container for example).
  • using the TypeMatcherComponentFinderStrategy has also given good results, although makes me have to do more things. I've used the regex type matcher as well as suffix matcher. This gives me more things (and granularity) than the Spring finder, so I can separate things into different layers (Resource, Service, Mapper, DAO, Validator, etc). If your service code is very consistent in naming, this attempt is going well.

What issues are you having with your own packaged springboot services? I've had to reduce the package level to only what the service has - anything else seems to blow up. This then excludes all shared code, so I want to tackle that next somehow.

from java.

dhawken avatar dhawken commented on June 18, 2024

I extended one of the type finder strategies and overrode findComponents() to get some visibility into the NoClassDefs - definitely appears to be on inner classes and private interfaces. I excluded all of them via the componentFinder.exclude() method and now have lots of data. Not sure if that's the correct approach, but it got me further anyways.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

I'll add some more info with my specific ClassNotFound error logs. But I'm afraid won't handle it this week. It's good not to be alone in this situation.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

I don't think I will be willing to create a "completely new project" as you did. I want the documentation to be part of the very same codebase.

from java.

dhawken avatar dhawken commented on June 18, 2024

Where in your codebase are you planning to put the documentation? Do you want a per service yaml/json alongside the service? Or one giant output for all services? How you manage the output is most likely going to determine if something is in the same codebase, not where the code lives that generates it.

That being said, it should be just as possible to create another module in your project that has the service jars as dependencies. This would allow you to have everything in the same codebase. I was much more successful with the service jar as a dependency approach than any other classpath building approach I could come up with. Even using mvn build:dependency output did not yield results.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

My ambitions for now are:

  • Create a maven module called e.g. "documentation" with dependencies on all modules it's going to document.
  • Add build plugins for the documentation module to: Generate diagram sources, process sources to diagrams (PlantUML or GraphViz diagrams)
  • Use the diagrams from prepared markdown documentation.
  • There, write all the "supplementary" information about system context, prepare system context diagram etc.
  • Somewhere in the module, define a set of containers (a list of original modules of my project) and for each a strategy to be used. (Extract description from POM file, if the module is a spring app, extract components etc). Then define component diagrams for those container.
  • I have a little trougle describing "uses" relationships between containers, because the source code we have doesn't give that information clearly.

But I still get these reflextion ClassNotFound or similar errors. Now, I'm gettin an impression, that the reflection problems start when I add the build plugins. No more clues now.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

This would allow you to have everything in the same codebase. I was much more successful with the service jar as a dependency approach than any other classpath building approach I could come up with.

What is a "service jar". Is it somehow different that just "jar"?

from java.

simonbrowndotje avatar simonbrowndotje commented on June 18, 2024

I would also suggest adding another module (e.g. "documentation") to your project, with the appropriate dependencies needed to generate the model.

I can see there other a few other issues referenced in the comments. Please feel free to open separate GitHub issues for them.

from java.

dhawken avatar dhawken commented on June 18, 2024

What is a "service jar". Is it somehow different that just "jar"?

When i say "service jar", i mean the jar generated by the springboot plugin "package" operation. This is just a regular jar, but is the one you use to start your service: java -jar "the service jar". This jar will have all the dependencies for the service included in it via the springboot packaging process. This was the jar I had the most success with, rather than attempt to add every dependency each service had.

I added the service jar dependency via maven by referencing the maven info for my service - artifact id, version id, etc. and installing my service jar in my local maven repo.

from java.

Zaijo avatar Zaijo commented on June 18, 2024

@dhawken Could you please elaborate a bit more on this?

I added the service jar dependency via maven by referencing the maven info for my service - artifact id, version id, etc. and installing my service jar in my local maven repo.

from java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.