how to access nexus feeds in my-new-nexus-plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to access nexus feeds in my-new-nexus-plugin

StephanWeber

Hi,

I'm writing a nexus plugin and want to use the feed

"recentlyDeployedArtifacts"). I tried

    ..

    @Requirement(role = FeedSource.class, hint =

"recentlyDeployedArtifacts")

    private RecentDeployedArtifactFeedSource

recentDeployedArtifactFeedSource;

    ..

This fails on nexus startup with Sisu - Error injecting:

com.sap.ldi.nexus.reposearch.plugin.RepositorySearchResource

java.lang.NoClassDefFoundError:

Lorg/sonatype/nexus/rest/feeds/sources/RecentDeployedArtifactFeedSource;

 

Even

    ..

    @Requirement(role = FeedSource.class)

    private Map<String, FeedSource> feeds;

    ..

fails with a Guice configuration error "Type

org.sonatype.nexus.rest.feeds.sources.FeedSource not present"

 

 

I already succeeded to access the "Walker" and the "RepositoryURLBuilder"

with my nexus-plugin by using

    @Requirement(hint = "RestletRepositoryUrlBuilder")

    private RepositoryURLBuilder repositoryURLBuilder;

    @Requirement

    private Walker walker;

 

How can I access the feeds, e.g. "recentlyDeployedArtifacts"?

Many thanks, Stephan

 

Reply | Threaded
Open this post in threaded view
|

Re: how to access nexus feeds in my-new-nexus-plugin

Tamás Cservenák
Hi Stephan,

the components you successfully accessed are all in Core (accessible by default to any plugin), while the feeds are in plugin.

Most likely, you need to declare a dependency on the nexus-timeline-plugin (where the feeds are)....

Add a dependency like this to your plugin POM:

    <dependency>
      <groupId>org.sonatype.nexus.plugins</groupId>
      <artifactId>nexus-timeline-plugin</artifactId>
      <type>nexus-plugin</type>
      <version>2.3.0</version>
      <scope>provided</scope>
    </dependency>


Note: please double-check values above, I wrote them from top of my head....


HTH,
~t~


On Mon, Apr 15, 2013 at 4:27 PM, Weber, Stephan <[hidden email]> wrote:

Hi,

I'm writing a nexus plugin and want to use the feed

"recentlyDeployedArtifacts"). I tried

    ..

    @Requirement(role = FeedSource.class, hint =

"recentlyDeployedArtifacts")

    private RecentDeployedArtifactFeedSource

recentDeployedArtifactFeedSource;

    ..

This fails on nexus startup with Sisu - Error injecting:

com.sap.ldi.nexus.reposearch.plugin.RepositorySearchResource

java.lang.NoClassDefFoundError:

Lorg/sonatype/nexus/rest/feeds/sources/RecentDeployedArtifactFeedSource;

 

Even

    ..

    @Requirement(role = FeedSource.class)

    private Map<String, FeedSource> feeds;

    ..

fails with a Guice configuration error "Type

org.sonatype.nexus.rest.feeds.sources.FeedSource not present"

 

 

I already succeeded to access the "Walker" and the "RepositoryURLBuilder"

with my nexus-plugin by using

    @Requirement(hint = "RestletRepositoryUrlBuilder")

    private RepositoryURLBuilder repositoryURLBuilder;

    @Requirement

    private Walker walker;

 

How can I access the feeds, e.g. "recentlyDeployedArtifacts"?

Many thanks, Stephan

 


Reply | Threaded
Open this post in threaded view
|

RE: how to access nexus feeds in my-new-nexus-plugin

StephanWeber

Wow. What a fast answer! Thank You!

Hmm, I already have this dependency in my pom:

:

                <nexus.version>2.3.0-04</nexus.version>

       :

       <!-- This dependency is for accessing nexus feeds -->

<dependency>

              <groupId>org.sonatype.nexus.plugins</groupId>

             <artifactId>nexus-timeline-plugin</artifactId>

             <version>${nexus.version}</version> where

             <scope>provided</scope>

       </dependency>

