2015-01-24 3 views
0
나는 아파치 타일, 모듈 타일 코어를 컴파일하려고

에 사용되는 방법을 알아보십시오 그러나 나는 다음과 같은 오류가 있습니다받는다는 - 집행자 - 플러그인이 특정 POM 파일

--- maven-enforcer-plugin:1.2:enforce (enforce-java) @ tiles-core --- Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message: Detected JDK Version: 1.8.0 is not in the allowed range [1.7.0-45,1.8).

프로젝트 아파치 타일 것은 부모 구성되어 있으며, 모듈. 타일 ​​코어를 컴파일하려고합니다. 그러나 maven-enforcer-plugin이 pom 파일에서 스위치를 끄는 데 사용되는 곳을 찾아 이해할 수 없습니다. 이 플러그인이 어디에 사용되는지 설명하십시오.

부모 POM 파일 그냥 문서에 짧은 모습은 다음과 양육 것이다

<?xml version="1.0"?> 
<!-- 
/* 
* $Id: pom.xml 1626664 2014-09-22 03:28:37Z nlebas $ 
* 
* Licensed to the Apache Software Foundation (ASF) under one 
* or more contributor license agreements. See the NOTICE file 
* distributed with this work for additional information 
* regarding copyright ownership. The ASF licenses this file 
* to you under the Apache License, Version 2.0 (the 
* "License"); you may not use this file except in compliance 
* with the License. You may obtain a copy of the License at 
* 
* http://www.apache.org/licenses/LICENSE-2.0 
* 
* Unless required by applicable law or agreed to in writing, 
* software distributed under the License is distributed on an 
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
* KIND, either express or implied. See the License for the 
* specific language governing permissions and limitations 
* under the License. 
*/ 
--> 
<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"> 

    <parent> 
     <artifactId>tiles-master</artifactId> 
     <groupId>org.apache.tiles</groupId> 
     <version>6</version> 
     <relativePath /> 
    </parent> 

    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.apache.tiles</groupId> 
    <artifactId>tiles-parent</artifactId> 
    <version>3.0.5</version> 
    <packaging>pom</packaging> 
    <name>Tiles 3</name> 
    <description>Tiles 3: A framework for page composition.</description> 
    <url>http://tiles.apache.org/framework/</url> 
    <scm> 
     <connection>scm:svn:http://svn.apache.org/repos/asf/tiles/framework/tags/tiles-parent-3.0.5</connection> 
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/tiles/framework/tags/tiles-parent-3.0.5</developerConnection> 
     <url>http://svn.apache.org/viewvc/tiles/framework/tags/tiles-parent-3.0.5</url> 
    </scm> 

    <ciManagement /> 

    <modules> 
     <module>tiles-api</module> 
     <module>tiles-core</module> 
     <module>tiles-template</module> 
     <module>tiles-servlet</module> 
     <module>tiles-jsp</module> 
     <module>tiles-freemarker</module> 
     <module>tiles-velocity</module> 
     <module>tiles-el</module> 
     <module>tiles-mvel</module> 
     <module>tiles-ognl</module> 
     <module>tiles-compat</module> 
     <module>tiles-extras</module> 
     <module>assembly</module> 
     <module>tiles-test-pom</module> 
    </modules> 

    <issueManagement> 
     <system>JIRA</system> 
     <url>https://issues.apache.org/jira/browse/TILES</url> 
    </issueManagement> 

    <distributionManagement> 
     <site> 
      <id>apache-site</id> 
      <url>scm:svn:https://svn.apache.org/repos/asf/tiles/site/staging/framework</url> 
     </site> 
    </distributionManagement> 
    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-api</artifactId> 
       <version>${project.version}</version> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-core</artifactId> 
       <version>${project.version}</version> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-servlet</artifactId> 
       <version>${project.version}</version> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-template</artifactId> 
       <version>${project.version}</version> 
      </dependency> 

      <dependency> 
       <groupId>org.apache.velocity</groupId> 
       <artifactId>velocity-tools</artifactId> 
       <version>2.0</version> 
       <exclusions> 
        <exclusion> 
         <artifactId>struts-taglib</artifactId> 
         <groupId>org.apache.struts</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>struts-tiles</artifactId> 
         <groupId>org.apache.struts</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>struts-core</artifactId> 
         <groupId>org.apache.struts</groupId> 
        </exclusion> 
        <exclusion> 
         <groupId>commons-logging</groupId> 
         <artifactId>commons-logging</artifactId> 
        </exclusion> 
        <exclusion> 
         <artifactId>sslext</artifactId> 
         <groupId>sslext</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>commons-chain</artifactId> 
         <groupId>commons-chain</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>commons-validator</artifactId> 
         <groupId>commons-validator</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>commons-digester</artifactId> 
         <groupId>commons-digester</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>commons-beanutils</artifactId> 
         <groupId>commons-beanutils</groupId> 
        </exclusion> 
        <exclusion> 
         <artifactId>dom4j</artifactId> 
         <groupId>dom4j</groupId> 
        </exclusion> 
       </exclusions> 
      </dependency> 

      <dependency> 
       <groupId>commons-digester</groupId> 
       <artifactId>commons-digester</artifactId> 
       <version>2.0</version> 
       <exclusions> 
        <exclusion> 
         <groupId>commons-logging</groupId> 
         <artifactId>commons-logging</artifactId> 
        </exclusion> 
       </exclusions> 
      </dependency> 
      <dependency> 
       <groupId>org.freemarker</groupId> 
       <artifactId>freemarker</artifactId> 
       <version>2.3.15</version> 
      </dependency> 

      <dependency> 
       <groupId>ognl</groupId> 
       <artifactId>ognl</artifactId> 
       <version>2.7.3</version> 
      </dependency> 
      <dependency> 
       <groupId>org.mvel</groupId> 
       <artifactId>mvel2</artifactId> 
       <version>2.0.11</version> 
      </dependency> 
      <dependency> 
       <groupId>javax.servlet</groupId> 
       <artifactId>servlet-api</artifactId> 
       <version>2.5</version> 
       <scope>provided</scope> 
      </dependency> 
      <dependency> 
       <groupId>javax.servlet.jsp</groupId> 
       <artifactId>jsp-api</artifactId> 
       <version>2.1</version> 
       <scope>provided</scope> 
      </dependency> 
      <dependency> 
       <groupId>javax.el</groupId> 
       <artifactId>el-api</artifactId> 
       <version>1.0</version> 
       <scope>provided</scope> 
      </dependency> 
      <dependency> 
       <groupId>junit</groupId> 
       <artifactId>junit</artifactId> 
       <version>4.7</version> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.easymock</groupId> 
       <artifactId>easymock</artifactId> 
       <version>3.0</version> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.shale</groupId> 
       <artifactId>shale-test</artifactId> 
       <version>1.0.5</version> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.easymock</groupId> 
       <artifactId>easymockclassextension</artifactId> 
       <version>3.0</version> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.slf4j</groupId> 
       <artifactId>slf4j-api</artifactId> 
       <version>1.7.6</version> 
      </dependency> 
      <dependency> 
       <groupId>org.slf4j</groupId> 
       <artifactId>jcl-over-slf4j</artifactId> 
       <version>1.7.6</version> 
       <optional>true</optional> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-request-api</artifactId> 
       <version>${tiles.request.version}</version> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <artifactId>maven-jar-plugin</artifactId> 
        <configuration> 
         <archive> 
          <manifestFile>${tiles.manifestfile}</manifestFile> 
          <manifest> 
           <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> 
           <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 
          </manifest> 
         </archive> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.felix</groupId> 
        <artifactId>maven-bundle-plugin</artifactId> 
        <version>2.3.7</version> 
        <inherited>true</inherited> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.felix</groupId> 
       <artifactId>maven-bundle-plugin</artifactId> 
       <configuration> 
        <excludeDependencies>true</excludeDependencies> 
        <manifestLocation>target/osgi</manifestLocation> 
        <instructions> 
         <_nouses>true</_nouses> 
         <Bundle-SymbolicName>${tiles.osgi.symbolicName}</Bundle-SymbolicName> 
         <Export-Package>${tiles.osgi.export}</Export-Package> 
         <Private-Package>${tiles.osgi.private}</Private-Package> 
         <Import-Package>${tiles.osgi.import}</Import-Package> 
         <DynamicImport-Package>${tiles.osgi.dynamicImport}</DynamicImport-Package> 
         <Bundle-DocURL>${project.url}</Bundle-DocURL> 
         <Specification-Title>${project.name}</Specification-Title> 
         <Specification-Version>${project.version}</Specification-Version> 
         <Specification-Vendor>${project.organization.name}</Specification-Vendor> 
         <Implementation-Title>${project.name}</Implementation-Title> 
         <Implementation-Version>${project.version}</Implementation-Version> 
         <Implementation-Vendor>${project.organization.name}</Implementation-Vendor> 
         <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id> 
        </instructions> 
       </configuration> 
       <executions> 
        <execution> 
         <id>bundle-manifest</id> 
         <phase>process-classes</phase> 
         <goals> 
          <goal>manifest</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-scm-publish-plugin</artifactId> 
       <extensions>true</extensions> 
       <configuration> 
        <pubScmUrl>scm:svn:https://svn.apache.org/repos/asf/tiles/site/staging/framework</pubScmUrl> 
       </configuration> 
      </plugin> 
     </plugins> 

     <defaultGoal>install</defaultGoal> 
    </build> 

    <properties> 
     <tiles.osgi.symbolicName>org.apache.${project.artifactId}</tiles.osgi.symbolicName> 
     <tiles.osgi.export>org.apache.tiles.*;version=${project.version}</tiles.osgi.export> 
     <tiles.osgi.import>*</tiles.osgi.import> 
     <tiles.osgi.dynamicImport /> 
     <tiles.osgi.private /> 
     <tiles.manifestfile>target/osgi/MANIFEST.MF</tiles.manifestfile> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <tiles.request.version>1.0.6</tiles.request.version> 
     <tiles.autotag.version>1.1.0</tiles.autotag.version> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-simple</artifactId> 
      <version>1.5.8</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <profiles> 
     <profile> 
      <id>apache-release</id> 
      <build> 
       <plugins> 
        <plugin> 
         <artifactId>maven-install-plugin</artifactId> 
         <configuration> 
          <createChecksum>true</createChecksum> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>rat-maven-plugin</artifactId> 
         <version>1.0-alpha-3</version> 
         <executions> 
          <execution> 
           <phase>verify</phase> 
           <goals> 
            <goal>check</goal> 
           </goals> 
           <configuration> 
            <addDefaultLicenseMatchers>false</addDefaultLicenseMatchers> 
            <licenseMatchers> 
             <classNames> 
              <className>rat.analysis.license.ApacheSoftwareLicense20</className> 
             </classNames> 
            </licenseMatchers> 
            <includes> 
             <include>pom.xml</include> 
             <include>src/**</include> 
            </includes> 
            <excludes> 
             <exclude>**/*LICENSE.txt</exclude> 
             <exclude>**/*MANIFEST.MF</exclude> 
            </excludes> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
     <profile> 
      <id>linkcheck</id> 
      <reporting> 
       <plugins> 
        <plugin> 
         <artifactId>maven-linkcheck-plugin</artifactId> 
         <version>1.1</version> 
         <configuration> 
          <excludedLinks> 
           <excludedLink>/*</excludedLink> 
           <excludedLink>**/index.html</excludedLink> 
           <excludedLink>**/logo.png</excludedLink> 
           <excludedLink>**/tiles-jsp/tagreference.html</excludedLink> 
          </excludedLinks> 
         </configuration> 
        </plugin> 
       </plugins> 
      </reporting> 
     </profile> 
    </profiles> 
</project> 

타일 핵심 치어 파일

<?xml version="1.0"?> 
<!-- 
/* 
* $Id: pom.xml 1626664 2014-09-22 03:28:37Z nlebas $ 
* 
* Licensed to the Apache Software Foundation (ASF) under one 
* or more contributor license agreements. See the NOTICE file 
* distributed with this work for additional information 
* regarding copyright ownership. The ASF licenses this file 
* to you under the Apache License, Version 2.0 (the 
* "License"); you may not use this file except in compliance 
* with the License. You may obtain a copy of the License at 
* 
* http://www.apache.org/licenses/LICENSE-2.0 
* 
* Unless required by applicable law or agreed to in writing, 
* software distributed under the License is distributed on an 
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
* KIND, either express or implied. See the License for the 
* specific language governing permissions and limitations 
* under the License. 
*/ 
--> 
<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"> 

    <parent> 
    <groupId>org.apache.tiles</groupId> 
    <artifactId>tiles-parent</artifactId> 
    <version>3.0.5</version> 
    </parent> 

    <modelVersion>4.0.0</modelVersion> 
    <artifactId>tiles-core</artifactId> 
    <packaging>jar</packaging> 
    <name>Tiles - Core Library</name> 
    <description>Tiles Core Library, including basic implementation of the APIs. 
    </description> 

    <properties> 
     <tiles.osgi.symbolicName>org.apache.tiles.core</tiles.osgi.symbolicName> 
    </properties> 

    <build> 
    <resources> 
     <resource> 
     <directory>src/main/resources</directory> 
     <excludes> 
      <exclude>LICENSE.txt</exclude> 
      <exclude>NOTICE.txt</exclude> 
     </excludes> 
     </resource> 
     <resource> 
     <directory>src/main/resources</directory> 
     <includes> 
      <include>LICENSE.txt</include> 
      <include>NOTICE.txt</include> 
     </includes> 
     <targetPath>META-INF</targetPath> 
     </resource> 
    </resources> 
    <plugins> 
      <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <skipTests>true</skipTests> 
      </configuration> 
      </plugin> 
     </plugins> 
    </build> 

    <reporting> 
    <plugins> 
     <plugin> 
     <groupId>net.sf.dtddoc</groupId> 
     <artifactId>dtddoc-maven-plugin</artifactId> 
     <version>1.1</version> 
     <configuration> 
      <docTitle>Tiles Definition File</docTitle> 
     </configuration> 
     </plugin> 
    </plugins> 
    </reporting> 


    <dependencies> 
    <dependency> 
     <groupId>org.apache.tiles</groupId> 
     <artifactId>tiles-api</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>commons-digester</groupId> 
     <artifactId>commons-digester</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>jcl-over-slf4j</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.easymock</groupId> 
     <artifactId>easymock</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.easymock</groupId> 
     <artifactId>easymockclassextension</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.shale</groupId> 
     <artifactId>shale-test</artifactId> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 

