find usages across multiple projects

Hy,
is there a way to use "find usages" of a java class across multiple projects defindes in upsource?

Thanks,
Tom

1
13 comments

Hi,

Nope, but if your projects are too intersected, perhaps it's worth configuring single Upsource project with multiply roots?

0

Hy,
I tried your setup but had no success.
I thinks it's related to the project model.

Saying I'm having this config:
git-project COMMON
git-project AAA
git-project BBB

Both projects AAA and BBB are using the COMMON library (defined in both projects as maven dependencies)

What I setup:
multiroot-upsource project
   mountpoint 'common' with git-project COMMON
   mountpoint 'aaa' with git-project AAA
   mountpoint 'bbb' with git-project BBB
As project model, I defined "common\pom.xml"

Upsource is analyzing correctly the COMMON project, but not the projects AAA and BBB.
Did I missed something?

What I try to setup is that I could use  "find the usage" on my COMMON project which show me the usage on all the projects (COMMONS, AAA and BBB).

Thanks,
Tom

0

Hi Tom,

Could you please post a mvn.out file?

To find mvn.out (gradle.out) file:

  1. Open your Upsource project

  2. Click Browse code at the top of the revisions list

  3. Navigate to /.idea/maven/mvn.out

If no such file exists:

  1. Navigate to /.idea/model.info

  2. Open model.info and copy the revision ID

  3. Using the search, locate that revision and open it up

  4. Click Browse code and navigate to /.idea/maven/mvn.out



Thanks in advance.

0

Hy,
the mvn.out look correctly and everything is build correctly with maven in the project.
It located under this folder structure: /common/.idea/maven/mvn.out

As I defined as project model this file "common\pom.xml", it's only compiling the "common" project.
My multiroot-project looks like:
  |
  |- common
        |- .idea
                |- maven
                    |- mvn.out
        |- pom.xml
  |- aaa

  |- bbb



But nothing is compiled for the mountpoints "aaa" and "bbb".
How do I get compiled also both "aaa" and "bbb" mountpoints?

Thanks,
Tom
0

Tom,

We do nothing but launching maven plugin that compliles project due to configuration in the specified pom.xml.

That being said, your pom.xml in *common* project should know aobut other projects.

0
Avatar
Permanently deleted user

Is there a way to specify POM file location for each repo, when they are part of the same project?

0

No, only one pom file per Upsource project.

What is the purpose of specifying poms for each repo in one Upsource project? Find usages feature across this repos wouldn't start working in such case.

0
Avatar
Permanently deleted user

Basically we have multiple modules in their own repos. Most of features require changes in more than one module.

It's great that I can create reviews across multiple repos, but that would be absolutelly fantastic if I also could get code analyser to work.

0

But how do you build your project? Is there a parent pom file where all repos are specified?

0

I got it working by adding an additional root with a pom containing all the projects:
The new "root" is named "upsourceRoot" and contains this pom.xml

<packaging>pom</packaging>
<modules>
     <module>../common</module>
     <module>../aaa</module>
     <module>../bbb</module>
</modules>


The project is now defined to use the "upsoureRoot/pom.xml" to compile.

My multiroot-project looks now like this:
  |
  |- common
        |- .idea
                |- maven
                    |- mvn.out
        |- pom.xml
  |- aaa

  |- bbb
  |- upsourceRoot
        |- pom.xml




I can now use "find usages" acroos my multiple projects(roots).

Thanks for all your help,
Tom
0
Avatar
Permanently deleted user

That might be a solution!

On another note, which instance are you running it on, It looks like Code analyzer requires  quite a lot of resources.

0

It would be a great feature if we can configure in Upsource something like dependency across the projects which would show also results in Find usages or Goto declarations from dependant projects.

In my case, I would create 3 projects:

  • common
  • projectAAA
  • projectBBB

In projectAAA and projectBBB, I would create then a dependenxy to project common.

What do you think about this feature request?

Thanks,
Tom
0
Avatar
Permanently deleted user

Hello.
This is a very old request here, but I couldn't find the answer anywhere.

I am working on a project that has a Persistence project shared across many different projects, and I'd like to find usages in any of them without having to look for it 1 by 1.

Has this been implemented?
Is there a workaround besides the one above?

0

Please sign in to leave a comment.