问:
Maven compilation fails with maven compiler plugin
I am trying to build a project using maven. The compilation fails without giving any clue of why the compilation is failing. I am using Jdk 1.7 to build the code. The same code is getting built without any errors when building via ant

I am getting the below error

```<code>[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/util/List.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/Class.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(javax/xml/transform/sax/TransformerHandler.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Users\vadagr\.m2\repository\com\google\code\gson\gson\2.8.2\gson-2.8.2.jar(com/google/gson/stream/JsonWriter.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/io/IOException.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/Iterable.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/SuppressWarnings.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Annotation.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Target.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/ElementType.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Retention.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/RetentionPolicy.class)]]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53.531 s
[INFO] Finished at: 2017-11-27T18:00:31+05:30
[INFO] Final Memory: 16M/272M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project Nextouch: Compilation failure -> [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project Nextouch: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1033)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:137)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException"
</code>```

Any suggestion would help

Here is the pom.xml

```        <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">
            <modelVersion>4.0.0</modelVersion>
            <groupId>com.Test.Test</groupId>
            <artifactId>Test</artifactId>
            <packaging>war</packaging>
            <version>1.0-SNAPSHOT</version>
            <name>Test</name>
            <repositories>

                <repository>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <id>central</id>
                    <name>Central Repository</name>
                    <url>https://repo.maven.apache.org/maven2</url>
                </repository>

            </repositories>

            <dependencies>
                <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>3.8.1</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                    <version>1.10.1</version>
                </dependency>
                <dependency>
                    <groupId>ant</groupId>
                    <artifactId>ant-optional</artifactId>
                    <version>1.5.2</version>
                </dependency>
                <dependency>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                    <version>2.7.7</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.axis</groupId>
                    <artifactId>axis</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml</groupId>
                    <artifactId>classmate</artifactId>
                    <version>1.3.4</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcmail-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>org.gephi</groupId>
                    <artifactId>ui-utils</artifactId>
                    <version>0.9.2</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpg-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                    <version>3.2.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-dbcp</groupId>
                    <artifactId>commons-dbcp</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                    <version>2.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-discovery</groupId>
                    <artifactId>commons-discovery</artifactId>
                    <version>0.5</version>
                </dependency>
                <dependency>
                    <groupId>commons-fileupload</groupId>
                    <artifactId>commons-fileupload</artifactId>
                    <version>1.3.3</version>
                </dependency>
                <dependency>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                    <version>3.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                    <version>2.5</version>
                </dependency>
                <dependency>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                    <version>2.6</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                    <version>3.6</version>
                </dependency>
                <dependency>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>commons-pool</groupId>
                    <artifactId>commons-pool</artifactId>
                    <version>1.6</version>
                </dependency>
                <dependency>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                    <version>1.6.1</version>
                </dependency>
                <dependency>
                    <groupId>com.google.code.gson</groupId>
                    <artifactId>gson</artifactId>
                    <version>2.8.2</version>
                </dependency>
                <dependency>
                    <groupId>com.lowagie</groupId>
                    <artifactId>itext</artifactId>
                    <version>2.1.7</version>
                </dependency>
                <dependency>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                    <version>1.3</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss</groupId>
                    <artifactId>jandex</artifactId>
                    <version>2.0.3.Final</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                    <version>2.9.2</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-core-asl</artifactId>
                    <version>1.9.13</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-mapper-asl</artifactId>
                    <version>1.9.13</version>
                </dependency>
                <dependency>
                    <groupId>com.google.http-client</groupId>
                    <artifactId>google-http-client</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.oauth-client</groupId>
                    <artifactId>google-oauth-client</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.http-client</groupId>
                    <artifactId>google-http-client-jackson2</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>javax.servlet-api</artifactId>
                    <version>3.1.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>jboss</groupId>
                    <artifactId>jboss-ejb3x</artifactId>
                    <version>4.2.2.GA</version>
                </dependency>
                <dependency>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging</artifactId>
                    <version>3.3.0.Final</version>
                </dependency>
                <dependency>
                    <groupId>jboss</groupId>
                    <artifactId>jbosssx</artifactId>
                    <version>3.2.3</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                    <version>2.9.9</version>
                </dependency>

                <dependency>
                    <groupId>com.jcraft</groupId>
                    <artifactId>jsch</artifactId>
                    <version>0.1.54</version>
                </dependency>
                <dependency>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                    <version>2.9.9</version>
                </dependency>

                <dependency>
                    <groupId>org.owasp.esapi</groupId>
                    <artifactId>esapi</artifactId>
                    <version>2.1.0</version>
                </dependency>

                    <groupId>org.eclipse.core</groupId>
                    <artifactId>resources</artifactId>
                    <version>3.3.0-v20070604</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
                    <artifactId>org.mozilla.javascript</artifactId>
                    <version>1.7.2</version>
                </dependency>
                <dependency>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                    <version>3.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.debug</groupId>
                    <artifactId>core</artifactId>
                    <version>3.3.0-v20070607-1800</version>
                </dependency>
                <dependency>
                    <groupId>rhino</groupId>
                    <artifactId>js</artifactId>
                    <version>1.7R2</version>
                </dependency>
                <dependency>
                    <groupId>jstl</groupId>
                    <artifactId>jstl</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                    <version>1.2.17</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>opensaml</artifactId>
                    <version>2.6.4</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>openws</artifactId>
                    <version>1.4.1</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>xmltooling</artifactId>
                    <version>1.4.4</version>
                </dependency>
                <dependency>
                    <groupId>oro</groupId>
                    <artifactId>oro</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>fontbox</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi</artifactId>
                    <version>3.16</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-excelant</artifactId>
                    <version>3.17</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-ooxml</artifactId>
                    <version>3.15</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-ooxml-schemas</artifactId>
                    <version>3.14</version>
                </dependency>
                <dependency>
                    <groupId>quartz</groupId>
                    <artifactId>quartz</artifactId>
                    <version>1.5.2</version>
                </dependency>
                <dependency>
                    <groupId>xml-resolver</groupId>
                    <artifactId>xml-resolver</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.soap</groupId>
                    <artifactId>saaj-api</artifactId>
                    <version>1.3.4</version>
                </dependency>
                <dependency>
                    <groupId>xalan</groupId>
                    <artifactId>serializer</artifactId>
                    <version>2.7.2</version>
                </dependency>
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>mssql-jdbc</artifactId>
                    <version>6.2.0.jre7</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>taglibs</groupId>
                    <artifactId>standard</artifactId>
                    <version>1.1.2</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.stream</groupId>
                    <artifactId>stax-api</artifactId>
                    <version>1.0-2</version>
                </dependency>

                <dependency>
                    <groupId>org.apache.velocity</groupId>
                    <artifactId>velocity</artifactId>
                    <version>1.7</version>
                </dependency>
                <dependency>
                    <groupId>wsdl4j</groupId>
                    <artifactId>wsdl4j</artifactId>
                    <version>1.6.2</version>
                </dependency>
                <dependency>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                    <version>2.11.0</version>
                </dependency>
                <dependency>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                    <version>1.4.01</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.xmlbeans</groupId>
                    <artifactId>xmlbeans</artifactId>
                    <version>2.6.0</version>
                </dependency>
                <dependency>
                    <groupId>xml-security</groupId>
                    <artifactId>xmlsec</artifactId>
                    <version>1.3.0</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>juli</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-api</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-util</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-servlet-api</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper-el</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                    <version>4.4.6</version>
                </dependency>

                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>el-api</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <version>4.5.2</version>
                </dependency>

                <dependency>
                    <groupId>edtftp</groupId>
                    <artifactId>edtftp</artifactId>
                    <version>1.2.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox</artifactId>
                    <version>2.0.7</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox-debugger</artifactId>
                    <version>2.0.8</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox-tools</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>preflight</artifactId>
                    <version>2.0.8</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                    <version>3.4.0</version>
                </dependency>
                <dependency>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                    <version>1.1.1</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.soap</groupId>
                    <artifactId>saaj-api</artifactId>
                    <version>1.3</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-jta_1.1_spec</artifactId>
                    <version>1.1.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>xmpbox</artifactId>
                    <version>2.0.6</version>
                </dependency>

                <dependency>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                    <version>3.21.0-GA</version>
                </dependency>
                <dependency>
                    <groupId>com.google.zxing</groupId>
                    <artifactId>core</artifactId>
                    <version>3.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.zxing</groupId>
                    <artifactId>javase</artifactId>
                    <version>3.2.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-digester3</artifactId>
                    <version>3.0</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate.common</groupId>
                    <artifactId>hibernate-commons-annotations</artifactId>
                    <version>5.0.1.Final</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>5.2.10.Final</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate.javax.persistence</groupId>
                    <artifactId>hibernate-jpa-2.1-api</artifactId>
                    <version>1.0.0.Final</version>
                </dependency>
                <dependency>
                    <groupId>ca.juliusdavies</groupId>
                    <artifactId>not-yet-commons-ssl</artifactId>
                    <version>0.3.11</version>
                </dependency>
                <dependency>
                    <groupId>org.ogce</groupId>
                    <artifactId>xpp3</artifactId>
                    <version>1.1.6</version>
                </dependency>

            </dependencies>

         <build>
            <pluginManagement>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.7.0</version>
                        <configuration>
                            <compilerArgs>
                                <arg>-XDignore.symbol.file</arg>
                            </compilerArgs>
                            <maxmem>${java.memory}</maxmem>
                            <fork>${java.fork}</fork>
                            <source>1.7</source>
                            <target>1.7</target>
                            <verbose>true</verbose>
                            <fork>true</fork>
                            <executable>${JAVA_1_7_HOME}/bin/javac</executable>
                            <compilerVersion>1.7</compilerVersion>
                            <excludes>
                                <exclude>com\ui\swing/*.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
         </build>

        </project>
```

