]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1538] Managed Repositories > Show Snippet ought to include a pluginRepositories...
authorOlivier Lamy <olamy@apache.org>
Tue, 25 Oct 2011 21:16:58 +0000 (21:16 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 25 Oct 2011 21:16:58 +0000 (21:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1188916 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/tags/CopyPasteSnippetTag.java

index 6f2467359ac6c4ae28f6d346390978c2dd980bd1..ba2afa9dc21a07f54a0bf503e96510a5aa1cff01 100644 (file)
@@ -171,6 +171,30 @@ public class CopyPasteSnippetTag
         snippet.append( "      </snapshots>\n" );
         snippet.append( "    </repository>\n" );
         snippet.append( "  </repositories>\n" );
+        snippet.append( "  <pluginRepositories>\n" );
+        snippet.append( "    <pluginRepository>\n" );
+        snippet.append( "      <id>" ).append( repo.getId() ).append( "</id>\n" );
+        snippet.append( "      <name>" ).append( repo.getName() ).append( "</name>\n" );
+
+        snippet.append( "      <url>" );
+        snippet.append( ContextUtils.getBaseURL( pageContext, "repository" ) );
+        snippet.append( "/" ).append( repo.getId() ).append( "/" );
+
+        snippet.append( "</url>\n" );
+
+        if ( !"default".equals( repo.getLayout() ) )
+        {
+            snippet.append( "      <layout>" ).append( repo.getLayout() ).append( "</layout>\n" );
+        }
+
+        snippet.append( "      <releases>\n" );
+        snippet.append( "        <enabled>" ).append( Boolean.valueOf( repo.isReleases() ) ).append( "</enabled>\n" );
+        snippet.append( "      </releases>\n" );
+        snippet.append( "      <snapshots>\n" );
+        snippet.append( "        <enabled>" ).append( Boolean.valueOf( repo.isSnapshots() ) ).append( "</enabled>\n" );
+        snippet.append( "      </snapshots>\n" );
+        snippet.append( "    </pluginRepository>\n" );
+        snippet.append( "  </pluginRepositories>\n" );
 
         snippet.append( "  ...\n" );
         snippet.append( "</project>\n" );