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?

1
  • .so files are typically the lnux equivalent of ".dll" in windows. Maybe it's not compat. with windows...see also github.com/Pi4J/pi4j/issues/125 Commented Dec 14, 2020 at 17:46

1 Answer 1

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> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.