答:
You do not have a plugins section to your pom.xml, and your pom xml looks malformed (no opening plugins element)

See this post for more info: Maven: What is pluginManagement?

Since this is a single module project, you can simply replace pluginManagement with plugins as follows.

```<code><build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <compilerArgs>
                        <arg>-XDignore.symbol.file</arg>
                    </compilerArgs>
                    <maxmem>${java.memory}</maxmem>
                    <fork>${java.fork}</fork>
                    <source>1.7</source>
                    <target>1.7</target>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <executable>${JAVA_1_7_HOME}/bin/javac</executable>
                    <compilerVersion>1.7</compilerVersion>
                    <excludes>
                        <exclude>com\hartehanks\ntouch\ui\swing/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
 </build>
</code>```

Body:
I am trying to build a project using maven. The compilation fails without giving any clue of why the compilation is failing. I am using Jdk 1.7 to build the code. The same code is getting built without any errors when building via ant

I am getting the below error

[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/util/List.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/Class.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(javax/xml/transform/sax/TransformerHandler.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Users\vadagr\.m2\repository\com\google\code\gson\gson\2.8.2\gson-2.8.2.jar(com/google/gson/stream/JsonWriter.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/io/IOException.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/Iterable.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/SuppressWarnings.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Annotation.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Target.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/ElementType.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/Retention.class)]]
[INFO] [loading ZipFileIndexFileObject[C:\Program Files (x86)\Java\jdk1.7.0\jre\lib\rt.jar(java/lang/annotation/RetentionPolicy.class)]]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53.531 s
[INFO] Finished at: 2017-11-27T18:00:31+05:30
[INFO] Final Memory: 16M/272M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project Nextouch: Compilation failure -> [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project Nextouch: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1033)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:137)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException"

Any suggestion would help

