# NixOS protobuf-maven-plugin error

**URL:** https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339
**Category:** Deployments
**Created:** [August 29, 2022, 1:13pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339 "2022-08-29T13:13:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yswtrue](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yswtrue/32/7186_2.png) [@yswtrue](https://discourse.nixos.org/u/yswtrue)
#### Post date: [August 29, 2022, 1:13pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339/1 "2022-08-29T13:13:22Z")

</div>

This is poom.xml of grpc\_lib submodule

```auto
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>haita.chat</artifactId>
        <groupId>com.haita</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>grpc_lib</artifactId>

    <dependencies>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>${grpc.version}</version>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>${grpc.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protoc.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.2</version>
        </dependency>

    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
            </extension>
        </extensions>

        <plugins>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}
                    </protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
                    </pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

```

and when I run `mvn clean install -DskipTests` get these errors. It works well in other system.

```auto
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project grpc_lib: An error occurred while invoking protoc: Error while executing process.: Cannot run program "/home/yswtrue/Code/chat_java_lib/haita-chat/grpc_lib/target/protoc-plugins/protoc-3.17.3-linux-x86_64.exe": error=2, No such file or directory -> [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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :grpc_lib

```

---

<div class="post-metadata">

### Author: ![yswtrue](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yswtrue/32/7186_2.png) [@yswtrue](https://discourse.nixos.org/u/yswtrue)
#### Post date: [August 29, 2022, 1:43pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339/2 "2022-08-29T13:43:02Z")

</div>

these is `ldd /home/yswtrue/Code/chat_java_lib/haita-chat/grpc_lib/target/protoc-plugins/protoc-3.17.3-linux-x86_64.exe`

```auto
ldd /home/yswtrue/Code/chat_java_lib/haita-chat/grpc_lib/target/protoc-plugins/protoc-3.17.3-linux-x86_64.exe
        linux-vdso.so.1 (0x00007ffc0baf2000)
        libpthread.so.0 => /nix/store/6f66prpgx1qx4n6k450sxs3d157ia1ps-glibc-2.35-163/lib/libpthread.so.0 (0x00007ff530fd8000)
        libm.so.6 => /nix/store/6f66prpgx1qx4n6k450sxs3d157ia1ps-glibc-2.35-163/lib/libm.so.6 (0x00007ff530ef8000)
        libstdc++.so.6 => /nix/store/cs16l9whsq2mgydlg0j4x517z4qr861k-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007ff530ce1000)
        libgcc_s.so.1 => /nix/store/cs16l9whsq2mgydlg0j4x517z4qr861k-gcc-11.3.0-lib/lib/libgcc_s.so.1 (0x00007ff530cc6000)
        libc.so.6 => /nix/store/6f66prpgx1qx4n6k450sxs3d157ia1ps-glibc-2.35-163/lib/libc.so.6 (0x00007ff530aba000)
        /lib64/ld-linux-x86-64.so.2 => /nix/store/6f66prpgx1qx4n6k450sxs3d157ia1ps-glibc-2.35-163/lib64/ld-linux-x86-64.so.2 (0x00007ff530fdf000)

```

---

<div class="post-metadata">

### Author: ![yswtrue](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yswtrue/32/7186_2.png) [@yswtrue](https://discourse.nixos.org/u/yswtrue)
#### Post date: [August 29, 2022, 1:59pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339/3 "2022-08-29T13:59:41Z")

</div>

`patchelf --print-interpreter /home/yswtrue/Code/chat_java_lib/haita-chat/grpc_lib/target/protoc-plugins/protoc-3.21.1-linux-x86_64.exe`

```auto
/lib64/ld-linux-x86-64.so.2

```

---

<div class="post-metadata">

### Author: ![yswtrue](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yswtrue/32/7186_2.png) [@yswtrue](https://discourse.nixos.org/u/yswtrue)
#### Post date: [August 30, 2022, 1:39pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339/4 "2022-08-30T13:39:00Z")

</div>

```auto
    theLd=$(patchelf --print-interpreter $(which mkdir))
    patchelf --set-interpreter $theLd $(pwd)/haita-chat/grpc_lib/target/protoc-plugins/protoc-3.17.3-linux-x86_64.exe
    patchelf --set-interpreter $theLd $(pwd)/haita-chat/grpc_lib/target/protoc-plugins/protoc-gen-grpc-java-1.41.0-linux-x86_64.exe

```

this works for me

---

<div class="post-metadata">

### Author: ![raboof](https://discourse.nixos.org/user_avatar/discourse.nixos.org/raboof/32/1681_2.png) [@raboof](https://discourse.nixos.org/u/raboof)
#### Post date: [September 23, 2022, 2:23pm UTC](https://discourse.nixos.org/t/nixos-protobuf-maven-plugin-error/21339/5 "2022-09-23T14:23:57Z")

</div>

filed an issue upstream to see if they’d be OK with a change that would make this work out-of-the-box in a `nix-shell`:

[https://github.com/xolstice/protobuf-maven-plugin/issues/108](https://github.com/xolstice/protobuf-maven-plugin/issues/108)