:

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tamás Cservenák
Sent: Montag, 15. April 2013 16:35
To: [hidden email]
Subject: Re: [nexus-dev] how to access nexus feeds in my-new-nexus-plugin

 

Hi Stephan,

 

the components you successfully accessed are all in Core (accessible by default to any plugin), while the feeds are in plugin.

 

Most likely, you need to declare a dependency on the nexus-timeline-plugin (where the feeds are)....

 

Add a dependency like this to your plugin POM:

 

    <dependency>

      <groupId>org.sonatype.nexus.plugins</groupId>

      <artifactId>nexus-timeline-plugin</artifactId>

      <type>nexus-plugin</type>

      <version>2.3.0</version>

      <scope>provided</scope>

    </dependency>

 

 

Note: please double-check values above, I wrote them from top of my head....

 

 

HTH,

~t~

 

On Mon, Apr 15, 2013 at 4:27 PM, Weber, Stephan <[hidden email]> wrote:

Hi,

I'm writing a nexus plugin and want to use the feed

"recentlyDeployedArtifacts"). I tried

    ..

    @Requirement(role = FeedSource.class, hint =

"recentlyDeployedArtifacts")

    private RecentDeployedArtifactFeedSource

recentDeployedArtifactFeedSource;

    ..

This fails on nexus startup with Sisu - Error injecting:

com.sap.ldi.nexus.reposearch.plugin.RepositorySearchResource

java.lang.NoClassDefFoundError:

Lorg/sonatype/nexus/rest/feeds/sources/RecentDeployedArtifactFeedSource;

 

Even

    ..

    @Requirement(role = FeedSource.class)

    private Map<String, FeedSource> feeds;

    ..

fails with a Guice configuration error "Type

org.sonatype.nexus.rest.feeds.sources.FeedSource not present"

 

 

I already succeeded to access the "Walker" and the "RepositoryURLBuilder"

with my nexus-plugin by using

    @Requirement(hint = "RestletRepositoryUrlBuilder")

    private RepositoryURLBuilder repositoryURLBuilder;

    @Requirement

    private Walker walker;

 

How can I access the feeds, e.g. "recentlyDeployedArtifacts"?

Many thanks, Stephan

 

 

Reply | Threaded
Open this post in threaded view
|

Re: how to access nexus feeds in my-new-nexus-plugin

Tamás Cservenák
No, you don't. Note the _type_ of dep I wrote....


On Mon, Apr 15, 2013 at 4:41 PM, Weber, Stephan <[hidden email]> wrote:

Wow. What a fast answer! Thank You!

Hmm, I already have this dependency in my pom:

:

                <nexus.version>2.3.0-04</nexus.version>

       :

       <!-- This dependency is for accessing nexus feeds -->

<dependency>

              <groupId>org.sonatype.nexus.plugins</groupId>

             <artifactId>nexus-timeline-plugin</artifactId>

             <version>${nexus.version}</version> where

             <scope>provided</scope>

       </dependency>

:

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tamás Cservenák
Sent: Montag, 15. April 2013 16:35
To: [hidden email]
Subject: Re: [nexus-dev] how to access nexus feeds in my-new-nexus-plugin

 

Hi Stephan,

 

the components you successfully accessed are all in Core (accessible by default to any plugin), while the feeds are in plugin.

 

Most likely, you need to declare a dependency on the nexus-timeline-plugin (where the feeds are)....

 

Add a dependency like this to your plugin POM:

 

    <dependency>

      <groupId>org.sonatype.nexus.plugins</groupId>

      <artifactId>nexus-timeline-plugin</artifactId>

      <type>nexus-plugin</type>

      <version>2.3.0</version>

      <scope>provided</scope>

    </dependency>

 

 

Note: please double-check values above, I wrote them from top of my head....

 

 

HTH,

~t~

 

On Mon, Apr 15, 2013 at 4:27 PM, Weber, Stephan <[hidden email]> wrote:

Hi,

I'm writing a nexus plugin and want to use the feed

"recentlyDeployedArtifacts"). I tried

    ..

    @Requirement(role = FeedSource.class, hint =

"recentlyDeployedArtifacts")

    private RecentDeployedArtifactFeedSource

recentDeployedArtifactFeedSource;

    ..

