Instalando e configurando o Archiva no Tomcat
Primeiramente você terá que fazer o download do Apache Tomcat e do Archiva e do Java. A versões usadas nesse tutorial foram:
- Java 1.6;
- Tomcat 5.27;
- Archiva 1.2-M1.
Faça o download do War e do Standalone do Archiva pois iremos precisar dos dois.
- Java: http://java.sun.com/javase/downloads/index.jsp
- Tomcat: http://tomcat.apache.org/download-55.cgi
- Archiva: http://archiva.apache.org/download.html
Agora vamos as instalações:
• Instale o Java em sua máquina e crie uma variável de ambiente chamada JAVA_HOME, e aponte ela para o local que foi instalado o Java;
• Depois descompacte o Tomcat no C:\ da sua máquina e crie uma variável de ambiente chamada CATALINA_HOME, e aponte para o local que você descompactou o Tomcat;
• Agora crie uma pasta chamada ‘archiva’ dentro do Tomcat, no mesmo nível que as pastas bin, conf, logs e outras;
• Copie o arquivo War do Archiva para dentro desta pasta que você acabou de criar;
• Crie um arquivo chamado ‘archiva.xml’ e coloque dentro da pasta
tomcat_home/conf/Catalina/localhost/ com o seguinte conteúdo:
Banco de Dados Derby:
Código:
$lt;?xml version="1.0" encoding="UTF-8"?$gt;
$lt;Context path="/archiva" docBase="${catalina.home}/archiva/apache-archiva-1.2-M1.war"$gt;
$lt;Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource" username="sa"
password="" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:$lt;local_do_banco$gt;/database/users;create=true" /$gt;
$lt;Resource name="jdbc/archiva" auth="Container" type="javax.sql.DataSource" username="sa"
password="" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:$lt;local_do_banco$gt;/database/archiva;create=true" /$gt;
$lt;Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="localhost"/$gt;
$lt;/Context$gt;
Banco de Dados MySQL:
Código:
$lt;Context path="/archiva"
docBase="${catalina.base}/archiva/apache-archiva-1.3.5.war"$gt;
$lt;Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource
"
username="archiva"
password="archiva"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.1.190/archiva" /$gt;
$lt;Resource name="jdbc/archiva" auth="Container" type="
javax.sql.DataSource"
username="archiva"
password="archiva"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.1.190/archiva" /$gt;
$lt;Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/$gt;
$lt;/Context$gt;
Observação: Na tag Resource, a propriedade url é o caminho do banco de dados que o Archiva irá usar. Você pode definir qualquer caminho.
Agora descompacte o Archiva Standalone que você baixou. Acesse a pasta descompactada e abra a pasta lib. Dentro desta pasta copie esses 3 arquivos:
- derby-10.1.3.1.jar (or later);
- activation-1.1.jar;
- mail-1.4.jar.
Abra a pasta tomcat_home\common\lib e cole esses 3 arquivos.
Agora crie mais uma variável de ambiente chamada CATALINA_OPTS com o seguinte valor:
Código:
CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME"
Pronto! Agora é só acessar http://localhost:8080/archiva e começar a usar. A primeira página que o Archiva irá lhe mostrar será uma página pedindo para você cadastrar um Administrador.
Configurando o Maven com o Archiva
Para usar o Archiva como repositório para o Maven você precisa criar um arquivo chamado settings.xml e colocar dentro da pasta user_home/.m2. O conteúdo desse arquivo será:
Código:
$lt;settings xmlns=http://maven.apache.org/POM/4.0.0
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" $gt;
$lt;mirrors$gt;
$lt;mirror$gt;
$lt;id$gt;internal$lt;/id$gt;
$lt;url$gt;http://10.1.5.4:8023/archiva/repository/internal/$lt;/url$gt;
$lt;name$gt;Archiva Managed Internal Repository$lt;/name$gt;
$lt;/mirror$gt;
$lt;/mirrors$gt;
$lt;servers$gt;
$lt;server$gt;
$lt;id$gt;internal$lt;/id$gt;
$lt;username$gt;username$lt;/username$gt;
$lt;password$gt;password$lt;/password$gt;
$lt;/server$gt;
$lt;/servers$gt;
$lt;/settings$gt;
Para que você consiga fazer o deploy de sua aplicação você precisa inserir o seguinte código no seu pom.xml:
Código:
$lt;settings xmlns=http://maven.apache.org/POM/4.0.0
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" $gt;
$lt;mirrors$gt;
$lt;mirror$gt;
$lt;id$gt;internal$lt;/id$gt;
$lt;url$gt;http://10.1.5.4:8023/archiva/repository/internal/$lt;/url$gt;
$lt;name$gt;Archiva Managed Internal Repository$lt;/name$gt;
$lt;/mirror$gt;
$lt;/mirrors$gt;
$lt;servers$gt;
$lt;server$gt;
$lt;id$gt;internal$lt;/id$gt;
$lt;username$gt;username$lt;/username$gt;
$lt;password$gt;password$lt;/password$gt;
$lt;/server$gt;
$lt;/servers$gt;
$lt;/settings$gt;
Agora é só usar!
Xo สล็อตออนไลน์ โปรสล็อต XO เกมออนไลน์ทำเงินยอดฮิตเกมสล็อต xopg.net คือเกมทำเงิน reeffutures2018 ผ่านทางออนไลน์อย่างหนึ่ง ที่เล่นง่าย และได้เงินไว แถมยังลงทุนด้วยเงินน้อย mavoixtavoie ทำเงินได้ตลอดเวลา ซึ่งหลายคนอาจได้เคยเห็นรีวิวเรื่องของ สล็อต xo สล็อตออนไลน์ ไว้มากมาย เทคนิคสล็อต ทั้งเรื่องการเล่นแล้วได้เงิน herbalpertpresents และเล่น สล็อต แล้วไม่ได้เงิน นั่นเองค่ะ ซึ่งการที่คุณจะเล่นได้เงินหรือไม่ได้เงินนั้น essentialsforasoul ส่วนหนึ่งก็เป็นในเรื่องของดวงเข้ามาเกี่ยวด้วย northbristol เพราะสล็อตเป็นเกมออนไลน์เสี่ยงโชค ทดลองเล่น xo เกมหนึ่งซึ่งจะมีสูตร หรือเทคนิคเข้ามาช่วย gclub เพื่อโกงดวงอยู่เสมอซึ่งในเว็บของเรา สมัคร xo ก็มีมาแนะนำไว้ให้เห็นกันมากมายหลายสูตร