Как исключить классы из упакованного веб-приложения со знатоком

Я всегда использовал бы метку времени Unix при работе с MySQL и PHP. Главная причина для этого являющегося значение по умолчанию дата метод в PHP использует метку времени в качестве параметра, таким образом, не было бы никакого необходимого парсинга.

Для получения текущей метки времени Unix в PHP просто сделайте time();
, и в MySQL делают SELECT UNIX_TIMESTAMP();.

8
задан kebernet 20 August 2009 в 12:21
поделиться

3 ответа

What are these classes for? If they are for testing, you can specify them in src/test/java, they will then be compiled into target/test-classes in the test-compile phase, but won't be included in the final war.

If they aren't for testing and aren't to be included in the war, perhaps they should be refactored into another project so you can specify it as a dependency (perhaps with "provided" scope so they won't be deployed.

For reference you can configure the war to include and exclude resources when packaging.

The following example will include all jpgs but exclude resources from the image2 sub folder:

    <configuration>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>resource2</directory>
          <!-- the list has a default value of ** -->
          <includes>
            <include>**/*.jpg</include>
          <includes>
          <excludes>
            <exclude>**/image2</exclude>
          </excludes>
        </resource>
      </webResources>
    </configuration>

See the war plugin documentation for more details.

1
ответ дан 6 December 2019 в 02:26
поделиться

Возможно, вам повезет с этим, если вы используете их в пакете, который можно определить с помощью шаблона муравья

  <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
                <excludes>**/dontneed/*.class</excludes>
        </configuration>
  </plugin> 
0
ответ дан 6 December 2019 в 02:26
поделиться

Вы можете использовать плагин TrueZIP Maven ( http://mojo.codehaus.org/truezip-maven-plugin/ ).

См. Примеры в:

http://svn.codehaus.org/mojo/trunk/mojo/truezip-maven-plugin/src/it/

0
ответ дан 6 December 2019 в 02:26
поделиться
Другие вопросы по тегам:

Похожие вопросы: