Giter VIP home page Giter VIP logo

byzy / jcv-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 15.0 100 KB

jcv-maven-plugin是一个自动为网页添加js/css的版本号和自动化压缩js/cssmaven插件,支持多种方法版本号添加,采集文件的md5值进行文件版本号修订,这个可以在每次更新的时候只修改以修改的文件的版本号,消除浏览器js/css缓存问题,同时避免使用全局版本号的方式,使得全部js/css缓存失效.

Home Page: https://www.iqarr.com/2018/02/20/java/maven/jcv-maven-plugin/

License: Apache License 2.0

Groovy 0.02% Java 99.05% JavaScript 0.62% HTML 0.32%
compression jcv-maven-plugin maven-plugin

jcv-maven-plugin's People

Contributors

byzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jcv-maven-plugin's Issues

js中含有多个.的情况

1、js含有多个.的 不会加上版本号
比如:[INFO] The suffix is .min ,not processed:echarts.min.js

2、xxx.js?version=md5 ,希望version作为可配置参数,默认为version,我们这边有不同的分支使用同一套代码,但是访问地址是同一个,需要根据version的值在nginx中做判断来跳转到不同的服务器获取对应的资源文件

demo

有相关demo吗,根据文档在pom添加了插件,打包时js并没有添加版本号

版本号添加失败

提示nothing to do, E:\MyProject\xxxx.js is younger than original, use 'force' option or clean your target,但是我执行的是mvn clean package,已经clean了啊,是哪里配置的不对么

使用dos命令行打包无法将html文件打入包中

插件用了半年了,方便了工作,先表示感谢!
最近写了批处理,在dos中用mvn package打包时,发现html文件无法打入包中。但是在idea中是可以的,请问是不支持外部打包么?

spring boot项目中使用无效

这是我的POM
<plugin> <groupId>com.iqarr.maven.plugin</groupId> <artifactId>jcv-maven-plugin</artifactId> <version>1.0.2</version> <executions> <execution> <id>process</id> <phase>process-resources</phase> <goals> <goal>process-springboot</goal> </goals> </execution> </executions> <configuration> <suffixs> <param>html</param> </suffixs> <globaJsMethod>MD5_METHOD</globaJsMethod> <globaCssMethod>MD5_METHOD</globaCssMethod> </configuration> </plugin>

在index.html中引用
<link href="dev-css/index.css" rel="stylesheet">

我改变index.css内容后mvn clean package,打出来的包中的index.html引用没变,并没有加上MD5值。请问哪里有错吗?

如何验证插件生效?

前辈你好, 在使用插件过程中有点问题想请教你.
我按照教程用mvn clean package进行打包, 并部署到Tomcat中运行. 我想知道插件生产的md5值在哪里可以看到(之所以想看这个, 是因为发现使用插件后访问的url没有变化)

项目中应用jcv后,偶尔出现丢html文件和打包失败情况

如下是将jcv整合后plugins配置
出现过的问题:
1.html丢失
2.打包失败(报错为clean target文件夹下的文件时删除失败,怀疑是插件中的操作与maven原生操作冲突了)
3.打包成功后,部署运行出现问题 报内存溢出问题

以上均为偶发问题,出现问题后重新打包可解决
想了解具体原因 望指点 谢谢

<plugins>
			<!-- 设置源文件编码方 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<!-- 解决资源文件的编码问 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<!--jcv-maven-plugin -->
			<plugin>
				<groupId>com.iqarr.maven.plugin</groupId>
				<artifactId>jcv-maven-plugin</artifactId>
				<version>1.0.2</version>
				<executions>
					<execution>
						<id>process</id>
						<phase>process-resources</phase>
						<goals>
							<goal>process</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<!--如果项目名称使用EL表达式 那么必须加\ 转义 -->
					<!--<jsConstantName>\${base}</jsConstantName>-->
					<!--<cssConstantName>\${base}</cssConstantName>-->
					<suffixs>
						<param>html</param>
						<param>jsp</param>
					</suffixs>
					<!-- 清理html 页面注释-->
					<clearPageComment>true</clearPageComment>
					<globaJsMethod>MD5_METHOD</globaJsMethod>
					<globaCssMethod>MD5_METHOD</globaCssMethod>
					<versionValLenth>20</versionValLenth>
					<!-- 压缩js-->
					<compressionJs>false</compressionJs>
					<!-- 压缩css-->
					<compressionCss>false</compressionCss>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<warName>${project.artifactId}-${project.version}</warName>
					<filters>
						<filter>src/main/resources/${env}/config.properties</filter>
					</filters>
					<warSourceDirectory>src/main/webapp</warSourceDirectory>
					<warSourceExcludes>**/*.html,**/*.jsp</warSourceExcludes>
				</configuration>
			</plugin>
		</plugins>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.