Here is the pom.xml

        <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">
            <modelVersion>4.0.0</modelVersion>
            <groupId>com.Test.Test</groupId>
            <artifactId>Test</artifactId>
            <packaging>war</packaging>
            <version>1.0-SNAPSHOT</version>
            <name>Test</name>
            <repositories>

                <repository>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <id>central</id>
                    <name>Central Repository</name>
                    <url>https://repo.maven.apache.org/maven2</url>
                </repository>

            </repositories>

            <dependencies>
                <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>3.8.1</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant</artifactId>
                    <version>1.10.1</version>
                </dependency>
                <dependency>
                    <groupId>ant</groupId>
                    <artifactId>ant-optional</artifactId>
                    <version>1.5.2</version>
                </dependency>
                <dependency>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                    <version>2.7.7</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.axis</groupId>
                    <artifactId>axis</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml</groupId>
                    <artifactId>classmate</artifactId>
                    <version>1.3.4</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcmail-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>org.gephi</groupId>
                    <artifactId>ui-utils</artifactId>
                    <version>0.9.2</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpg-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</artifactId>
                    <version>1.58</version>
                </dependency>
                <dependency>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                    <version>3.2.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-dbcp</groupId>
                    <artifactId>commons-dbcp</artifactId>
                    <version>1.4</version>
                </dependency>
                <dependency>
                    <groupId>commons-digester</groupId>
                    <artifactId>commons-digester</artifactId>
                    <version>2.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-discovery</groupId>
                    <artifactId>commons-discovery</artifactId>
                    <version>0.5</version>
                </dependency>
                <dependency>
                    <groupId>commons-fileupload</groupId>
                    <artifactId>commons-fileupload</artifactId>
                    <version>1.3.3</version>
                </dependency>
                <dependency>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                    <version>3.1</version>
                </dependency>
                <dependency>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                    <version>2.5</version>
                </dependency>
                <dependency>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                    <version>2.6</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                    <version>3.6</version>
                </dependency>
                <dependency>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>commons-pool</groupId>
                    <artifactId>commons-pool</artifactId>
                    <version>1.6</version>
                </dependency>
                <dependency>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                    <version>1.6.1</version>
                </dependency>
                <dependency>
                    <groupId>com.google.code.gson</groupId>
                    <artifactId>gson</artifactId>
                    <version>2.8.2</version>
                </dependency>
                <dependency>
                    <groupId>com.lowagie</groupId>
                    <artifactId>itext</artifactId>
                    <version>2.1.7</version>
                </dependency>
                <dependency>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                    <version>1.3</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss</groupId>
                    <artifactId>jandex</artifactId>
                    <version>2.0.3.Final</version>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                    <version>2.9.2</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-core-asl</artifactId>
                    <version>1.9.13</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-mapper-asl</artifactId>
                    <version>1.9.13</version>
                </dependency>
                <dependency>
                    <groupId>com.google.http-client</groupId>
                    <artifactId>google-http-client</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.oauth-client</groupId>
                    <artifactId>google-oauth-client</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.http-client</groupId>
                    <artifactId>google-http-client-jackson2</artifactId>
                    <version>1.22.0</version>
                </dependency>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>javax.servlet-api</artifactId>
                    <version>3.1.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>jboss</groupId>
                    <artifactId>jboss-ejb3x</artifactId>
                    <version>4.2.2.GA</version>
                </dependency>
                <dependency>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging</artifactId>
                    <version>3.3.0.Final</version>
                </dependency>
                <dependency>
                    <groupId>jboss</groupId>
                    <artifactId>jbosssx</artifactId>
                    <version>3.2.3</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                    <version>2.9.9</version>
                </dependency>

                <dependency>
                    <groupId>com.jcraft</groupId>
                    <artifactId>jsch</artifactId>
                    <version>0.1.54</version>
                </dependency>
                <dependency>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                    <version>2.9.9</version>
                </dependency>

                <dependency>
                    <groupId>org.owasp.esapi</groupId>
                    <artifactId>esapi</artifactId>
                    <version>2.1.0</version>
                </dependency>

                    <groupId>org.eclipse.core</groupId>
                    <artifactId>resources</artifactId>
                    <version>3.3.0-v20070604</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
                    <artifactId>org.mozilla.javascript</artifactId>
                    <version>1.7.2</version>
                </dependency>
                <dependency>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                    <version>3.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.debug</groupId>
                    <artifactId>core</artifactId>
                    <version>3.3.0-v20070607-1800</version>
                </dependency>
                <dependency>
                    <groupId>rhino</groupId>
                    <artifactId>js</artifactId>
                    <version>1.7R2</version>
                </dependency>
                <dependency>
                    <groupId>jstl</groupId>
                    <artifactId>jstl</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                    <version>1.2.17</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>opensaml</artifactId>
                    <version>2.6.4</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>openws</artifactId>
                    <version>1.4.1</version>
                </dependency>
                <dependency>
                    <groupId>org.opensaml</groupId>
                    <artifactId>xmltooling</artifactId>
                    <version>1.4.4</version>
                </dependency>
                <dependency>
                    <groupId>oro</groupId>
                    <artifactId>oro</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>fontbox</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi</artifactId>
                    <version>3.16</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-excelant</artifactId>
                    <version>3.17</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-ooxml</artifactId>
                    <version>3.15</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.poi</groupId>
                    <artifactId>poi-ooxml-schemas</artifactId>
                    <version>3.14</version>
                </dependency>
                <dependency>
                    <groupId>quartz</groupId>
                    <artifactId>quartz</artifactId>
                    <version>1.5.2</version>
                </dependency>
                <dependency>
                    <groupId>xml-resolver</groupId>
                    <artifactId>xml-resolver</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.soap</groupId>
                    <artifactId>saaj-api</artifactId>
                    <version>1.3.4</version>
                </dependency>
                <dependency>
                    <groupId>xalan</groupId>
                    <artifactId>serializer</artifactId>
                    <version>2.7.2</version>
                </dependency>
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>mssql-jdbc</artifactId>
                    <version>6.2.0.jre7</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>taglibs</groupId>
                    <artifactId>standard</artifactId>
                    <version>1.1.2</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.stream</groupId>
                    <artifactId>stax-api</artifactId>
                    <version>1.0-2</version>
                </dependency>

                <dependency>
                    <groupId>org.apache.velocity</groupId>
                    <artifactId>velocity</artifactId>
                    <version>1.7</version>
                </dependency>
                <dependency>
                    <groupId>wsdl4j</groupId>
                    <artifactId>wsdl4j</artifactId>
                    <version>1.6.2</version>
                </dependency>
                <dependency>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                    <version>2.11.0</version>
                </dependency>
                <dependency>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                    <version>1.4.01</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.xmlbeans</groupId>
                    <artifactId>xmlbeans</artifactId>
                    <version>2.6.0</version>
                </dependency>
                <dependency>
                    <groupId>xml-security</groupId>
                    <artifactId>xmlsec</artifactId>
                    <version>1.3.0</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>juli</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-api</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-util</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-servlet-api</artifactId>
                    <version>9.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper-el</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                    <version>4.4.6</version>
                </dependency>

                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>el-api</artifactId>
                    <version>6.0.53</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <version>4.5.2</version>
                </dependency>

                <dependency>
                    <groupId>edtftp</groupId>
                    <artifactId>edtftp</artifactId>
                    <version>1.2.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox</artifactId>
                    <version>2.0.7</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox-debugger</artifactId>
                    <version>2.0.8</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>pdfbox-tools</artifactId>
                    <version>2.0.8</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>preflight</artifactId>
                    <version>2.0.8</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                    <version>3.4.0</version>
                </dependency>
                <dependency>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                    <version>1.1.1</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.soap</groupId>
                    <artifactId>saaj-api</artifactId>
                    <version>1.3</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-jta_1.1_spec</artifactId>
                    <version>1.1.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.pdfbox</groupId>
                    <artifactId>xmpbox</artifactId>
                    <version>2.0.6</version>
                </dependency>

                <dependency>
                    <groupId>org.javassist</groupId>
                    <artifactId>javassist</artifactId>
                    <version>3.21.0-GA</version>
                </dependency>
                <dependency>
                    <groupId>com.google.zxing</groupId>
                    <artifactId>core</artifactId>
                    <version>3.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.zxing</groupId>
                    <artifactId>javase</artifactId>
                    <version>3.2.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-digester3</artifactId>
                    <version>3.0</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate.common</groupId>
                    <artifactId>hibernate-commons-annotations</artifactId>
                    <version>5.0.1.Final</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>5.2.10.Final</version>
                </dependency>
                <dependency>
                    <groupId>org.hibernate.javax.persistence</groupId>
                    <artifactId>hibernate-jpa-2.1-api</artifactId>
                    <version>1.0.0.Final</version>
                </dependency>
                <dependency>
                    <groupId>ca.juliusdavies</groupId>
                    <artifactId>not-yet-commons-ssl</artifactId>
                    <version>0.3.11</version>
                </dependency>
                <dependency>
                    <groupId>org.ogce</groupId>
                    <artifactId>xpp3</artifactId>
                    <version>1.1.6</version>
                </dependency>

            </dependencies>

         <build>
            <pluginManagement>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.7.0</version>
                        <configuration>
                            <compilerArgs>
                                <arg>-XDignore.symbol.file</arg>
                            </compilerArgs>
                            <maxmem>${java.memory}</maxmem>
                            <fork>${java.fork}</fork>
                            <source>1.7</source>
                            <target>1.7</target>
                            <verbose>true</verbose>
                            <fork>true</fork>
                            <executable>${JAVA_1_7_HOME}/bin/javac</executable>
                            <compilerVersion>1.7</compilerVersion>
                            <excludes>
                                <exclude>com\ui\swing/*.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
         </build>

        </project>

Body:
You do not have a plugins section to your pom.xml, and your pom xml looks malformed (no opening plugins element)

See this post for more info: Maven: What is pluginManagement?

Since this is a single module project, you can simply replace pluginManagement with plugins as follows.

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <compilerArgs>
                        <arg>-XDignore.symbol.file</arg>
                    </compilerArgs>
                    <maxmem>${java.memory}</maxmem>
                    <fork>${java.fork}</fork>
                    <source>1.7</source>
                    <target>1.7</target>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <executable>${JAVA_1_7_HOME}/bin/javac</executable>
                    <compilerVersion>1.7</compilerVersion>
                    <excludes>
                        <exclude>com\hartehanks\ntouch\ui\swing/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
 </build>


来源: stackexchange

问:
k2 module subtemplate doesn't pick up changes after editing - joomla 3.8.0
I hope some of you joomla enthusiast can help a beginner with a problem.

So I created a subtemplate for a k2 module in the folder templates/my_template/html/mod_k2_content. This folder contains the two subfolders Default (contains the default.php) and Team (contains the team.php).
The team.php file is the default.php file with minor changes. Everything worked fine and i could select the "Team" subtemplates in the joomla backend and it also showed the changes.  Now I tried to edit the team.php in templates/my_template/html/mod_k2_content/Team again and it just doesn't pick up the changes anymore. When I edit the default.php in templates/my_template/html/mod_k2_content/Default it works just fine on the modules that work with the default subtemplate.

But the modules that have the Team subtemplate selected just stay the same, the way they were when i first selected this subtemplate for the modules.

Anybody that already enountered that problem and knows what I'm doing wrong?
I already reselected the team subtemplate several times and made sure I'm connected to the server. I also encluded a bunch of characters in the code to make the changes more visible, to make sure I'd truly notice them if the would be picked up. But nothing.

I'm really grateful if someone can help.

Thank you a lot!

答: Okay i figured it out myself - The problem is that i can have different folders with different names in my templates/my_template/html/mod_k2_content folder, but each folder needs to contain a default.php. I renamed the team.php in my templates/my_template/html/mod_k2_content/Team folder to default.php and now the changes are being picked up !</p>

ContentLicense: CC BY-SA 3.0


问:
Create GeoTIFF from LIDAR file
Generally I'm trying create raster from LIDAR cloud (files with extension .las) to geoTif. It is new to me and I don't know how I should start. For now I read all points from las file and I check all point by dimention 'Z' and each highest point draw in tif file. For create tif i use GDAL library from QGIS.

In LASTool and I found app which convert LAS to TIF but it is paid. I need something what is free. Maybe somebody had the same problem and he will share solution?

Moreover I need to my tiff file had tiles. So if somebody also had some code I will be grateful.

EDIT:

Thanks @chambbj , generally it is good suggestion because PDAL is great but this solution create me tif in grays colors. but I need something what will consider all colors in LAS file. I saw filters (colorization) but it not work :( maybe i'm doing some wrong? I don't know.
Would be great, if I able to separet all point in cloud by max Z dimension and create tif file.

Example:
For now I have something like this

but I need some like this:

Each pixel is 5cm2

答:
You can do this with PDAL, using the GDAL writer stage. There exists a tutorial on the topic, which you may find informative.

The basic pipeline JSON would look something like

```<code>{
    "pipeline":[
        "input.las",
        {
            "type":"writers.gdal",
            "filename":"output.tif",
            "resolution":2.0,
            "output_type":"max"
        }
    ]
}
</code>```

which can be executed with the PDAL pipeline command

```<code>pdal pipeline pipeline.json
</code>```

Title: Create GeoTIFF from LIDAR file

Body:
You can do this with PDAL, using the GDAL writer stage. There exists a tutorial on the topic, which you may find informative.

The basic pipeline JSON would look something like

{
    "pipeline":[
        "input.las",
        {
            "type":"writers.gdal",
            "filename":"output.tif",
            "resolution":2.0,
            "output_type":"max"
        }
    ]
}

which can be executed with the PDAL pipeline command

pdal pipeline pipeline.json


问:
Can I see Http Queue Length inside Azure Application Insight?
My Azure WebApp is having problem with many requests in Http Queue.
To analyse the reason and find out what the problem is, I would like to see the Http Queue Length inside Application Insight.

I wonder if it's possible to see the Http Queue Length inside Azure Application Insight?

If it is possible then I would like to know how to see this value.

I have tried to find Http Queue Length in Azure Application Insight in Portal GUI.

I have also tried to find Http Queue Length in analytics.applicationinsights.io.

I have also tried to get Http Queue Length from the Azure REST API, but I did not succeed in getting the value.
If I did then I could add it as a custom event into Application Insight.

Thanks,
Henrik

答:
Unfortunately for Azure Web Apps the answer is no as there is only a subset of performance counters available to the web app process and by extension Application Insights.

You’ve already been looking into this, but be sure you’re trying to get the queue length for the App Sevice Plan and not the Web App Instance via the REST APIs or the PowerShell cmdlet. The link below explains that it is only available for some tiers and only available for the App Service Plan.

https://learn.microsoft.com/en-us/azure/app-service/web-sites-monitor#understanding-quotas-and-metrics


问:
Transitioned SQL database from Azure VM to Azure SQL database - size of new db is significantly smaller?
I have a database of approximately 70GB in size residing on SQL Server 2016 Enterprise on an Azure VM.  We decided to move this to an Azure SQL Database.

I accomplished the move via the "Deploy to Azure SQL Database"  (right-click on the database and it's under Tasks).  This wizard seemed very complete and ran a battery of tests, followed by doing the deployment step-by-very-detailed-step.  The full process took about 3 hours, but it finished with all steps marked as success.

The issue is the size of the resulting Azure SQL database is only showing as 31GB??  Is this possible?  Is there a possibility that there were 40gb worth of extraneous/temporary/unneeded data that the transition process recognized as unnecessary?  As you can imagine, I'm very hesitant to take down the original database and start using the new one given this difference in size.

答: The size of the data files seen from the operating system is not a good indication of the size of the data they content. Connect with SSMS to the SQL Server instance in your Azure VM, make a right click on the database, make a click on Taks, now select Shrink, then select Files. Look at the "Currently allocated space" and the "Available free space" of the Data file. From the "File type" choose "Log" and that should give the allocated size and the free space of the log also.</p>


问:
run time annotation scanning when Dynamic class loading
```<code>import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Method;

// declare a new annotation
@Retention(RetentionPolicy.RUNTIME)
@interface Demo {
   String str();
   int val();
}

public class PackageDemo {

   // set values for the annotation
   @Demo(str = "Demo Annotation", val = 100)
   // a method to call in the main
   public static void example() {
      PackageDemo ob = new PackageDemo();

      try {
         Class c = ob.getClass();

         // get the method example
         Method m = c.getMethod("example");

         // get the annotation for class Demo
         Demo annotation = m.getAnnotation(Demo.class);

         // print the annotation
         System.out.println(annotation.str() + " " + annotation.val());
      } catch (NoSuchMethodException exc) {
         exc.printStackTrace();
      }
   }
   public static void main(String args[]) {
      example();
   }
}
</code>```

My objective is to check the annotation on few methods and if it exists on the annotation , I need to get the annotation.

```<code>Demo annotation = m.getAnnotation(Demo.class);
</code>```

In the above example , the annotation is declared in the same file. If annotation is in a different package I can do something like

```<code>import com.this.class.DemoClass
try {
         Class c = ob.getClass();

         // get the method example
         Method m = c.getMethod("example");

         // get the annotation for class Demo
         Demo annotation = m.getAnnotation(Demo.class);
</code>```

But if I want to load the DemoClass/AnnotationClass dynamically like

```<code>Class<?> Demo = Class.forName("com.this.class.DemoClass")
</code>```

How do I get the annotation on the methods. I think the below line doesn't works in this case

```<code>Demo annotation = m.getAnnotation(Demo.class);
</code>```

答:
This approach worked for me. hope this helps someone.   </p>

```<code> DemoClass= (Class<Annotation>) Class.forName("com.this.class.DemoClass");
    if (method.isAnnotationPresent(DemoClass)) {
       for (Annotation annotation : method.getAnnotations()) {
       Class<? extends Annotation> annotationType = annotation.annotationType();
       if (annotationType.getName() == "com.this.class.DemoClass") {
          for (Method annotationMethod : annotationType.getDeclaredMethods()) {
          value= annotationMethod.invoke(annotation, (Object[]) null);
          }
       }
     }
</code>```

Body:
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Method;

// declare a new annotation
@Retention(RetentionPolicy.RUNTIME)
@interface Demo {
   String str();
   int val();
}

public class PackageDemo {

   // set values for the annotation
   @Demo(str = "Demo Annotation", val = 100)
   // a method to call in the main
   public static void example() {
      PackageDemo ob = new PackageDemo();

      try {
         Class c = ob.getClass();

         // get the method example
         Method m = c.getMethod("example");

         // get the annotation for class Demo
         Demo annotation = m.getAnnotation(Demo.class);

         // print the annotation
         System.out.println(annotation.str() + " " + annotation.val());
      } catch (NoSuchMethodException exc) {
         exc.printStackTrace();
      }
   }
   public static void main(String args[]) {
      example();
   }
}

My objective is to check the annotation on few methods and if it exists on the annotation , I need to get the annotation.

Demo annotation = m.getAnnotation(Demo.class);

In the above example , the annotation is declared in the same file. If annotation is in a different package I can do something like

import com.this.class.DemoClass
try {
         Class c = ob.getClass();

         // get the method example
         Method m = c.getMethod("example");

         // get the annotation for class Demo
         Demo annotation = m.getAnnotation(Demo.class);

But if I want to load the DemoClass/AnnotationClass dynamically like

Class<?> Demo = Class.forName("com.this.class.DemoClass")

How do I get the annotation on the methods. I think the below line doesn't works in this case

Demo annotation = m.getAnnotation(Demo.class);

Body:
This approach worked for me. hope this helps someone.

 DemoClass= (Class<Annotation>) Class.forName("com.this.class.DemoClass");
    if (method.isAnnotationPresent(DemoClass)) {
       for (Annotation annotation : method.getAnnotations()) {
       Class<? extends Annotation> annotationType = annotation.annotationType();
       if (annotationType.getName() == "com.this.class.DemoClass") {
          for (Method annotationMethod : annotationType.getDeclaredMethods()) {
          value= annotationMethod.invoke(annotation, (Object[]) null);
          }
       }
     }


问:
Swift cannot print to console using the terminator argument
I am making making a command line application to learn swift and OOP programming. My code works fine in the Xcode debugger (I see the input and output just fine), however when I archive and export my project, I for some reason cannot see the output of the print function.

Here is an example of what I mean.

Debugging in Xcode:

```<code>Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 0
Username: User
Password: Pass
User: User sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 0
Username: User2
Password: Pass
User: User2 sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
User2
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 2
Delete user: User2
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 3

Program ended with exit code: 0
</code>```

Now when I run the archived exported command line application in terminal:

```<code>Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
0
User
Pass
Option: Username: Password: User: User sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
3
</code>```

As you can see, the program registers my input and sometimes prints.

I have tried to take away the terminator: "" away from the print function to see if that is the issue and it printed just fine. This seems to be an issue with the terminator argument. I have also tried to replace the "" to " " for the terminator argument and it still doesn't work.

Why is it I cannot output to the console with the terminator argument?

Here is the code:

```<code>import Foundation

var running:Bool = true
let loginSystem = LoginSystem()

repeat
{
print("Welcome to the login system")
print("-----------------------------\n")
print("Add a user    [0]")
print("List users    [1]")
print("Delete user   [2]")
print("Quit System   [3]")
print("-------------------------------")
printToConsole("Option: ")
let option = input().intValue

//Add a user
if option == 0
{
    print("Username: ", terminator: " ")
    let username = input()
    print("Password: ", terminator: " ")
    let password = input()
    print("User: \(username) sucsessully added to the system")
    loginSystem.addUser(username, password: password, uid: 0, guid: 0)

//List users
} else if option == 1 {
    let users = loginSystem.getUsers()
    printArray(users)

//Delete user
} else if option == 2 {
    printToConsole("Delete user: ")
    let user = input()
    loginSystem.deleteUser(user)

//Quit
} else if option == 3 {
    running = false
}
clear()
} while running

print("")
</code>```

printArray(theArray: [AnyObject]):

```<code>func printArray(theArray:[AnyObject])
{
    for item in theArray
    {
        print("\(item)")
    }
}
</code>```

clear()

```<code>func clear()
{
    let clearCommand = "if [ -n \"$STY\" ]; then clear; fi"
    system(clearCommand)
}
</code>```

input()

```<code>func input() -> String {
    let keyboard = NSFileHandle.fileHandleWithStandardInput()
    let inputData = keyboard.availableData
    let strData = NSString(data: inputData, encoding: NSUTF8StringEncoding)!
    return strData.stringByTrimmingCharactersInSet(NSCharacterSet.newlineCharacterSet())
}
</code>```

intVal

```<code>extension String
{
    var intValue:Int
    {
        return Int(self)!
    }
}
</code>```

答:
try </p>

```<code>repeat
{
fflush(stdout)
print("Welcome to the login system")
</code>```

Body:
I am making making a command line application to learn swift and OOP programming. My code works fine in the Xcode debugger (I see the input and output just fine), however when I archive and export my project, I for some reason cannot see the output of the print function.

Here is an example of what I mean.

Debugging in Xcode:

Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 0
Username: User
Password: Pass
User: User sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 0
Username: User2
Password: Pass
User: User2 sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
User2
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 2
Delete user: User2
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 1
User
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
Option: 3

Program ended with exit code: 0

Now when I run the archived exported command line application in terminal:

Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
0
User
Pass
Option: Username: Password: User: User sucsessully added to the system
Welcome to the login system
-----------------------------

Add a user    [0]
List users    [1]
Delete user   [2]
Quit System   [3]
-------------------------------
3

As you can see, the program registers my input and sometimes prints.

I have tried to take away the terminator: "" away from the print function to see if that is the issue and it printed just fine. This seems to be an issue with the terminator argument. I have also tried to replace the "" to " " for the terminator argument and it still doesn't work.

Why is it I cannot output to the console with the terminator argument?

Here is the code:

import Foundation

var running:Bool = true
let loginSystem = LoginSystem()

repeat
{
print("Welcome to the login system")
print("-----------------------------\n")
print("Add a user    [0]")
print("List users    [1]")
print("Delete user   [2]")
print("Quit System   [3]")
print("-------------------------------")
printToConsole("Option: ")
let option = input().intValue

//Add a user
if option == 0
{
    print("Username: ", terminator: " ")
    let username = input()
    print("Password: ", terminator: " ")
    let password = input()
    print("User: \(username) sucsessully added to the system")
    loginSystem.addUser(username, password: password, uid: 0, guid: 0)

//List users
} else if option == 1 {
    let users = loginSystem.getUsers()
    printArray(users)

//Delete user
} else if option == 2 {
    printToConsole("Delete user: ")
    let user = input()
    loginSystem.deleteUser(user)

//Quit
} else if option == 3 {
    running = false
}
clear()
} while running

print("")

printArray(theArray: [AnyObject]):

func printArray(theArray:[AnyObject])
{
    for item in theArray
    {
        print("\(item)")
    }
}

clear()

func clear()
{
    let clearCommand = "if [ -n \"$STY\" ]; then clear; fi"
    system(clearCommand)
}

input()

func input() -> String {
    let keyboard = NSFileHandle.fileHandleWithStandardInput()
    let inputData = keyboard.availableData
    let strData = NSString(data: inputData, encoding: NSUTF8StringEncoding)!
    return strData.stringByTrimmingCharactersInSet(NSCharacterSet.newlineCharacterSet())
}

intVal

extension String
{
    var intValue:Int
    {
        return Int(self)!
    }
}

Body:
try

repeat
{
fflush(stdout)
print("Welcome to the login system")


问:
How are people handling user authentication for web services?
I'm creating a web service to expose some data via publicly accessible APIs. At a high level, what mechanisms are people using to secure their APIs to ensure that a valid, authenticated user is making the call?

The service will be C#, the consumer could be anything (Facebook or iPhone app as well as a website) so Microsoft only solutions are out.

It's not a new problem so I assume there are some standard practices in place to deal with it but my google-fu is failing me on this one. Can the collective point me to any resources? Thanks.

答:
Try the answers in this similar question:

What is the best way to handle authentication in ASP.NET MVC with a Universe database?

ContentLicense: CC BY-SA 2.5


问:
How to remove elements from a vector while iterating through
I have a vector, and I need to compare every element and remove elements until only one remains. I have some loops to iterate through, but once I remove a few elements I get "Vector subscript out of range".
I imagine this is because I've deleted elements and am trying to iterate over empty space in the vector, but I thought my loop condition would handle it.

Basically I'm storing shapes, and remove shapes that are overlapping until one remains, shuffling the positions on the grid if none are overlapping. (assume the conditionmet() is correct)

```<code>while (shapeGrid.size() > 1)
{
    for (int i = 0; i < shapeGrid.size(); i++)
    {

        for (int x = 0; x < shapeGrid.size(); x++)
        {

            if (conditionmet())
            {
                    shapeGrid.erase(shapeGrid.begin() + x);
                    cout << "Shape Removed" << endl;

            }

            if (conditionmet())
            {
                    shapeGrid.erase(shapeGrid.begin() + x);
                    cout << "Shape Removed" << endl;

            }

        }
    }
    for (int i = 0; i < shapeGrid.size(); i++)  // Shuffle positions
    {
        shapeGrid[i].x = (rand() % 100) + 1;
        shapeGrid[i].y = (rand() % 100) + 1;
    }
}
</code>```

答:
Typically, you should avoid modifying the dimensions of an array or vector in an iteration/loop- as you risk running into the invalid index issue, or missing items appended at the end.

Rather than removing elements on the vector object as you iterate through it, you should create a new vector object in the iteration process, copying what you want to keep.  Then after the loop, reset/replace the original vector variable with the newly pruned one.

Body:
I have a vector, and I need to compare every element and remove elements until only one remains. I have some loops to iterate through, but once I remove a few elements I get "Vector subscript out of range".
I imagine this is because I've deleted elements and am trying to iterate over empty space in the vector, but I thought my loop condition would handle it.

Basically I'm storing shapes, and remove shapes that are overlapping until one remains, shuffling the positions on the grid if none are overlapping. (assume the conditionmet() is correct)

while (shapeGrid.size() > 1)
{
    for (int i = 0; i < shapeGrid.size(); i++)
    {

        for (int x = 0; x < shapeGrid.size(); x++)
        {

            if (conditionmet())
            {
                    shapeGrid.erase(shapeGrid.begin() + x);
                    cout << "Shape Removed" << endl;

            }

            if (conditionmet())
            {
                    shapeGrid.erase(shapeGrid.begin() + x);
                    cout << "Shape Removed" << endl;

            }

        }
    }
    for (int i = 0; i < shapeGrid.size(); i++)  // Shuffle positions
    {
        shapeGrid[i].x = (rand() % 100) + 1;
        shapeGrid[i].y = (rand() % 100) + 1;
    }
}


问:
Tomcat console output in Eclipse: where is my System.out.print() output, how to debug?
In Eclipse's console I can only see the tomcat server start logs, but then nothing else, none of the system.out.print() from my application are displayed, which makes it difficult to debug.

What settings can I change in Eclipse to get my system.out.print() out put back in the console?

答:
Ok, the best approach is always to use a logger and log4j is my preferred tool.

First configure the logger by creating a log4j.properties file. Here is a good example that matches your problem:

```<code># Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=INFO, CONSOLE, LOGFILE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
</code>```

This configuration will send info and above messages to the console. Now how you want your log4j.properties to initialize and how you want to reference the the log4j jar libraries dependends upon how you deploy your application.

A good reference for configuration on stackoverflow is here: Where should I put the log4j.properties file?

A good reference on log4j usage is here:http://www.codejava.net/coding/how-to-configure-log4j-as-logging-mechanism-in-java

Note you can configure in multiple ways. It is your call. Now in your class file initialize the logger:

```<code>public class MyClass {
  private static final Logger log = Logger.getLogger(MyClass.class);

  ....

  log.info("A log message to the console!!!!");
</code>```

That's it really. Now you have complete control. It's almost always best to use a logger to control output in general. System.XXX.println's can't be controlled via a central configuration and you will forget to remove them later. Also you can add additional appenders to persist output like so:

```<code># LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.MaxFileSize=5MB
log4j.appender.LOGFILE.File=mylogfile.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p [%c]: %m%n
</code>```

This will generate a mylogfile.log and will keep the files at 5MB max and will keep several (forget the default) versions with a timestamp appended.

I hope that helps. log4j has been around forever and is excellent. There are more tutorials on the web than you can shake a stick at.

Body:
Ok, the best approach is always to use a logger and log4j is my preferred tool.

First configure the logger by creating a log4j.properties file. Here is a good example that matches your problem:

# Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=INFO, CONSOLE, LOGFILE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

This configuration will send info and above messages to the console. Now how you want your log4j.properties to initialize and how you want to reference the the log4j jar libraries dependends upon how you deploy your application.

A good reference for configuration on stackoverflow is here: Where should I put the log4j.properties file?

A good reference on log4j usage is here:http://www.codejava.net/coding/how-to-configure-log4j-as-logging-mechanism-in-java

Note you can configure in multiple ways. It is your call. Now in your class file initialize the logger:

public class MyClass {
  private static final Logger log = Logger.getLogger(MyClass.class);

  ....

  log.info("A log message to the console!!!!");

That's it really. Now you have complete control. It's almost always best to use a logger to control output in general. System.XXX.println's can't be controlled via a central configuration and you will forget to remove them later. Also you can add additional appenders to persist output like so:

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.MaxFileSize=5MB
log4j.appender.LOGFILE.File=mylogfile.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p [%c]: %m%n

This will generate a mylogfile.log and will keep the files at 5MB max and will keep several (forget the default) versions with a timestamp appended.

I hope that helps. log4j has been around forever and is excellent. There are more tutorials on the web than you can shake a stick at.


问:
Where is my mistake - Date calculator for selectbox in Javascript/jQuery?
```<code>$(.dateselboxes) .change( function(){

var y; y=$("#year").val();
var m; m=$("#month").val();
var d;
</code>```

// check leap year

```<code>var leapYear;
if(y%4==0)
{
    if(y%100==0)
    {
        if(y%400==0) {leapYear=true;}
        else {leapYear=false;}
    }
    else {leapYear=true;}
}
else {leapYear=false;}
</code>```

// calculate the number of days

```<code>var dz;
if(m==1 || m=3 || m=5 || m=7 || m=8 || m=10 || m=12) {dz=31;}
else if(m==2)
    {
        if(leapYear==true) {dz=29;}
        else {dz=28;}
    }
else {dz=30;}
</code>```

// remove last option a couple of times

```<code>switch(dz)
    {
        case 28:
            for(i=0;i<3;i++)
            {$("#day option:last").remove();}
            break;
        case 29:
            for(i=0;i<2;i++)
            {$("#day option:last").remove();}
            break;
        case 30:
            $("#day option:last").remove();
            break;
        default:
            var axaxax=0;
            break;
    }
</code>```

});

答:
$(.dateselboxes)! This will not select anything, however $(".dateselboxes") will. The jQuery $ accepts a string as its argument representing the selector.

Asside from that your question has no explanation and loads of code, I haver no idea what is going on!

Body:
$(.dateselboxes) .change( function(){

var y; y=$("#year").val();
var m; m=$("#month").val();
var d;

// check leap year

var leapYear;
if(y%4==0)
{
    if(y%100==0)
    {
        if(y%400==0) {leapYear=true;}
        else {leapYear=false;}
    }
    else {leapYear=true;}
}
else {leapYear=false;}

// calculate the number of days

var dz;
if(m==1 || m=3 || m=5 || m=7 || m=8 || m=10 || m=12) {dz=31;}
else if(m==2)
    {
        if(leapYear==true) {dz=29;}
        else {dz=28;}
    }
else {dz=30;}

// remove last option a couple of times

switch(dz)
    {
        case 28:
            for(i=0;i<3;i++)
            {$("#day option:last").remove();}
            break;
        case 29:
            for(i=0;i<2;i++)
            {$("#day option:last").remove();}
            break;
        case 30:
            $("#day option:last").remove();
            break;
        default:
            var axaxax=0;
            break;
    }

});


问:
Flexdashboard/plotly interaction results in odd scroll bar behavior
I have a bizarre and very frustrating problem. When I build plotly graphs within storyboards (from the flexdashboard package), I get a very annoying and totally unnecessary scroll bar in my legend. When someone tries to click one of the dots on or off, the scroll bar twitches and its practically impossible to click the thing. This scroll bar only appears when the tab with the plotly graph is not immediately visible during the load of the page - i.e. if the page loads with some other tab selected.

I can make the same graph outside of the storyboard, with no problems either in RStudio, or saving it as an htmlwidget and loading it in Chrome. But when I load my storyboard, either in RStudio or in Chrome, I get this annoying scrollbar. The scrollbar exists whether it's a vertical or horizontal legend.

ggplotly objects do not have this problem.

Here's an example of the unnecessary scroll bar. The ggplotly graph is fine, and the plotly one has the scrollbar.

```<code>---
title: "Untitled"
output:
  flexdashboard::flex_dashboard:
    storyboard: true
---

```{r setup, include=FALSE}
library(flexdashboard)
```

### ggplot

```{r}

library(plotly)

carggplot <- ggplot(mtcars, aes(hp, mpg, fill = as.factor(carb))) +
    geom_point() +
    theme_bw()

ggplotly(carggplot)
```

### plotly

```{r}
carsplot <- plot_ly(
    data = mtcars,
    x = ~hp,
    y = ~mpg,
    color = ~as.factor(carb),
    type = "scatter",
    mode = "markers"
    )

carsplot
```
</code>```

I have been unable to find any documentation on this issue, although I found a similar problem posted by someone using the python interface to plotly.

I'm looking for a way to either turn off the scroll bar completely (while keeping the legend), or some explanation of the scroll bar's twitchy behavior.

flexdashboard is 0.5, plotly is 4.7.1, R is 64 bit 3.4.1, Windows 7.

答:
Old question but if others have the same issue, I wanted to get my solution out there...

I had the same issue and I solved it using this approach:

```<code>ggplotly(carggplot, height = 500)
</code>```

I had a mini scroll bar in my legend and adjusting the height as above while calling ggplotly(), allowed me to adjust to the correct height needed to make everything work.

Body:
I have a bizarre and very frustrating problem. When I build plotly graphs within storyboards (from the flexdashboard package), I get a very annoying and totally unnecessary scroll bar in my legend. When someone tries to click one of the dots on or off, the scroll bar twitches and its practically impossible to click the thing. This scroll bar only appears when the tab with the plotly graph is not immediately visible during the load of the page - i.e. if the page loads with some other tab selected.

I can make the same graph outside of the storyboard, with no problems either in RStudio, or saving it as an htmlwidget and loading it in Chrome. But when I load my storyboard, either in RStudio or in Chrome, I get this annoying scrollbar. The scrollbar exists whether it's a vertical or horizontal legend.

ggplotly objects do not have this problem.

Here's an example of the unnecessary scroll bar. The ggplotly graph is fine, and the plotly one has the scrollbar.

---
title: "Untitled"
output:
  flexdashboard::flex_dashboard:
    storyboard: true
---

```{r setup, include=FALSE}
library(flexdashboard)
```

### ggplot

```{r}

library(plotly)

carggplot <- ggplot(mtcars, aes(hp, mpg, fill = as.factor(carb))) +
    geom_point() +
    theme_bw()

ggplotly(carggplot)
```

### plotly

```{r}
carsplot <- plot_ly(
    data = mtcars,
    x = ~hp,
    y = ~mpg,
    color = ~as.factor(carb),
    type = "scatter",
    mode = "markers"
    )

carsplot
```

I have been unable to find any documentation on this issue, although I found a similar problem posted by someone using the python interface to plotly.

I'm looking for a way to either turn off the scroll bar completely (while keeping the legend), or some explanation of the scroll bar's twitchy behavior.

flexdashboard is 0.5, plotly is 4.7.1, R is 64 bit 3.4.1, Windows 7.

Body:
Old question but if others have the same issue, I wanted to get my solution out there...

I had the same issue and I solved it using this approach:

ggplotly(carggplot, height = 500)

I had a mini scroll bar in my legend and adjusting the height as above while calling ggplotly(), allowed me to adjust to the correct height needed to make everything work.


问:
Google Compute Engine: how to set hostname permanently?
How do I set the hostname of an instance in GCE permanently? I can set it via hostname,but after reboot it is gone again.

I tried to feed in metadata (hostname:f.q.d.n), but that did not do the job. But it should work via metadata (https://github.com/GoogleCloudPlatform/compute-image-packages/tree/master/google-startup-scripts).

Anybody an idea?

答:
Non-cron/metadata/script solution.

Edit /etc/dhclient-(network-interface).conf or create one if it doesn't exist.

Example:

```<code>sudo nano /etc/dhclient-eth0.conf
</code>```

Then add the following line, replacing the desired FQDN between the double quotes:

```<code>supersede host-name "hostname.domain-name";
</code>```

Persists between reboots and hostname and hostname -f works as intended.

Body:
Non-cron/metadata/script solution.

Edit /etc/dhclient-(network-interface).conf or create one if it doesn't exist.

Example:

sudo nano /etc/dhclient-eth0.conf

Then add the following line, replacing the desired FQDN between the double quotes:

supersede host-name "hostname.domain-name";

Persists between reboots and hostname and hostname -f works as intended.


问:
Implement Google 3D maps for my Android app?
is it possible to use the new Google 3D Maps for Android in my app? I'm developing an app and I want to add this.

thanx!

http://www.google.com/mobile/maps/3d/

答:
You can't. The Google Maps application no longer uses the same SDK MapView that we third-party developers use. Someday, perhaps they will update it, and then 3D maps will be possible, but not as of today.

Sorry!

UPDATE

Maps V2 allows 3D views, via camera tilt, if you are in a location that supports them: