Clone wiki

jnuget / Home

Nuget java storage

Installation:

  1. Create ENV variable NUGET_HOME, contains folder where JNuget store config files.
  2. Download and install Java 1.7 or later
  3. Download and install Apache Tomcat 7 or later
  4. Deploy WAR into Tomcat
  5. Edit config files in NUGET_HOME

jnuget.users.xml

<users>
    <user name="admin" password="adminadmin">
        <role>jnuget-admin</role>
    </user>   
</users>

jnuget.config.xml

<options>    
    <storages>
        <storage class="ru.aristar.jnuget.sources.ClassicPackageSource" indexed="false" storageName="DefaultSource" 
                 public="true" canPush="true" canDelete="true" >
            <properties>
                <property name="folderName" value="${nuget.home}/Packages/"/>
            </properties>
        </storage>
    </storages>
</options>

Available packagesource types

  1. ClassicPackageSource - simple store packages in one folder
  2. MavenStylePackageSource - hierarchical folder structure
  3. RemotePackageSource - remote storage (central)
  4. ProxyPackageSource - remote storage + cache packages on local drive
  5. PackageSourceGroup - group of the package sources

MavenStylePackageSource

<storage class="ru.aristar.jnuget.sources.MavenStylePackageSource" indexed="false" storageName="MavenSource" public="true">
    <properties>
        <property name="rootFolderName" value="${nuget.home}/Maven/"/>
    </properties>
</storage>

RemotePackageSource

<storage class="ru.aristar.jnuget.sources.RemotePackageSource" indexed="false" storageName="RemoteSource" public="true">
    <properties>
        <property name="url" value="https://nuget.org/api/v2/"/>
        <property name="apiKey" value="34567893456789034567890"/>
    </properties>
</storage>

ProxyPackageSource

<storage class="ru.aristar.jnuget.sources.ProxyPackageSource" indexed="true" storageName="ProxySource" public="true">
    <properties>
        <property name="folderName" value="${nuget.home}/Proxy/"/>
        <property name="url" value="https://nuget.org/api/v2/"/>
    </properties>
</storage>

Big example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<options>
    <proxy useSystemProxy="false" noProxy="false">
	<host>192.168.1.1</host>
        <port>3128</port>
	<login>guest</login>
	<password>guest</password>
    </proxy> 
    <storages>
	<storage class="ru.aristar.jnuget.sources.ClassicPackageSource" 
                 saveIndex="true" indexed="true" canPush="true" 
                 canDelete="true" schedule="*/5 * * * *" 
                 storageName="Old" public="true">
	      <properties>
	            <property name="folderName" value="${nuget.home}/Classic/"/>
	      </properties>
        </storage>

	<storage class="ru.aristar.jnuget.sources.ProxyPackageSource" 
                 saveIndex="true" indexed="true" 
                 schedule="0 10 * * *"  
                 canPush="false" canDelete="false" 
                 storageName='Central' public="true">
	     <properties>
		 <property name="folderName" value="${nuget.home}/Proxy/"/>
		 <property name="url" value="https://nuget.org/api/v2/"/>
	     </properties>
	</storage>

	<storage class="ru.aristar.jnuget.sources.MavenStylePackageSource" 
                 canPush="true" saveIndex="true" 
                 indexed="true" schedule="*/30 * * * *" 
                 storageName="Maven" public="true">
		<properties>
			<property name="rootFolderName" value="${nuget.home}/Maven/"/>
		</properties>
	</storage>

	<storage class="ru.aristar.jnuget.sources.PackageSourceGroup" 
                 indexed="false" canPush="false" canDelete="false" 
                 storageName='All' public="true">
		<properties>
			<property name="innerSourceNames"value="Old"/>  
                        <property name="innerSourceNames" value="Local"/>
			<property name="innerSourceNames" value="Central"/>
		</properties>
	</storage>
    </storages>
</options>

Updated