不使用Maven的插件jetty , 修改Maven的默认服务器端口号8080

【Maven】Maven介绍与私服搭建 1. 什么是maven?maven发展历史maven的体系结构2. maven下载与配置2.1 下载maven2.2 maven文件配置配置本地仓库位置远程镜像仓库配置profile配置2.3 idea环境安装配置maven3. maven核心思想3.1 maven仓库3.2 maven管理项目的生命周期3.3 maven项目对象模型 Pompom概述dependency中的gav(坐标)搭建maven私服-nexus下载nexusLinux系统中安装nexus上传压缩文件到linux服务器解压并重命名。 阅读详情

项目中刚使用了Maven进行管理。配置好了Maven的开发环境。

在把Maven项目build完之后,运行项目的时候,就出现了如下8080端口被占用的错误:


因为也没有安装Maven的插件jetty,所以也不能使用jetty ,不能用命令去修改Maven的默认服务器端口8080.

这时候,只需要修改Maven的核心配置文件pom.xml即可以。加入一段配置:

<project 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>tp</groupId>
  <artifactId>web</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>web Maven Webapp</name>
  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  
  <dependencies>
    <dependency>    
	  <groupId>tp</groupId>
	  <artifactId>framework</artifactId>
	  <version>[0.0.1-SNAPSHOT,)</version>
	 </dependency>	 
	 <dependency>    
	  <groupId>tp</groupId>
	  <artifactId>report</artifactId>
	  <version>[0.0.1-SNAPSHOT,)</version>
	 </dependency> 
	 <dependency>
	    <groupId>javax.servlet.jsp</groupId>
	    <artifactId>jsp-api</artifactId>
	    <version>2.1</version>
	    <scope>test</scope>
     </dependency>
     <dependency>
	    <groupId>tomcat</groupId>
	    <artifactId>servlet-api</artifactId>
	    <version>5.5.23</version>
	    <scope>test</scope>
     </dependency>     
  </dependencies>
  
  <build>
    <finalName>web</finalName>
        <plugins>  
            <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-compiler-plugin</artifactId>  
                <configuration>  
                    <source>1.6</source>  
                    <target>1.6</target>  
                    <encoding>UTF-8</encoding>  
                </configuration>  
            </plugin>  
            <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-war-plugin</artifactId>  
                <configuration>  
                    <warName>uc</warName>  
                </configuration>  
            </plugin>  
            <plugin>  
                <groupId>org.codehaus.mojo</groupId>  
                <artifactId>tomcat-maven-plugin</artifactId>  
                <version>1.0</version>  
                <configuration>  
                <port>9009</port><SPAN style="COLOR: #ff0000"></SPAN> 
                    <path>/client</path>  
                    <path>/uc</path>  
                </configuration>  
            </plugin>  
            <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-surefire-plugin</artifactId>  
                <configuration>  
                    <skip>true</skip>  
                </configuration>  
            </plugin>  
     </plugins>  
    
  </build>
</project>
只需要加入红色代码的配置即可以。修改的端口号为:9009

这时候启动后就成功了。


OVER!















修改maven项目端口号的方法 今天小编就为大家分享一篇修改maven项目端口号的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧 立即下载

相关推荐

从零构建物联网数据中台:MQTT协议、Node.js服务、MongoDB与InfluxDB双存储及React可视化实战

本文详细介绍了从零构建物联网数据中台的完整实战方案。通过采用MQTT协议作为设备通信标准,结合Node.js搭建高并发数据处理服务,并创新性地使用MongoDB与InfluxDB双存储架构分别管理设备元数据与海量时序数据,最后利用React构建了实时数据可视化控制台。该架构有效解决了物联网项目中数据异构、查询性能低下等核心痛点,为构建高效、可扩展的物联网平台提供了清晰路径。

weixin_28432777的博客 288

Tomcat修改默认端口(8080端口)

2、找到Connector port=“8009”,修改为9009(数字随便填,但注意修改的端口一定不能被占用)找到Connector port=“8080”,修改为8088(数字随便填,但注意修改的端口一定不能被占用)3、找到Server port=“8005“,修改为8006(数字随便填,但注意修改的端口一定不能被占用)在工作中,有可能需要在一台服务器上同时部署两个或两个以上的tomcat(服务器性能足够好),1、首先到安装目录下找到conf文件夹,在里面找到server.xml文件用记事本打开。

qq_48374573的博客 3204

微信数据库读取解密脚本 聊天记录查看工具,支持所有微信版本,后期将支持企业微信[Windows]

