سؤال

I created a minified file with default name 1.js.

How can I change the name of 1.js to snapshot.js?

هل كانت مفيدة؟

المحلول

Even if you did not specify which plugin you are using for minification, assuming that you used maven-minify-plugin you will have to add <jsFinalFile> tag with your custom name:

<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>maven-minify-plugin</artifactId>
<version>1.3.5</version>
<executions>
    <execution>
        <id>min-js</id>
        <phase>process-resources</phase>
        <configuration>
            <jsSourceDir>path/to/js/dir</jsSourceDir>
            <jsSourceFiles>
                <jsSourceFile>1.js</jsSourceFile>
            </jsSourceFiles>
            <jsFinalFile>snapshot.js</jsFinalFile>
            <jsTargetDir>path/to/final/location</jsTargetDir>
        </configuration>
        <goals>
            <goal>minify</goal>
        </goals>
    </execution>
</executions>                               

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top