maven download jar URL

http://mvnrepository.com/
http://search.maven.org/


1. maven repository address:

shared repository
http://repo1.maven.org/maven2/
http://repository.jboss.com/maven2 /
http://repository.sonatype.org/content/groups/public/
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/

private repositories
http://repository.codehaus.org/
http://snapshots.repository.codehaus.org/
http://people.apache.org/repo/m2-snapshot-repository
http://people.apache.org/repo/m2-incubating-repository/

can also build My own maven warehouse: private server, the construction method is as follows:
http://juvenshun.javaeye.com/blog/349534
2. The collected external warehouse address
http://www.ibiblio.org/maven/mule/dependencies/maven2 /

Attachment: Construction of Maven warehouse
Visit http://nexus.sonatype.org/downloads/ to download Nexus.
   Start Nexus, is to start a web server, its default address is localhost:8081. Nexus runs in a servlet container called Jetty, which is started using a local service wrapper called Tanuki Java Service Wrapper. This service wrapper can be configured to run Nexus as a Windows service or as a Unix daemon thread. To start Nexus, you need to find the appropriate startup script for your platform. To see a list of available platforms, view the contents of the ${NEXUS_HOME}/bin/jsw directory.
   The executable file is under %nexus installation directory%\nexus-webapp-1.0.0\binjsw\windows-x86-32:
   InstallNexus.bat/UninstallNexus.bat is to install/uninstall nexus as a windows service.
   Nexus.bat is to start Nexus directly from the command line. If you do not want to install Nexus as a windows service, you can use this file to manually control the startup and exit of Nexus.
1. Configure nexus
   to log in first, the default address is http://localhost:8081/nexus/, and the default username and password are admin/admin123.
    By default, nexus disables the remote index download function. How to open:
    Click Repositories under the Administration menu, and put these three warehouses Apache Snapshots, Codehaus Snapshots, Maven Central
    Download Remote Indexes is modified to true. Then right-click on the three warehouses and select Re-index, so that Nexus will download the remote index file.
2. Manage
repositories Log in as an administrator user and click on Repositories under Administration in the left navigation menu. Nexus offers three different repositories.
(1) Proxy warehouse
A proxy warehouse is an agent to a remote warehouse. By default, Nexus ships with proxy repositories configured as follows:
Apache Snapshots
This repository contains snapshot versions from the Apache Software Foundation. http://people.apache.org/repo/m2-snapshot-repository
Codehaus Snapshots
This repository contains snapshot versions from Codehaus. http://snapshots.repository.codehaus.org/
Central Maven Repository
This is the central Maven repository (release version). http://repo1.maven.org/maven2/
(2) Host repository
A host repository is a repository hosted by Nexus. Maven comes with a host repository configured as follows.
The 3rd Party
host repository should be used to store third-party dependencies that are not found in the public Maven repository. Examples of such dependencies are: your organization's use of commercial, proprietary class libraries such as the Oracle JDBC driver.
Releases
This host repository is where your organization publishes internal releases.
The Snapshots
host repository is where your organization publishes internal snapshot versions.
(3) Virtual warehouse
A virtual warehouse exists as an adapter for Maven 1. Nexus comes with a central-m1 virtual repository3
. Manage groups
Groups are a powerful feature of Nexus, which allow you to combine multiple repositories in a single URL. Nexus comes with two groups: public and public-snapshots. The public group combines three host repositories: 3rd Party, Releases, and Snapshots, as well as the central Maven repository. The public-snapshots group combines the Apache Snapshots and Codehaus Snapshots repositories.
4. To configure maven
to let maven use Nexus as a repository, modify ~/.m2/settings.xml.
Xml code
<profiles>
   <profile>
     <id>nexus</id>
     <repositories>
       <repository>
           <id>nexus< /id>
           <name>local private nexus</name>
           <url>http://localhost:
       </repository>
     </repositories>
   </profile>
   <profile>
     <id>nexus-snapshots</id>
     <repositories>
       <repository>
           <id>nexus-snapshots</id>
           <name>local private nexus snapshots</name>
           <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
       </repository>
     </repositories>
   </profile>
</profiles>
<activeProfiles>
    <activeProfile>nexus</activeProfile>
    <activeProfile>nexus-snapshots</activeProfile>
</activeProfiles>
5. Deploy artifacts to Nexus
   To deploy artifacts to Nexus, provide the repository URL in distributionManagement, then run mvn deploy. Maven will push the project POM and artifacts to your Nexus installation via a simple HTTP PUT. You need to configure the repository in the distributionManagement section of your project POM.
Xml code
<distributionManagement>
<repository>
    <id>releases</id>
    <name>Internal Releases</name>
    <url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository >
<snapshotRepository>
    <id>Snapshots</id>
    <name>Internal Snapshots</name>
    <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement >
This is not over yet, if the deployment will report an error at this time, it will be added in ~/.


<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>Snapshots</id>
<username>admin</username>
<password> admin123</password>
</server>
Deploy 3rd party artifacts:
The artifact might be a JDBC driver for a private database such as Oracle, or you depend on another JAR that is neither open source nor freely available. In this case, you need to manually fetch these artifacts and publish them to your own repository. Nexus provides hosted "third-party" repositories for this purpose.
Publish the file to Nexus using the following command:
Java code
mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc14
-Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar  
-Durl=http: //localhost:  


By default, Nexus listens on port 8081. You can change this port by changing the value of ${NEXUS_HOME}/conf/plexus.properties. To do this, stop Nexus, change the value of applicationPort in the file, and restart Nexus.
7.Maven Profiles
   The profile in Maven is a set of optional configurations that can be used to set or override configuration defaults. With profiles, you can customize builds for different environments. A profile can be configured in pom.xml and given an id. Then you can use command-line flags when running Maven to tell Maven to run goals in a specific profile. The following pom.xml overrides the default Compiler plugin settings with the production profile.
Xml code
<profiles>
   <profile>
     <id>production</id>
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId >
           <configuration>
             <debug>false</debug>

           </configuration>
         </plugin>
       </plugins>
     </build>
   </profile>
</profiles>
To run mvn install with the production profile, you need to pass the -Pproduction parameter on the command line. To verify that the production profile overrides the default Compiler plugin configuration, run Maven with debug output (-X) turned on like this.
    If you start using Maven profiles a lot, you will want to separate the profiles from the POM and use a separate file such as profiles.xml. You can mix profiles defined in pom.xml and external profiles.xml. Just put the profiles element in the profiles.xml file in the ${basedir} directory and run Maven as usual. The approximate content of the profiles.xml file is as follows:
Xml code
<profiles>
    <profile>
      <id>development</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <debug>true</debug>
              <optimize>false</optimize>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>production</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <debug>false</debug>
              <optimize>true</optimize>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
</profiles>
   The settings profile applies to all projects you build with Maven. You can define settings profiles in two places: a user-specific settings profile defined in ~/.m2/settings.xml, or a global settings profile defined in ${M2_HOME}/conf/settings.xml.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326679802&siteId=291194637