Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szarnyasg/tycho-transitive-demo
Demonstrate that transitive dependencies don't work with Tycho
https://github.com/szarnyasg/tycho-transitive-demo
Last synced: 5 days ago
JSON representation
Demonstrate that transitive dependencies don't work with Tycho
- Host: GitHub
- URL: https://github.com/szarnyasg/tycho-transitive-demo
- Owner: szarnyasg
- Created: 2015-09-30T10:40:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-30T11:50:00.000Z (about 9 years ago)
- Last Synced: 2024-11-25T05:45:25.796Z (30 days ago)
- Language: Java
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tycho-transitive-demo
1. Build the `my.tycho` project, then the `my.maven` project.
```bash
cd my.tycho
mvn clean install
cd ..
cd my.maven
mvn clean install
```2. Try to run the `my.maven` project.
```bash
java -jar target/my.maven-1.0.0-SNAPSHOT.jar
```It will throw an error:
```
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
at my.tycho.TychoWorker.sayHello(TychoWorker.java:8)
at my.maven.MavenMain.main(MavenMain.java:8)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
```
3. To fix this, you have to define the dependency explicitly. Edit the `pom.xml` file in the `my.maven` project by uncommenting the Guava dependency:```xml
com.google.guava
guava
15.0
```4. Run the build and the application again:
```bash
mvn clean install
java -jar target/my.maven-1.0.0-SNAPSHOT.jar
```
It will display the correct output:
```
{hello=world}
```