(1)获取微信昵称、微信账号、微信手机号、微信邮箱、微信KEY的基址偏移(2)获取微信的微信昵称、微信账号、微信手机号、微信邮箱、微信KEY、微信原始ID(wxid_******)(3)获取微信文件夹路径(4)支持查看聊天记录查看(5)根据key解密微信数据库(6)提供数据库部分字段说明(7)支持微信多开场景,获取多用户信息等(8)微信需要登录状态才能获取数据库密钥(9)支持导出聊天记录为html,备份微信聊天记录,方便查看(10)合并多个数据库,方便查看。

weixin_43101935的博客 1万+

maven tomcat启动时修改默认端口

tomcat默认端口是8080,如果想修改默认端口,可以有两种方法: 1.在pom.xml里修改 2.在Run Configurations修改启动方式,加上-Dmaven.tomcat.port=端口号 tomcat有两种插件,tomcat-maven-plugin 和tomcat7-maven-plugin ,当用tomcat插件,Goals里用tomcat:run,

Allen_liyu的博客 4879

VLSI数字信号处理系统——第九章滤波器和变换中的算法强度缩减

[课程学习] VLSI数字信号处理系统——第九章滤波器和变换中的算法强度缩减

夏风喃喃的博客 1604

在不同版本Python中安装PyQT5及PyQT5-Tools

在不同版本Python中安装PyQT5及PyQT5-Tools

zoomgu680的博客 2万+

JavaWeb-Maven Profile 端口的设置

什么是MavenProfile 在我们平常的java开发中,会经常使用到很多配制文件(xxx.properties,xxx.xml),而当我们在本地开发(dev),测试环境测试(test),线上生产使用(product)时,需要不停的去修改这些配制文件,次数一多,相当麻烦。现在,利用maven的filter和profile功能,我们可实现在编译阶段简单的指定一个参数就能切换配制,提高效率,还不容

沐埜专栏 858

深入解析Sigma Delta调制器 —— 从电流采样到数字信号处理的完整链路

本文深入解析了Sigma Delta调制器的工作原理与应用。通过剖析过采样、噪声整形与负反馈核心机制,并结合AMC1306等实例,详细阐述了从电流采样到数字信号处理的完整链路。该技术凭借其高精度和高抗干扰能力,在ADC、电流测量及音频处理等领域发挥着关键作用。

ttt77的博客 643

maven启动后为什么端口号总是8080?

启动命令tomcat7:run,此处不能为tomcat:run,否则默认为端口8080启动! 因为这个被坑了好久,后来有一天仔细一看发现了问题

worldTi6的博客 1167

GEE:连续变化检测 CCD 第一步(导出ee.Algorithms.TemporalSegmentation.Ccdc函数的结果)

连续变化检测与分类(Continuous Change Detection and Classification, CCDC)主要有两个组件,一个连续变化检测 CCD,另外一个分类。在 Google Earth Engine (GEE)平台上进行 CCD 时间序列变化检测的时候,为了防止内存超限问题,将代码分为2阶段执行。第一阶段是运行 `ee.Algorithms.TemporalSegmentation.Ccdc` 函数,本文将详细介绍 CCD 的第一阶段的代码。

养乐多的博客 2492

Docker:安装Apache Pulsar 消息队列的详细指南

本文详细介绍了Apache Pulsar的Docker化安装部署方法,包括单节点Pulsar服务和管理界面Pulsar Manager的安装配置。通过Docker命令快速搭建Pulsar环境,并演示了租户和命名空间的基础管理操作。同时提供了Spring Boot项目与Pulsar集成的完整方案,从依赖配置到客户端初始化,为开发人员构建实时消息系统提供实用参考。

木头 2209

JFinal5+Jetty2009+IDEA2020+Java8的非Maven-Demo项目

4.4 创建Views层,主要是模板文件“index.html”,新人需要注意的就是路径问题@Path(value = "/")注解可以设置我没搞怕大家蒙圈。4.2 创建配置文件,这个文件需要继承JFinalConfig类,完了实现类就好了。3.1 在WEB-INF 下创建lib文件夹,把jar放进去。2..2都说选Java 完了选W eb 可是我的没有啊。这里也没啥高深的东西看看API就知道怎么搞了。找到项目下的jar引入即可。用Jetty了,TOM猫就 没啥大用。带破解jar的没安装的自己试试。

zy0412326的专栏 276

HDR 人像肤色稳定实战:AE/AWB/ToneMap 冲突解耦与优先级裁决

