xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
232 stars 76 forks source link

NoClassDefFoundError: ImmutableSet #22

Closed mickare closed 7 years ago

mickare commented 7 years ago

Description

Via eclipse and in terminal both fail generating the proto files because of a missing guava-class. With and without the Guava 18 dependency it fails.

Eclipse IDE for Java Developers
Version: Neon Release (4.6.0)
Build id: 20160613-1800
$ mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-47-generic", arch: "amd64", family: "unix"

Log-Output

$ mvn compile -e http://pastebin.com/JrBaFWX0

Project-Pom

<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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>de.mickare.net</groupId>
        <artifactId>parent</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>protocol</artifactId>
    <name>Net-protocol</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>
        <protobuf.version>3.1.0</protobuf.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuf.version}</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.5.0.Final</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.5.0</version>
                <extensions>true</extensions>
                <configuration>
                    <checkStaleness>true</checkStaleness>
                    <staleMillis>10000</staleMillis>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
<!-- 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.2</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin> -->
        </plugins>
    </build>
</project>
sergei-ivanov commented 7 years ago

Now, that was pretty unusual to see, especially given your rather vanilla project set-up.

I guess your source code is from here? (sorry for stalking you!) I shall try to build your project when I am back to my dev PC later.

mickare commented 7 years ago

Yes the code is from a new migrated project and used an old binary method. Just now I commited the pom-change to use the maven protobuf plugin.

mickare commented 7 years ago

Deleting the .m2 repository and forcing maven to re-download all dependencies resolved this issue.

Strange Maven-Bug.