Build jitsi videobridge from source

whenever i try to mvn -X install in the root of this repository https://github.com/jitsi/jitsi-videobridge.git, which i cloned into my machine, I always get this error message

[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jvb-parent 2.3-SNAPSHOT:
[INFO]
[INFO] jvb-parent ......................................... SUCCESS [  0.633 s]
[INFO] rtp ................................................ FAILURE [ 20.174 s]
[INFO] jitsi-media-transform .............................. SKIPPED
[INFO] jitsi-videobridge .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.036 s
[INFO] Finished at: 2023-04-18T14:42:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.6.21:compile (compile) on project rtp: Compilation failure
[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.6.21:compile (compile) on project rtp: Compilation failure
directory not found: /home/user/jitsi-videobridge/rtp/target/classes

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.jetbrains.kotlin.maven.KotlinCompilationFailureException: Compilation failure
directory not found: /home/user/jitsi-videobridge/rtp/target/classes

    at org.jetbrains.kotlin.maven.MavenPluginLogMessageCollector.throwKotlinCompilerException (MavenPluginLogMessageCollector.java:111)
    at org.jetbrains.kotlin.maven.KotlinCompileMojoBase.execute (KotlinCompileMojoBase.java:212)
    at org.jetbrains.kotlin.maven.K2JVMCompileMojo.execute (K2JVMCompileMojo.java:222)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :rtp

where are the missing files?

What version of node and npm are you running?

npm -v gave 6.14.16
and node -v gave v14.19.0
also this is on a ubuntu 20.04.3 machine

Try npm 8 and node 16.

how do I do that properly? is it just npm install -g npm@latest for npm for example?

videobridge is a java project and uses maven.

What java version do you use? Maybe clean and show the whole output of mvn install? What maven version are you using?

this is my maven version

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-135-generic", arch: "amd64", family: "unix"

and this is what I got from running mvn clean install

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jvb-parent                                                         [pom]
[INFO] rtp                                                                [jar]
[INFO] jitsi-media-transform                                              [jar]
[INFO] jitsi-videobridge                                                  [jar]
[INFO]
[INFO] ------------------------< org.jitsi:jvb-parent >------------------------
[INFO] Building jvb-parent 2.3-SNAPSHOT                                   [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (3.9 kB at 13 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar (25 kB at 821 kB/s)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jvb-parent ---
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom (4.1 kB at 214 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar (226 kB at 3.0 MB/s)
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ jvb-parent ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jvb-parent ---
[INFO] Installing /home/user/jitsi-videobridge/pom.xml to /home/user/.m2/repository/org/jitsi/jvb-parent/2.3-SNAPSHOT/jvb-parent-2.3-SNAPSHOT.pom
[INFO]
[INFO] ---------------------------< org.jitsi:rtp >----------------------------
[INFO] Building rtp 2.3-SNAPSHOT                                          [2/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rtp ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ rtp ---
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (default) @ rtp ---
[INFO] Source directory: /home/user/jitsi-videobridge/rtp/src/main/kotlin added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rtp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/jitsi-videobridge/rtp/src/main/resources
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.21:compile (compile) @ rtp ---
[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jvb-parent 2.3-SNAPSHOT:
[INFO]
[INFO] jvb-parent ......................................... SUCCESS [  1.473 s]
[INFO] rtp ................................................ FAILURE [ 25.386 s]
[INFO] jitsi-media-transform .............................. SKIPPED
[INFO] jitsi-videobridge .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.037 s
[INFO] Finished at: 2023-04-18T16:10:24Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.6.21:compile (compile) on project rtp: Compilation failure
[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :rtp

This is strange. I just did a clean checkout and did mvn install without any issues.

I would blame maven. Can you install a newer version and try again?
Mine is:

% mvn --version
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /opt/homebrew/Cellar/maven/3.8.6/libexec
Java version: 11.0.15.1, vendor: Oracle Corporation, runtime:....

my new maven version after running mvn -version is this


Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /opt/maven
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-135-generic", arch: "amd64", family: "unix"

i ran mvn clean install again and got this

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jvb-parent                                                         [pom]
[INFO] rtp                                                                [jar]
[INFO] jitsi-media-transform                                              [jar]
[INFO] jitsi-videobridge                                                  [jar]
[INFO]
[INFO] ------------------------< org.jitsi:jvb-parent >------------------------
[INFO] Building jvb-parent 2.3-SNAPSHOT                                   [1/4]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jvb-parent ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ jvb-parent ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jvb-parent ---
[INFO] Installing /home/user/jitsi-videobridge/pom.xml to /home/karish/.m2/repository/org/jitsi/jvb-parent/2.3-SNAPSHOT/jvb-parent-2.3-SNAPSHOT.pom
[INFO]
[INFO] ---------------------------< org.jitsi:rtp >----------------------------
[INFO] Building rtp 2.3-SNAPSHOT                                          [2/4]
[INFO]   from rtp/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rtp ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ rtp ---
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (default) @ rtp ---
[INFO] Source directory: /home/user/jitsi-videobridge/rtp/src/main/kotlin added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rtp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/jitsi-videobridge/rtp/src/main/resources
[INFO]
[INFO] --- kotlin-maven-plugin:1.6.21:compile (compile) @ rtp ---
[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jvb-parent 2.3-SNAPSHOT:
[INFO]
[INFO] jvb-parent ......................................... SUCCESS [  0.538 s]
[INFO] rtp ................................................ FAILURE [ 23.753 s]
[INFO] jitsi-media-transform .............................. SKIPPED
[INFO] jitsi-videobridge .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.438 s
[INFO] Finished at: 2023-04-18T16:31:59Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.6.21:compile (compile) on project rtp: Compilation failure
[ERROR] directory not found: /home/user/jitsi-videobridge/rtp/target/classes
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :rtp

any ideas? what else could be wrong? @damencho

Not really.
Can you list the content of /home/user/jitsi-videobridge and /home/user/jitsi-videobridge/rtp with ls -l?

this is from /home/user/jitsi-videobridge

total 64
-rw-r--r-- 1 root root  5423 Apr 17 19:50 CONFIG.md
-rw-r--r-- 1 root root 11358 Apr 17 19:50 LICENSE
-rw-r--r-- 1 root root  2783 Apr 17 19:50 README.md
-rw-r--r-- 1 root root   378 Apr 17 19:50 SECURITY.md
drwxr-xr-x 2 root root  4096 Apr 17 19:50 config
drwxr-xr-x 4 root root  4096 Apr 17 19:50 debian
drwxr-xr-x 2 root root  4096 Apr 17 19:50 doc
drwxr-xr-x 3 root root  4096 Apr 17 19:50 jitsi-media-transform
drwxr-xr-x 5 root root  4096 Apr 17 19:50 jvb
-rw-r--r-- 1 root root  5781 Apr 17 19:50 pom.xml
drwxr-xr-x 3 root root  4096 Apr 17 19:50 resources
drwxr-xr-x 3 root root  4096 Apr 17 19:50 rtp

and this is in /home/user/jitsi-videobridge/rtp


total 24
-rw-r--r-- 1 root root   887 Apr 17 19:50 README.md
-rw-r--r-- 1 root root 10813 Apr 17 19:50 pom.xml
-rw-r--r-- 1 root root  1335 Apr 17 19:50 spotbugs-exclude.xml
drwxr-xr-x 4 root root  4096 Apr 17 19:50 src

just noticed that since the owner and group for all of these is root i should have done sudo mvn clean install, now its running…

it finally finished the build

@damencho @Freddie Sorry for the delay with this question, but how do I use the generated binary as the jitsi-videobridge? and how do I check if I succeeded since I am not understanding what it is I need to do from running locally section here → https://github.com/jitsi/jitsi-videobridge.git

You can replace the jvb running on your deployment with one built from source and use it there to verify it is working.

how do i get the location of the currently running jvb and what exactly do I replace it with?

When you build jvb there is a file jvb/target/jitsi-videobridge-2.3-SNAPSHOT-archive.zip, which you extract and its folder needs to replace /usr/share/jitsi-videobridge and then just do service jitsi-videobridge restart.

1 Like