4

I've got quite strange problem with pi4j library to Raspberry Pi. I have Maven project in Eclipse and just added repository and dependency for pi4j like this:

<repository>
            <id>oss-snapshots-repo</id>
            <name>Sonatype OSS Maven Repository</name>
            <url>https://oss.sonatype.org/content/groups/public</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>

<dependency>
            <groupId>com.pi4j</groupId>
            <artifactId>pi4j-core</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

I don't have any pi4j code in my project and I get this error while doing mvn install:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project kosciol-main: Error creating shaded jar: error in opening zip file d:\Programy\apache-maven-3.1.1\m2\repositories\com\pi4j\pi4j-native\1.0-SNAPSHOT\pi4j-native-1.0-SNAPSHOT-hard-float.so -> [Help 1]

If I delete dependency, project compiles without errors... I tried to delete this pi4j repository from m2 folder but this didn't help. How can I solve it?

yglodt
  • 13,807
  • 14
  • 91
  • 127
yaceq
  • 81
  • 1
  • 6
  • .so files are typically the lnux equivalent of ".dll" in windows. Maybe it's not compat. with windows...see also https://github.com/Pi4J/pi4j/issues/125 – rogerdpack Dec 14 '20 at 17:46

1 Answers1

2

Try to specify the scope of the dependency as "provided", like this:

    <dependency>
        <groupId>com.pi4j</groupId>
        <artifactId>pi4j-core</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
Celtik
  • 327
  • 4
  • 14