Skip to content

Commit

Permalink
[MNG-6084] Support JSR 250 annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Tran authored and michael-o committed May 25, 2017
1 parent 66fc74d commit a7dddcb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions maven-core/src/main/resources/META-INF/maven/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 98,8 @@ under the License.
<exportedPackage>javax.enterprise.util.*</exportedPackage>
<exportedPackage>javax.enterprise.inject.*</exportedPackage>

<!-- javax.annotation (JSR-250) -->
<exportedPackage>javax.annotation.*</exportedPackage>

<!--
| We may potentially want to export these, but right now I'm not sure that anything Guice specific needs
Expand Down Expand Up @@ -157,6 159,7 @@ under the License.
<exportedArtifact>org.apache.maven.resolver:maven-resolver-impl</exportedArtifact>

<exportedArtifact>javax.inject:javax.inject</exportedArtifact>
<exportedArtifact>javax.annotation:jsr250-api</exportedArtifact>
<exportedArtifact>org.slf4j:slf4j-api</exportedArtifact>
<exportedArtifact>org.fusesource.jansi:jansi</exportedArtifact>

Expand Down
4 changes: 4 additions & 0 deletions maven-embedder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 87,10 @@ under the License.
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 601,9 @@ private PlexusContainer container( CliRequest cliRequest )

ClassRealm containerRealm = setupContainerRealm( cliRequest.classWorld, coreRealm, extClassPath, extensions );

ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld( cliRequest.classWorld ).setRealm(
containerRealm ).setClassPathScanning( PlexusConstants.SCANNING_INDEX ).setAutoWiring( true ).setName(
"maven" );
ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld( cliRequest.classWorld )
.setRealm( containerRealm ).setClassPathScanning( PlexusConstants.SCANNING_INDEX ).setAutoWiring( true )
.setJSR250Lifecycle( true ).setName( "maven" );

Set<String> exportedArtifacts = new HashSet<>( coreEntry.getExportedArtifacts() );
Set<String> exportedPackages = new HashSet<>( coreEntry.getExportedPackages() );
Expand Down Expand Up @@ -697,6 697,7 @@ private List<CoreExtensionEntry> loadCoreExtensions( CliRequest cliRequest, Clas
.setRealm( containerRealm ) //
.setClassPathScanning( PlexusConstants.SCANNING_INDEX ) //
.setAutoWiring( true ) //
.setJSR250Lifecycle( true ) //
.setName( "maven" );

DefaultPlexusContainer container = new DefaultPlexusContainer( cc, new AbstractModule()
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 258,11 @@ under the License.
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
Expand Down

0 comments on commit a7dddcb

Please sign in to comment.