人像 HDR 最容易“翻车”的就是**肤色飘**:AE 抢亮度、AWB 拉白点、TM 又在肩部压高光,三方各自“对”却合起来“错”。本文给出一套**工程可落地**的裁决策略:以**肤色 ROI 锚点**为最高约束,AE 先对脸部入射照度收敛,AWB 在**肤色先验 + 光源模型**下缓变,TM 采用**色相保持 + 中灰/肤色双锚**且时域一致化。配套**阈值与回归**(ΔE00、亮度漂移 RMS、频闪注入),把“主观对”的口径落到**可度量**,并给出逆光、多脸、霓虹等极端场景的**例外分流**。

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 1203

maven中使用jetty插件

maven jetty 插件的使用 jetty插件的安装 首先打开项目的pom.xml文件,然后找到build节点,在其中添加plugins节点,然后再添加如下的插件: &lt;plugin&gt; &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-maven-plugin&lt;/art...

sky198989的博客 480

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

礼拜三log~Mac下eclipse项目环境的搭建 & jsp文件命名规范

Mac下eclipse环境的搭建 jsp文件命名方式

YuqiRealm.com 822

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

Spring Boot 项目课程总结

Spring 4.0设计。

2301_78948361的博客 226

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

[IDEA]——IDEA修改MAVEN默认web端口方法

最近在部署WEB项目时遇到web项目网页无法正常启动的情况,总是显示MAVEN的web默认页面,经过测试,是由于IDEA中继承的Tomcat默认端口有问题,所以记录一下方法,同时也希望能帮助到大家,IDEA修改MAVEN默认web端口方法,直接在IDEA右上角编辑配置界面内修改即可。

一枚有趣的灵魂~享受编程带来的快乐 2536

修改maven项目本地的端口

在maven 项目中 1、找到web 文件下的pom.xml 文件 2、修改pox.xml中的port 即可 plugin> groupId>org.apache.tomcat.mavengroupId> artifactId>tomcat7-maven-pluginartifactId> version>2.2version> configuration

hw_hi的博客 6986

jetty-maven-plugin 设置端口

jetty-maven-plugin 有两种方式设置服务端口(默认:8080): 通过命令行,在启动jetty的时候设置:mvn jetty:run -Djetty.port=10001在 pom 中的 jetty-maven-plugin 中进行设置: org.mortbay.jetty maven-jetty-plugin 6.1.22

fuck487的博客 4250

javaweb1配置Maven和修改端口

学习javaweb分享 首先打开idea 进入 学习软件 intelij idea 点击蓝色指标打开我们的之前从Gitee克隆创建好的窗口文件

超酱仔啦 784

非maven方式jetty-server下的JFinal开发

非maven方式jetty-server下的JFinal开发 1.创建Dynamic Web Project 注意:Target runtime 一定要选择<None> 2.修改Default Output Folder, 推荐:输入WebRoot\WEB-INF\classes 特别注意:此处的Default out folder必须要与WebRoot\WEB-INF\cl...

小刀的博客-InfoMax 541

修改maven项目中的默认端口后怎样访问网页

当我们把默认端口改了之后就需要以我们修改后的端口来进行访问。我将端口号改为了81。所以当我们进行访问时,要使用81这个端口号。

weixin_51960629的博客 687

02SpringBoot入门--Maven搭建项目

SpringBoot项目必须继承spring-boot-starter-parent,即所有的SpringBoot项目都是spring-boot-starter-parent的子项目。 SpringBoot项目中可以定义起步依赖,起步依赖不是以jar包为单位,而是以功能为单位 spring-boot-maven-plugin插件是将项目打包成jar包的插件。该插件打包后的SpringBoot项目无需依赖web容器,可以直接使用JDK运行

m0_51697147的博客 1万+

maven指定端口号启动的两种方式

第一种修改pom文件启动命令tomcat6:run,此处不能为tomcat:run,否则默认为端口8080启动!因为这个被坑了好久,后来有一天仔细一看发现了问题第二种修改启动命令为-Dmaven.tomcat.port=8081 tomcat:run...

景天昊月的博客 1万+

关于maven以及端口号设置

//maven设置-noverify -javaagent:C:\myeclipse10\jrebel.jar -Drebel.spring_plugin=true -Xms512M -Xmx1024M -XX:MaxPermSize=256m//端口号设置-Djetty.port=8082 jetty:run

7605
上一篇: spring jdbcTemplate 使用占位符(?)的query方法进行多表查询
下一篇: 使用批处理文件.bat执行可运行的Jar文件
hatom
博客等级 码龄15年 46粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值