Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Sisu/LegacyMigration"
m |
m |
||
Line 7: | Line 7: | ||
<groupId>org.sonatype.sisu</groupId> | <groupId>org.sonatype.sisu</groupId> | ||
<artifactId>sisu-inject-bean</artifactId> | <artifactId>sisu-inject-bean</artifactId> | ||
− | <version>2.5. | + | <version>2.5.1</version> |
</dependency> | </dependency> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 15: | Line 15: | ||
<groupId>org.sonatype.sisu</groupId> | <groupId>org.sonatype.sisu</groupId> | ||
<artifactId>sisu-inject-plexus</artifactId> | <artifactId>sisu-inject-plexus</artifactId> | ||
− | <version>2.5. | + | <version>2.5.1</version> |
</dependency> | </dependency> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 23: | Line 23: | ||
<h1>Change imports</h1> | <h1>Change imports</h1> | ||
− | Once you have upgraded to Sonatype/Sisu 2.5. | + | Once you have upgraded to Sonatype/Sisu 2.5.x you can start migrating to the new API. In most cases this just involves changing imports: |
{| width="50%" border="1" style="border-collapse:collapse;padding:5px 10px;color:black;" cellspacing="0" cellpadding="5" | {| width="50%" border="1" style="border-collapse:collapse;padding:5px 10px;color:black;" cellspacing="0" cellpadding="5" | ||
Line 80: | Line 80: | ||
<groupId>org.sonatype.sisu</groupId> | <groupId>org.sonatype.sisu</groupId> | ||
<artifactId>sisu-guice</artifactId> | <artifactId>sisu-guice</artifactId> | ||
− | <version>3.1. | + | <version>3.1.6</version> |
</dependency> | </dependency> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 88: | Line 88: | ||
<groupId>org.eclipse.sisu</groupId> | <groupId>org.eclipse.sisu</groupId> | ||
<artifactId>org.eclipse.sisu.inject</artifactId> | <artifactId>org.eclipse.sisu.inject</artifactId> | ||
− | <version>0.1. | + | <version>0.1.1</version> |
</dependency> | </dependency> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 96: | Line 96: | ||
<groupId>org.eclipse.sisu</groupId> | <groupId>org.eclipse.sisu</groupId> | ||
<artifactId>org.eclipse.sisu.plexus</artifactId> | <artifactId>org.eclipse.sisu.plexus</artifactId> | ||
− | <version>0.1. | + | <version>0.1.1</version> |
</dependency> | </dependency> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
If you find that some components are missing at runtime, it could be that you are relying on a library that still requires the old Sonatype/Sisu API. To confirm this turn on trace logging for Sisu; you can either use the <code>sisu.debug</code> system property to send Sisu trace logging to the console, or alternatively set the logging level for the 'Sisu' logger to trace. Any components that couldn't be loaded at runtime because of missing types will be logged under "Problem scanning...". | If you find that some components are missing at runtime, it could be that you are relying on a library that still requires the old Sonatype/Sisu API. To confirm this turn on trace logging for Sisu; you can either use the <code>sisu.debug</code> system property to send Sisu trace logging to the console, or alternatively set the logging level for the 'Sisu' logger to trace. Any components that couldn't be loaded at runtime because of missing types will be logged under "Problem scanning...". |
Revision as of 23:20, 2 December 2013
Upgrade
The latest releases of Sonatype/Sisu are actually runtime wrappers that translate and delegate calls to their Eclipse/Sisu dependencies:
<dependency> <groupId>org.sonatype.sisu</groupId> <artifactId>sisu-inject-bean</artifactId> <version>2.5.1</version> </dependency>
<dependency> <groupId>org.sonatype.sisu</groupId> <artifactId>sisu-inject-plexus</artifactId> <version>2.5.1</version> </dependency>
This enables you to migrate gradually to the new API by mixing new components and libraries with those written against the old API.
Change imports
Once you have upgraded to Sonatype/Sisu 2.5.x you can start migrating to the new API. In most cases this just involves changing imports:
Old package | New package |
---|---|
org.sonatype.inject | org.eclipse.sisu |
org.sonatype.guice.bean.binders | org.eclipse.sisu.wire org.eclipse.sisu.space |
org.sonatype.guice.bean.containers | org.eclipse.sisu.launch |
org.sonatype.guice.bean.converters | org.eclipse.sisu.wire |
org.sonatype.guice.bean.inject | org.eclipse.sisu.bean |
org.sonatype.guice.bean.locators | org.eclipse.sisu.inject |
org.sonatype.guice.bean.locators.spi | org.eclipse.sisu.inject |
org.sonatype.guice.bean.reflect | org.eclipse.sisu.inject org.eclipse.sisu.bean org.eclipse.sisu.space |
org.sonatype.guice.bean.scanners.index | org.eclipse.sisu.space |
org.sonatype.guice.bean.scanners | org.eclipse.sisu.space |
org.sonatype.guice.plexus.annotations | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.binders | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.config | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.converters | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.lifecycles | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.locators | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.scanners | org.eclipse.sisu.plexus |
org.sonatype.guice.plexus.shim | org.eclipse.sisu.plexus |
All the old types have been marked as deprecated to help identify which components you need to upgrade.
Check bindings
After upgrading and changing imports the last migration step is to see if your app works as expected when you swap the legacy Sisu wrapper with Eclipse/Sisu:
<!-- | Guice is now a provided dependency of Eclipse/Sisu to make it easier to | switch in other variants (classic vs no-AOP) without needing exclusions --> <dependency> <groupId>org.sonatype.sisu</groupId> <artifactId>sisu-guice</artifactId> <version>3.1.6</version> </dependency>
<dependency> <groupId>org.eclipse.sisu</groupId> <artifactId>org.eclipse.sisu.inject</artifactId> <version>0.1.1</version> </dependency>
<dependency> <groupId>org.eclipse.sisu</groupId> <artifactId>org.eclipse.sisu.plexus</artifactId> <version>0.1.1</version> </dependency>
If you find that some components are missing at runtime, it could be that you are relying on a library that still requires the old Sonatype/Sisu API. To confirm this turn on trace logging for Sisu; you can either use the sisu.debug
system property to send Sisu trace logging to the console, or alternatively set the logging level for the 'Sisu' logger to trace. Any components that couldn't be loaded at runtime because of missing types will be logged under "Problem scanning...".