티스토리 뷰

반응형

IntelliJ mvn(maven) deploy 세팅_메이븐 설치 X

Nexus에 배포 기준 세팅 작업

1. settings.xml 세팅

File > Settings > Build, Execution, Deployment > Build Tools > Maven > User settings file > Override 체크

해당 위치에 settings.xml 파일 생성

<!-- settings.xml -->

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  
  <pluginGroups>
  </pluginGroups>

  <proxies>
  </proxies>

  <servers>
    <!-- Nexus 계정정보 추가 -->
    <server>
        <id>Releases</id>
        <username>test</username>
        <password>test1</password>
    </server>
    <server>
        <id>Snapshots</id>
        <username>test</username>
        <password>test1</password>
    </server>
  </servers>

  <mirrors>
    <mirror>
      <id>maven-default-http-blocker</id>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
    </mirror>
  </mirrors>

  <profiles>
  </profiles>
  
</settings>

2. maven configurations 추가

clean 후 배포

Run - clean compile deploy > OK 

3. 생성된 배포스크립트 실행 더블클릭

4. 정상 동작

...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.488 s
[INFO] Finished at: 2023-09-12T10:57:07+09:00
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0

 

 

- 메이븐이 설치되어 있다면 설치된 메이븐 conf/settings.xml 내용을 수정하고 cmd 창에서 아래 스크립트 입력 하면 동일하게 동작

mvn clean compile deploy

 

끗!@#!@#!@#

반응형