caoliuxue / onejar-maven-plugin

Automatically exported from code.google.com/p/onejar-maven-plugin
0 stars 0 forks source link

Cannot add one-jar repo as a proxy repo in Nexus #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Nexus 1.3.4 (latest)
2. Login as admin
3. Click on Repositories
4. Click Add | Proxy Repository
5. Enter "onejar-maven-plugin.googlecode.com" for the "Repository ID" field
6. Enter "http://onejar-maven-plugin.googlecode.com/svn/mavenrepo" for the
"Remote Storage Location" field.  
7. Provide a "onejar repo" in the "Repository Name" field
8. Leave all other fields as defaults and click Save.
9. View the repository list and click on the new onejar repo row. 
10. Notice below there are no files.  Right click on repository row and
select select Expire Cache and Reindex.  They have no effect.  
11. Look at the Nexus logs under "Logs and Config Files" and notice the
exception.  

I think the exception is Nexus is expecting a directory called
"onejar-maven-plugin.googlecode.com" at the URL
"http://onejar-maven-plugin.googlecode.com/svn/mavenrepo".  This is the way
the fest repository works correctly for me with Nexus

What is the expected output? What do you see instead?

A listing of the contents of the one-jar repository in Nexus.

Try installing the fest repository using 

<repository>
            <id>fest</id>
            <url>http://fest.googlecode.com/svn/trunk/fest/m2/repository/</url>
        </repository>

it works fine with Nexus, you can see its repository contents.

What version of the product are you using? On what operating system?

Nexus Version 1.3.4
One-jar 1.4.1

Please provide any additional information below.

Either there is a problem with Nexus or your repository id is not compliant
with your url structure.  Fest works with 

<id>fest</id>
  <url>http://fest.googlecode.com/svn/trunk/fest/m2/repository/</url>

At the url there is a fest directory and I believe Nexus relies on this. 
With the one-jar repo its

 <id>onejar-maven-plugin.googlecode.com</id>
            <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>

But if you go to that url there is no location there that matches the id.

Original issue reported on code.google.com by jonathan...@gtempaccount.com on 12 Jun 2009 at 2:42

GoogleCodeExporter commented 9 years ago
The exception in the Nexus log is 

2009-06-11 21:58:49 INFO  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - 
Trying
to get remote index for repository onejar-maven-plugin
2009-06-11 21:58:49 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   -
Expiring local cache in repository ID='onejar-maven-plugin' from path='/.index'
2009-06-11 21:58:50 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   -
Clearing NFC cache in repository ID='onejar-maven-plugin' from path='/.index'
2009-06-11 21:58:50 WARN  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - 
Cannot
fetch remote index:
java.io.FileNotFoundException: nexus-maven-repository-index.zip (item not found)
    at
org.sonatype.nexus.index.DefaultIndexerManager$1.retrieve(DefaultIndexerManager.
java:714)
    at
org.sonatype.nexus.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultI
ndexUpdater.java:178)
    at
org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(Default
IndexUpdater.java:108)
    at
org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerM
anager.java:724)
    at
org.sonatype.nexus.index.DefaultIndexerManager.updateIndexForRemoteRepository(De
faultIndexerManager.java:596)
    at
org.sonatype.nexus.index.DefaultIndexerManager.downloadRepositoryIndex(DefaultIn
dexerManager.java:563)
    at
org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerM
anager.java:477)
    at
org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerM
anager.java:433)
    at org.sonatype.nexus.DefaultNexus.reindexRepository(DefaultNexus.java:1324)
    at org.sonatype.nexus.tasks.ReindexTask.doRun(ReindexTask.java:40)
    at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:139)
    at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:342)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
ScheduledThreadPoolExecutor.java:98)
    at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedul
edThreadPoolExecutor.java:207)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

Original comment by jonathan...@gtempaccount.com on 12 Jun 2009 at 2:43

GoogleCodeExporter commented 9 years ago
Hi Jonathan,

Thank you so much for the detailed step-by-step instructions! It really does 
make a
big difference.

I did exactly as you wrote, and also added the fest repo. While doing that, I 
also
made sure my ~/.m2/repository/ was wiped, and that I did not run any maven 
builds
against the nexus server at that time.

What I got was two empty repos, just like you describe the onejar repo was 
empty for
you. The fest repo was not filled with anything on my nexus server.

The Nexus log messages suggest that it looks for a certain .index directory in 
the
root of any new repository, and hopes to find an index zip file there. I have 
not
seen a .index directory like that in any public repos except those run on Nexus
servers. Therefore I think the behavior I experienced was the correct one, 
given that
neither onejar-maven-plugin repo nor fest repo has a .index directory in their 
roots.

My guess is, and this is just a guess, that you may have built something with 
maven
which uses fest artifacts, after having set up the fest repo on your Nexus 
server(?).
Any such build will help populate part of Nexus' proxy repo.

I tried that with my onejar repo afterwards, and it worked that way; it was 
populated
with what my maven build asked Nexus for. The screenshot attachment shows what 
my
onejar proxy repo looks like in Nexus after I started using it.

Can you please verify this, or verify the opposite?

/Hugo

Original comment by hugo.josefson.old@gmail.com on 12 Jun 2009 at 6:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by hugo.josefson.old@gmail.com on 12 Jun 2009 at 6:58

GoogleCodeExporter commented 9 years ago
To truly verify if the proxied repo works with nexus you should try downloading 
an
onejar-maven-plugin artifact.

The stack trace indicates that the nexus index isn't available, which isn't that
unusual since this isn't a nexus hosted repo, nor is the index being generated 
and
uploaded separately.  When adding a new repo in nexus the default is to 
download the
index.  You can turn that off and I suspect this message will go away.

BTW: Sonatype, the authors of Nexus, also offer hosting/distribution of Open 
Source
Maven based artifacts if you want to use them as your repo instead of taking up 
space
on your goggle code project.  The repo is at http://oss.sonatype.org/index.html 
and I
believe you file a request at https://issues.sonatype.org/browse/OSSRH .

Original comment by basil.wh...@gmail.com on 6 Jul 2009 at 3:09

GoogleCodeExporter commented 9 years ago
I found the documentation for using the Sonatype OSS repo for hosting artifacts:
https://docs.sonatype.com/display/NX/OSS+Repository+Hosting

Original comment by basil.wh...@gmail.com on 7 Jul 2009 at 5:42

GoogleCodeExporter commented 9 years ago
Closing, due to inactivity.

Original comment by hugo.josefson.old@gmail.com on 6 Oct 2010 at 8:51

GoogleCodeExporter commented 9 years ago
It would be great if this worked with nexus.. it really should be able to.   I 
can browse the repo structure, but no jars show up when i do the search.   The 
lack of a nexus index isn't important from what i can tell, something else is 
amiss.

Original comment by david.c....@gmail.com on 23 Oct 2010 at 11:02