Java服务端开发记录

新建项目

IDEA:New -> Project -> Maven -> 勾选Create form archetype -> 选择maven-archetype-quickstart

IDEA Settings

(1)配置为本地Maven

settings.xml配置参考

<settings>
  <localRepository>E:/Library/MavenRepository</localRepository>

  <pluginGroups>
    <pluginGroup>org.mule.tools</pluginGroup>
  </pluginGroups>

  <servers>
    <server>
      <id>snapshots</id>
      <username>yezhou</username>
      <password>123456</password>
    </server>
    <server>
      <id>releases</id>
      <username>yezhou</username>
      <password>123456</password>
    </server>
  </servers>

  <mirrors>
    <mirror>
      <id>nexus-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf>
      <url>http://rp.yezhou.me/repository/public-snapshots/</url>
    </mirror>

    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://rp.yezhou.me/repository/public/</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>public</id>
          <!--<url>http://220.189.210.141:10080/nexus/content/groups/public/</url>-->
          <url>http://public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>public-snapshots</id>
          <!--<url>http://220.189.210.141:10080/nexus/content/groups/public-snapshots/</url>-->
          <url>http://public-snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>public</id>
          <!--<url>http://220.189.210.141:10080/nexus/content/groups/public/</url>-->
          <url>http://public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
        <pluginRepository>
          <id>public-snapshots</id>
          <!--<url>http://220.189.210.141:10080/nexus/content/groups/public-snapshots/</url>-->
          <url>http://public-snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

</settings> 

IDEA Run/Debug Configurations

(1)配置:Name
(2)Server选项卡:添加Local Tomcat
(3)Deployment选项卡:添加Artifact

Dubbo服务调用

applicationContext-dubbo-consumer.xml

<dubbo:reference id="userService" interface="cn.appblog.service.UserService" />
@Autowired
private UserService userService;

...() {
  userService.findUserById("xxx");
}

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/04/01/java-server-development-record/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Java服务端开发记录
新建项目 IDEA:New -> Project -> Maven -> 勾选Create form archetype -> 选择maven-archetype-quickstart IDEA Settings (1)配置为本地Mave……
<<上一篇
下一篇>>
文章目录
关闭
目 录