</project> 
+0

적용되는 버전 범위에서 jdk를 사용하지 않는 이유는 무엇입니까? –

+0

@Brett Okken 허용 된 범위 1.8.0에서 버전을 사용합니다. 문제는이 플러그인이 활성화 된 곳을 이해하는 것입니다. –

+0

1.8이 허용 범위 내에 있지 않습니다. '[1.7.0-45,1.8]'은 jdk 버전이'> ='1.7.0-45와'<'1.8이어야 함을 의미합니다. 1.8보다 작음을 유의하십시오. –

답변

1

enforcer 플러그인 참조는 tiles-parent pom의 상위 pom이며 거기에서 파생 된 tiles-master pom에 포함되어 있습니다.

당신이 트릭해야 다음을 추가 프로젝트에서 영구적으로이 규칙을 사용하지 않도록 설정해야하는 경우 : 실행되지 않습니다되어 none 상에 ID enforce-java에 대한

<build> 
    <plugins> 
     <plugin> 
     <artifactId>maven-enforcer-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>enforce-java</id> 
      <phase>none</phase> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
</build> 

이 위임 집행자 플러그인 실행을. 다른 ID로 다른 실행을 추가하면 필요한 경우 사용자 고유의 Enforcer 규칙을 추가 할 수 있습니다.

0

:

mvn -Denforcer.skip=true ... 

트릭을 할해야 .

+0

질문은 집행자를 우회하는 방법이 아니라이 인스턴스에서이 플러그인이 사용 된 장소와 방법을 정확히 파악하는 것이 었습니다. – Leon

+0

이것은 실제로 내 질문에 대답했다. 그래서 나는 그것을 투표했다! thnx –