This fails on nexus startup with Sisu - Error injecting:

com.sap.ldi.nexus.reposearch.plugin.RepositorySearchResource

java.lang.NoClassDefFoundError:

Lorg/sonatype/nexus/rest/feeds/sources/RecentDeployedArtifactFeedSource;

 

Even

    ..

    @Requirement(role = FeedSource.class)

    private Map<String, FeedSource> feeds;

    ..

fails with a Guice configuration error "Type

org.sonatype.nexus.rest.feeds.sources.FeedSource not present"

 

 

I already succeeded to access the "Walker" and the "RepositoryURLBuilder"

with my nexus-plugin by using

    @Requirement(hint = "RestletRepositoryUrlBuilder")

    private RepositoryURLBuilder repositoryURLBuilder;

    @Requirement

    private Walker walker;

 

How can I access the feeds, e.g. "recentlyDeployedArtifacts"?

Many thanks, Stephan

 

 


Reply | Threaded
Open this post in threaded view
|

RE: how to access nexus feeds in my-new-nexus-plugin

StephanWeber

Yep. That worked. You’re the best! ;-)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tamás Cservenák
Sent: Montag, 15. April 2013 16:52
To: [hidden email]
Subject: Re: [nexus-dev] how to access nexus feeds in my-new-nexus-plugin

 

No, you don't. Note the _type_ of dep I wrote....

 

On Mon, Apr 15, 2013 at 4:41 PM, Weber, Stephan <[hidden email]> wrote:

Wow. What a fast answer! Thank You!

Hmm, I already have this dependency in my pom:

:

                <nexus.version>2.3.0-04</nexus.version>

       :

       <!-- This dependency is for accessing nexus feeds -->

<dependency>

              <groupId>org.sonatype.nexus.plugins</groupId>

             <artifactId>nexus-timeline-plugin</artifactId>

             <version>${nexus.version}</version> where

             <scope>provided</scope>

       </dependency>

:

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tamás Cservenák
Sent: Montag, 15. April 2013 16:35
To: [hidden email]
Subject: Re: [nexus-dev] how to access nexus feeds in my-new-nexus-plugin

 

Hi Stephan,

 

the components you successfully accessed are all in Core (accessible by default to any plugin), while the feeds are in plugin.

 

Most likely, you need to declare a dependency on the nexus-timeline-plugin (where the feeds are)....

 

Add a dependency like this to your plugin POM:

 

    <dependency>

      <groupId>org.sonatype.nexus.plugins</groupId>

      <artifactId>nexus-timeline-plugin</artifactId>

      <type>nexus-plugin</type>

      <version>2.3.0</version>

      <scope>provided</scope>

    </dependency>

 

 

Note: please double-check values above, I wrote them from top of my head....

 

 

HTH,

~t~

 

On Mon, Apr 15, 2013 at 4:27 PM, Weber, Stephan <[hidden email]> wrote:

Hi,

I'm writing a nexus plugin and want to use the feed

"recentlyDeployedArtifacts"). I tried

    ..

    @Requirement(role = FeedSource.class, hint =

"recentlyDeployedArtifacts")

    private RecentDeployedArtifactFeedSource

recentDeployedArtifactFeedSource;

    ..

This fails on nexus startup with Sisu - Error injecting:

com.sap.ldi.nexus.reposearch.plugin.RepositorySearchResource

java.lang.NoClassDefFoundError:

Lorg/sonatype/nexus/rest/feeds/sources/RecentDeployedArtifactFeedSource;

 

Even

    ..

    @Requirement(role = FeedSource.class)

    private Map<String, FeedSource> feeds;

    ..

fails with a Guice configuration error "Type

org.sonatype.nexus.rest.feeds.sources.FeedSource not present"

 

 

I already succeeded to access the "Walker" and the "RepositoryURLBuilder"

with my nexus-plugin by using

    @Requirement(hint = "RestletRepositoryUrlBuilder")

    private RepositoryURLBuilder repositoryURLBuilder;

    @Requirement

    private Walker walker;

 

How can I access the feeds, e.g. "recentlyDeployedArtifacts"?

Many thanks, Stephan