maven-jar-plugin 排除不想打包的目录文件内容

Mavne 排除 jar 包 中的目录、文件和资源文件 Maven 引进来的jar包,但是想对jar包中的 一些目录、一些文件等进行部分的排除,可使用 。使用一个或多个的 节点 添加排除匹配条件。语法说明: 2、排除依赖包的子依赖 比如,在 hbase.jar 中又关联引入的许多的jar包,这就是子依赖。同依赖过滤直接处理:可以过滤一个或者多个,如果过滤多个要写多个 。排除 一个或多个子依赖,如下所示。 排除所有的子依赖,如下所示。...... 阅读详情


首先 给出在我们一个打jar包的项目的处理结果,maven打包的时候发现出现了缓存,

调整pom文件发现没有用,可以在clean install package的时候 修改下本次打包的名字比如加个11

什么的 ,clean install package去掉个clean之类 去除缓存的影响



给出我们一个pom的解决方案

    <!-- add by flyer 0614 -->
          <plugin>
	          <artifactId>maven-jar-plugin</artifactId>
			    <executions>
			        <execution>
			            <phase>package</phase>
			            <goals>
			                <goal>jar</goal>
			            </goals>
			        </execution>
			    </executions>
			    <configuration>
			        <excludes>
			            <!--注意从编译结果目录开始算目录结构-->
			            <exclude>/config/application*.properties</exclude>
			            <exclude>/logback.xml</exclude>
			            
			        </excludes>
			    </configuration>
             </plugin>
  <exclude>/config/application*.properties</exclude>
<exclude>/logback.xml</exclude> 这是要排除的文件

以下

转载: https://blog.youkuaiyun.com/peihexian/article/details/78697251

