Use artifactory to build an internal maven2 Server

Source: Internet
Author: User
Tags jfrog artifactory
Www.jfrog.orgsitesjfrogindex.html download the latest zip package (built-in jetty) download and decompress artifactory. The directory structure is as follows: backup-Warehouse backup. You can use the cron expression to set the backup policy. The quartz scheduled scheduling program runs the backup task at the specified time.

Visit the http://www.jfrog.org/sites/jfrog/index.html to download the latest zip package (built-in jetty) to download and decompress the artifactory. The directory structure is as follows: backup-Warehouse backup. You can use the cron expression to set the backup policy. The quartz scheduled scheduling program runs the backup task at the specified time.

Http://www.jfrog.org/sites/jfrog/index.html access

Download the latest zip package (built-in jetty)

Download and decompress artifactory. The directory structure is as follows:

Xml Code

       
        
        
          
               
    
     private-internal-repository
                
    
     Private internal repository
                
    
     true
                
    
     true
            
           
               
    
     3rd-party
                
    
     3rd party jars added manually
                
    
     true
                
    
     false
            
         
        
          
               
    
     ibiblio
                
    
     true
                
    
     false
                
    
     org/artifactory/**,org/jfrog/**
                
    
     http://repo1.maven.org/maven2
            
         
    
 


Start Tomcat and enter http: // localhost: 8080/artifactor


The following is the homepage of artifactory:

Xml Code

         
                
   
    dev
                 
                       
    
     C:/InstalledPrograms/apache-tomcat-5.5.20
                  
                 
                       
                              
     
      central
                               
     
      http://localhost:8080/artifactory/repo
                               
                                     
      
       false
                                
                         
                        
                              
     
      snapshots
                               
     
      http://localhost:8080/artifactory/repo
                               
                                     
      
       false
                                
                         
                  
                 
                       
                              
     
      central
                               
     
      http://localhost:8080/artifactory/repo
                               
                                     
      
       false
                                
                         
                        
                              
     
      snapshots
                               
     
      http://localhost:8080/artifactory/repo
                               
                                     
      
       false
                                
                         
                  
           
    
 


Configure Maven using pom. xml


You can also set the repository in the pom. xml file of the project. The following is the pom. xml sample file:

Xml Code

   
  
   4.0.0
    
  
   test
    test  
  
   jar
    
  
   1.0-SNAPSHOT
    
  
   test
    
  
   http://maven.apache.org
           
                          
                                   
    
     central
                            
    
     http://localhost:8080/artifactory/repo
                            
                                    
     
      false
                             
                    
                   
                           
    
     snapshots
                            
    
     http://localhost:8080/artifactory/repo
                            
                                    
     
      false
                             
                    
           
          
                  
                           
    
     central
                            
    
     http://localhost:8080/artifactory/repo
                            
                                    
     
      false
                             
                    
                   
                           
    
     snapshots
                            
    
     http://localhost:8080/artifactory/repo
                            
                                    
     
      false
                             
                    
           
    
       
          
    
     junit
           junit       
    
     3.8.1
           
    
     test
         
     
    
 


Use the default account to log on to the Maven database. Don't talk nonsense. First:

As you can see, Artifactory defines six default repo libraries for US (see the red box above). Of course, you can also add one by yourself. Then each repo database corresponds to its own virtual address (see the red box in the lower right), and there are also a series of major remote database addresses (which is sufficient for general development ).

During the development process, developers can use their Maven clients to request the required packages from the Artifactory server (by configuring the settings of Maven. xml file), we can make Artifactory in Home: Maven Settings to help us generate Maven settings. xml to replace $ {MAVEN_HOME}/conf/settings. xml allows you to start your Maven development journey.

During the release process, we can use the mvn install command to publish the developed package to the local device, and then upload the package to the Artifactory Repo library through the Web UI interface of Artifactory, or through

The above is the basic project development process, next to introduce the main common functions of Artifactory (Official Use documentation can refer to http://wiki.jfrog.org/confluence/display/RTF/Welcome+to+Artifactory! ):

01. Home: Maven Settings

It is mainly used to generate the corresponding settings. xml for developers based on user selection, and supports downloading.

02. Artifacts: Browse: XXX Browser

Tree Browser and Simple Browser are provided here to help you browse all the repo repositories in the system and support deletion. Note: here we can see the repo libraries xxx-releases-xxx and xxx-snapshots-xxx. I suggest you put some of the libraries generated in development under snapshots, the formal library is placed under releases, so that the layers are clearer.

03. Artifacts: Browse: Builds

Shows Builds information for all projects integrated with CI tools, see http://wiki.jfrog.org/confluence/display/RTF/Build+Integration.

04. Artifacts: Search: XXX Search

The powerful Search function supports Quick Search/Class Search/GAVC Search/POM & XML Search to quickly and conveniently Search and locate library packages.

05. Deploy: Single Artifact

A separate Artifact package is generally divided into two steps, first upload a package to Artifactory, and then fill in the package information you need (you can view this information under the jar package's META-INF ). In addition, we can also use the command line (for example, mvn-e deploy: deploy-file-DgroupId = com. mycompany-DartifactId = my-app-Dversion = 1.0-SNAPSHOT-Dpackaging = jar-Dfile = target/my-app-1.0-SNAPSHOT.jar-DrepositoryId = snapshots-Durl = http: // 192.168.1.11: 8081/artifactory/libs-snapshots-local) to directly release the package, of course, you must configure Maven settings before doing this. in the xml configuration file, enter the correct user and password. Note: If a 400 error occurs, it indicates that the address you passed is incorrect. For example, in the preceding example, if http: // 192.168.1.11: 8081/artifactory/libs-snapshots is used, because this is the Alias address, Deploy must use the original address.

06. Deploy: Artifacts Bundle

To upload multiple Artifacts packages, You Need To package these packages into a ZIP file. The structure is as follows:

07. Admin: Configuration: General

Common configurations, such as server address, File Upload restrictions, and appearance settings.

08. Admin: Configuration: Repositories

This mainly adjusts the priority sorting of existing Repositories, which can be kept by default.

09. Admin: Configuration: Proxies

Configure proxy for remote repo library.

10. Admin: Security: General

Whether anonymous user access is allowed.

11. Admin: Security: Users

User Management: You can add common users or administrator users. Artifactory's user management mechanism is similar to Unix systems and can be grouped. It also supports importing data from LDAP.

12. Admin: Security: Groups

User Group Management: You can create multiple groups to facilitate user classification and apply them to RBAC (role-based access control) Permission control mechanisms.

13. Admin: Security: Permissions

You can set different user or group permissions for different repo, and then check whether the permissions are correct in Artifact: Browser.

14. Admin: Services: Backups

You can set scheduled backup. The backup file will be saved in $ ARTIFACTORY_HOME/backup/

15. Admin: Services: Indexer

A major improvement of the new version, supporting index files in Nexus format, can be used in multiple mainstream Java development software including IDEA, NetBeans, Eclipse, etc, but you must know that the Artifactory index does not depend on Nexus.

16. Admin: Import & Export: Repositories

The import/export function of the Repo Library supports ZIP format. By the way, the File Browser here is good.

17. Admin: Import & Export: System

System-level import/export functions to back up/import the entire Artifactory System

18. Admin: Advanced: XXX

This section describes other functions, such as system log analysis. You can also directly edit the generated Artifactory system configuration file (if you are familiar with Artifactory ), there is also an Acl configuration file for Security permission settings.

The above is the content of setting up the internal server of maven2 using artifactory. For more information, see PHP Chinese Network (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.