maven-jar-plugin 打包jar简单吧,是个人都会用,但是这玩意有个毛病,会把所有编译结果都打到jar包里面去,如果是多模块的工程,有时候会想把某些模块的功能打成jar包给其他模块使用,但是这些模块特有的xml配置文件和properties文件等就没有必要打包进去了,甚至打包进去的话会有问题的,如spring配置参数文件会被反复加载等,具体怎么排除呢?

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.0.2</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <excludes>
            <!--注意这玩意从编译结果目录开始算目录结构-->
            <exclude>/*.properties</exclude>
            <exclude>/*.xml</exclude>
        </excludes>
    </configuration>
</plugin>

最最最最坑人的是exclude的目录不是src下面的,是以编译结果classes为根目录计算的,所以想怎么排除就知道了吧?就这么个知识点折腾了我好几天啊!




Maven uber-jar(带依赖的打包插件) spring-boot-maven-plugin 阅读详情

相关推荐

从零实现地震波场模拟:交错网格有限差分法核心代码精讲

本文详细介绍了从零实现地震波场模拟的核心技术,重点讲解了交错网格有限差分法的实现过程。通过速度-应力弹性波方程的离散化处理,结合代码实例演示了应力与速度更新的关键步骤,并分享了震源加载、稳定性条件等实用技巧,为计算地球物理学研究提供实践指导。

weixin_42556197的博客 410

全网都找不到的maven-jar-plugin怎么排除不想打包的目录文件内容

maven-jar-plugin 打包jar简单吧,是个人都会用,但是这玩意有个毛病,会把所有编译结果都打到jar包里面去,如果是多模块的工程,有时候会想把某些模块的功能打成jar包给其他模块使用,但是这些模块特有的xml配置文件和properties文件等就没有必要打包进去了,甚至打包进去的话会有问题的,如spring配置参数文件会被反复加载等,具体怎么排除呢? plugin> g

程序员记事本 5740

如何在高版本的ubuntu系统里安装gcc4.1.2

1、下载安装包,一共五个http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.1/,根据计算机系统位数   进行下载,64位下载amd64结尾的。开头分别是cpp-4.1_4.1.2、g++-4.1_4.1.2、gcc-4.1-base_4.1.2、gcc-     4.1_4.1.2、libstdc++6-4.1 2、使用sudo d

lsr_fighting的博客 1931

Java maven 打包jar 排除文件或目录 maven-jar-plugin

用maven打包jar的时候,有的文件不需要,不删除的话会导致jar体积太大 这是我的编译目录结构 对应的pom.xml 书写方法 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId&g...

yuanbichang的专栏 2301

010Editor实战:5分钟破解Zip伪加密文件(附BUUCTF真题解析)

本文详细介绍了如何使用010Editor快速破解Zip伪加密文件,包括BUUCTF真题的完整解析。通过修改关键字节,轻松解除伪加密状态,适用于CTF竞赛和实际工作场景,提升文件处理效率。

weixin_29325007的博客 326

保姆级教程:在Ubuntu 20.04上从源码编译Apollo自动驾驶平台(含GPU环境配置)

本文提供了一份详细的Ubuntu 20.04上从源码编译Apollo自动驾驶平台的保姆级教程,包括GPU环境配置、Docker部署和编译构建等关键步骤。通过实战经验和避坑指南,帮助开发者高效完成Apollo平台的编译和验证,适用于自动驾驶技术研究和应用开发。

weixin_30876945的博客 409

【maven】springboot打可执行jar排除指定的配置文件

【maven】springboot打可执行jar排除指定的配置文件

ooooooooooooooxiaosu的博客 4116

04目标检测-Two-stage的目标检测算法

前面我们对进行了对比分析,同时上一篇我们介绍了传统算法在目标检测的原理和效果,此篇我们记录了我学习目标检测算法的深度,深入讲述一下深度学习算法在目标检测的原理和效果。原文链接:https://blog.youkuaiyun.com/qq_41946216/article/details/132800752。版权声明:本文为优快云博主「爱吃面的猫」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。One-stage(YOLO和SSD系列):直接回归目标位置。

qq_41946216的博客 3651

Maven打包时排除指定的目录或指定的类

有些代码是从其他项目中拷贝过来的,有可能不会用到,也有可能用到,所以暂时保留下来,但测试时打包可能会报错,在maven打包时排除掉这些java类。 <build> <finalName>${project.artifactId}</finalName> <extensions> <extension> <!-- ... -->

zzwpublic的专栏 3719

Python-自动化绘制股票价格通道线

创建更强大、更可靠的价格通道检测算法。

探索人工智能领域 948

Vue3 - 详细实现接入使用海康威视监控云端显示及控制功能,网站集成安装海康监控及实时监控显示、回放、放大缩小画面、视频画面截图、截屏抓拍、摄像头控制,实时推流及播放器解决延迟卡顿等问题(详细代码)

vue3,nuxt3,海康威视,海康监控,摄像头监控,实时监控画面,海康插件,视频播放,回放,视频流地址,取流协议,视频sdk播放,hik,rtsp,rtmp,hls,ws,网站,网页,h5页面,后台管理系统,vue3对接海康监控设备,无法连接,报错,vue3对接海康处理接口认证规则,监控实时预览和回放功能,海康api接口,安全认证,海康开放平台,官方文档,播放海康摄像头的监控视频,海康实时监控播放详细步骤,web,黑屏,特别卡不流畅怎么办,解决无法推流,录像,连接不上,vue3,海康,vue海康视频监控,

🏆 前端领域优质创作者 1万+

maven-jar-plugin排除不想打包的目录文件内容

maven-jar-plugin 打包jar简单吧,是个人都会用,但是这玩意有个毛病,会把所有编译结果都打到jar包里面去,如果是多模块的工程,有时候会想把某些模块的功能打成jar包给其他模块使用,但是这些模块特有的xml配置文件和properties文件等就没有必要打包进去了,甚至打包进去的话会有问题的,如spring配置参数文件会被反复加载等,具体怎么排除呢?&lt;plugin&gt; ...

xwnxwn的专栏 1万+

海康视觉算法平台VisionMaster 4.3.0 C# 二次开发01 加载方案并获取结果

第一次使用海康视觉算法平台VisionMaster 4.3.0,项目中要使用这个平台进行视觉处理并获取结果。

StevenChen的博客 7877

Maven 打包插件 maven-jar-plugin

Maven 打包插件 maven-jar-plugin

Ares5k 1万+

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

深度学习工具包 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")

Maven uber-jar(带依赖的打包插件)maven-shade-plugin

带依赖的打包插件 maven-shade-plugin

Ares5k 3516

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

mvn 打包jar,排除第三方依赖包,maven常用插件

mvn clean package 常用插件

nalanxiaoxiao2011的博客 9325

Maven uber-jar 带依赖的打包插件 spring-boot-maven-plugin

Maven 带依赖的打包插件 spring-boot-maven-plugin

学习笔记! 987

maven 排除配置文件打包_maven 打包排除指定文件

Site生命周期的各个阶段:pre-site 执行一些需要在生成站点文档之前完成的工作site 生成项目的站点文档post-site 执行一些需要在生成站点文档之后完成的工作,并且为部署做准备site-deploy 将生成的站点文档部署到特定的服务器上最重要的Default生命周期validategenerate-sourcesprocess-sourcesgener...

weixin_39709178的博客 1469

springboot打可执行jar排除指定的配置文件

2种方法,亲测可用 方式1:resources排除 <build> <finalName>platformUpload-0.01</finalName> <resources> <resource> <filtering>true<...

u011165335的博客 5144

Maven 排除不需要打包的文件

在开发项目时,为了开发、测试方便,系统会有多套配置文件,当项目打包的时候,即使测试环境在启动项目时指定配置文件,仍然可能会存在各种问题,因此最好的办法就是在打包项目时,将这些配置文件全部排除在外。 官方文档中给出了解决方法。 官方参考文档:https://maven.apache.org/plugins/maven-jar-plugin/examples/include-exclude.html. <project> ... <build> <plugins&g

QiuHaoqian的博客 4494

IDEA打包Maven项目时,如何将配置文件排除

现在开发项目时,为了开发、测试方便,系统会有多套配置文件,当项目打包转测的时候,即使测试环境在启动项目时指定配置文件,仍然会存在各种问题,因此最好的办法就是在打包项目时,将这些配置文件全部排除在外。 查看了不少博客,都是各种转载,最后看了官方文档,一下子就解决了。 参考文档:https://maven.apache.org/plugins/maven-jar-plugin/examples/include-exclude.html 排除办法如下:在pom文件中添加如下代码即可。 <proje

i1025700727的博客 5313

maven jar 打包排除某些特定的包和类

<!-- 打成普通jar包,并排除某些包和类 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configu...

a1058926697的博客 1万+

maven 排除配置文件打包_Maven,从打包的jar中排除资源文件夹

I'm trying to achieve the following distribution for my application, and I'm following this question as guidelinedist/|-- application-1.0.jar|-- conf/|-- application.properties|-- log4j.properties|-- ...

weixin_39992072的博客 851

maven的5种打包方式:springboot-maven-plugin详解

spring-boot-maven-plugin插件,会将依赖的jar包全部打包进去。该文件包含了所有的依赖和资源文件,可以直接在命令行或者传统的 Java Web 服务器上启动运行。--使用的插件列表。-->--plugin元素包含描述插件所需要的信息。-->--插件在仓库里的group ID -->--插件在仓库里的artifact ID -->--被使用的插件的版本(或版本范围) -->

qq_48508157的博客 4102
上一篇: 理解WEB API网关
下一篇: feign.FeignException: status 404 reading xxService#xxmethod(Integer)
琅琊山二当家
博客等级 码龄18年 447粉丝 322原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值