问:
Maven Compiler Plugin 3.x:
I have a maven problem right now. I created a new test project to simplify the problem:

The error seams to be:

```<code>    Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.cli.CommandLineException
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    ... 59 more
</code>```

-v gives me:

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/ubuntu/workspaces/projectx/test/EMBEDDED
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-32-generic", arch: "amd64", family: "unix"

And the pom is:

```<code>    <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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
          </plugin>
        </plugins>
      </build>
</project>
</code>```

This gives me:

```<code>    [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ test ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.170s
[INFO] Finished at: Wed Nov 06 22:21:53 CET 2013
[INFO] Final Memory: 6M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
[ERROR] urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
[ERROR] urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
[ERROR] urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
[ERROR] urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
[ERROR] urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
[ERROR] urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
[ERROR] urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
[ERROR] urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.cli.CommandLineException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginContainerException
</code>```

using -X adds:

```<code>    Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/username/workspaces/projectX43/test/EMBEDDED
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-32-generic", arch: "amd64", family: "unix"
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from EMBEDDED/conf/settings.xml
[DEBUG] Reading user settings from /home/username/.m2/settings.xml
[DEBUG] Using local repository at /home/username/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/username/.m2/repository
[INFO] Scanning for projects...

[..... (Limit of 30000 would be exceeded so I left it out) .....]

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
[ERROR] urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
[ERROR] urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
[ERROR] urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
[ERROR] urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
[ERROR] urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
[ERROR] urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
[ERROR] urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
[ERROR] urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.cli.CommandLineException
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:127)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:125)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/cli/CommandLineException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
    at java.lang.Class.getDeclaredConstructors(Class.java:1855)
    at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
    at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
    at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
    at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
    at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.Scopes$1$1.get(Scopes.java:59)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
    at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
    at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
    at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
    at java.util.AbstractMap.get(AbstractMap.java:182)
    at org.codehaus.plexus.compiler.manager.DefaultCompilerManager.getCompiler(DefaultCompilerManager.java:54)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:384)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.cli.CommandLineException
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    ... 59 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/PluginContainerException
</code>```

Thanks for the help.

答: I got this because of the maven repository file has been locked! And I cant operated this file! But I don't know why? Then I removed the repository file, And --> Maven ReImport. It work! This may be help you! </p>

Title: Maven Compiler Plugin 3.x:

Body:
I have a maven problem right now. I created a new test project to simplify the problem:

The error seams to be:

    Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.cli.CommandLineException
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    ... 59 more

-v gives me:

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/ubuntu/workspaces/projectx/test/EMBEDDED
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-32-generic", arch: "amd64", family: "unix"

And the pom is:

    <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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
          </plugin>
        </plugins>
      </build>
</project>

This gives me:

    [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ test ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.170s
[INFO] Finished at: Wed Nov 06 22:21:53 CET 2013
[INFO] Final Memory: 6M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
[ERROR] urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
[ERROR] urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
[ERROR] urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
[ERROR] urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
[ERROR] urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
[ERROR] urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
[ERROR] urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
[ERROR] urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.cli.CommandLineException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginContainerException

using -X adds:

    Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/username/workspaces/projectX43/test/EMBEDDED
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-32-generic", arch: "amd64", family: "unix"
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from EMBEDDED/conf/settings.xml
[DEBUG] Reading user settings from /home/username/.m2/settings.xml
[DEBUG] Using local repository at /home/username/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/username/.m2/repository
[INFO] Scanning for projects...

[..... (Limit of 30000 would be exceeded so I left it out) .....]

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
[ERROR] urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
[ERROR] urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
[ERROR] urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
[ERROR] urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
[ERROR] urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
[ERROR] urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
[ERROR] urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
[ERROR] urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.util.cli.CommandLineException
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:127)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.0:compile: org/codehaus/plexus/util/cli/CommandLineException
-----------------------------------------------------
realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/username/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.0/maven-compiler-plugin-3.0.jar
urls[1] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
urls[2] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.jar
urls[3] = file:/home/username/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[4] = file:/home/username/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.0/maven-shared-incremental-1.0.jar
urls[5] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[6] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.0/plexus-compiler-api-2.0.jar
urls[7] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.0/plexus-compiler-manager-2.0.jar
urls[8] = file:/home/username/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.0/plexus-compiler-javac-2.0.jar
urls[9] = file:/home/username/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
urls[10] = file:/home/username/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
urls[11] = file:/home/username/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
urls[12] = file:/home/username/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
urls[13] = file:/home/username/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:125)
    ... 20 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/cli/CommandLineException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)
    at java.lang.Class.getDeclaredConstructors(Class.java:1855)
    at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
    at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
    at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
    at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
    at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.Scopes$1$1.get(Scopes.java:59)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
    at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
    at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
    at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
    at java.util.AbstractMap.get(AbstractMap.java:182)
    at org.codehaus.plexus.compiler.manager.DefaultCompilerManager.getCompiler(DefaultCompilerManager.java:54)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:384)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.cli.CommandLineException
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    ... 59 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/PluginContainerException

Thanks for the help.


来源: stackexchange

问:
Use .json file or database for static data?
I am building a web app using nodeJS with an angular based frontend and a Firebase/AngularFire2 backend.  I have a list of about 80 cities and couple of details about each of them that I need to display with checkboxes for the user.

Should I save them as a json object in a .json file on the server and call it, or just store it in my Real-time Database and query it?  Are there any speed/memory benefits to either?

答:
There are two scenarios :

1.Your task is search oriented. You have to query the data and manipulate it. Memory management is key issues for you. You want some complex searching methods on your data. Then go for the database.

2.Your task require whole data at a time. You don't need to worry about memory management. Then directly load the data from file. Obviously this method will save the connection making time with your database. It will work as simple as file streams. [suggested for your case]

ContentLicense: CC BY-SA 3.0


问:
Writing ints to a file and reading them, hasNext() return false
I have to write 100 random integers to a file, and display them in increasing order. PrintWriter writes them, but when I try to read from file, method hasNext() return false, and I can't understand why. I suppose the problem is with PrintWriter.

```<code>try(PrintWriter output = new PrintWriter(file);
                Scanner input = new Scanner(file)) {

            for (int i = 0; i < 100; i++) {
                output.print((int)(Math.random() * 101) + " ");
            }

            int[] numbers = new int[100];
            int i = 0;
            while (input.hasNextInt()) {
                numbers[i++] = input.nextInt();
            }

            Arrays.sort(numbers);
            for (int n : numbers)
                System.out.println(n);

        } catch (FileNotFoundException ex) {
            System.out.println("Cannot find the file!");
        }
</code>```

答:
You need to flush the output stream so changes are written to the file.

```<code>...
for (int i = 0; i < 100; i++) {
    output.print((int) (Math.random() * 101) + " ");
}

output.flush();
...
</code>```

Additionally, close flushes the stream automatically in this case - so if you tried to read the file after the try block, you would see the changes. For a PrintWriter, flush is also called whenever a newline is printed (via println or manually via printf/print).

I believe it is usually not a good idea to have a reader and writer open simultaneously.

Body:
I have to write 100 random integers to a file, and display them in increasing order. PrintWriter writes them, but when I try to read from file, method hasNext() return false, and I can't understand why. I suppose the problem is with PrintWriter.

try(PrintWriter output = new PrintWriter(file);
                Scanner input = new Scanner(file)) {

            for (int i = 0; i < 100; i++) {
                output.print((int)(Math.random() * 101) + " ");
            }

            int[] numbers = new int[100];
            int i = 0;
            while (input.hasNextInt()) {
                numbers[i++] = input.nextInt();
            }

            Arrays.sort(numbers);
            for (int n : numbers)
                System.out.println(n);

        } catch (FileNotFoundException ex) {
            System.out.println("Cannot find the file!");
        }

Body:
You need to flush the output stream so changes are written to the file.

...
for (int i = 0; i < 100; i++) {
    output.print((int) (Math.random() * 101) + " ");
}

output.flush();
...

Additionally, close flushes the stream automatically in this case - so if you tried to read the file after the try block, you would see the changes. For a PrintWriter, flush is also called whenever a newline is printed (via println or manually via printf/print).

I believe it is usually not a good idea to have a reader and writer open simultaneously.


问:
How to run interactive jmol or jsmol object in ipython notebook
I want to make a presentation for a seminar and I would like to show a protein structure interactively (3D rotation, maybe even changing the model it is shown in, like cartoon, wireframe, ball & stick, ...)

I want this to be inline, not in separate window or file.

I can think about two possible solutions.

One would be to just call a software that outputs inline to the notebook, so let's say I run Jmol with my input file through bash and then manipulate the whole thing from the notebook (Note that I'm using ipython notebook, but I'm willing to install jupyter or any other stuff if that's needed for the solution). This would be awsome especially if I could use it with any other software, but I don't think it easy and it might not even be possible.

The other way would be to link to an already running jmol or jsmol object in the same browser, different tab, and show the same thing in notebook inline and rotate it from there as I present.
I'm thinking that this is more likely to be possible, since both are running in the same browser and both know html and javascript so there is a common language. (I don't know too much about HTML, javascript or php, but I think it is possible to do it)

If you open this link:

http://www.rcsb.org/pdb/explore/jmol.do?structureId=1A0K&bionumber=1

You will see the rotatable object. If I run Firebug to examine this object it gives me:

canvas id="jmolApplet0_canvas2d" style="width: 100%; height: 100%; z-index: 9002; cursor: default;" width="600" height="600"

but this is not much of use for me, because I don't understand it. It looks like XML code and like input to a function or a class, but I have no idea how I could run this inside my notebook presentation.

I was also trying to save the object and then parse it using python, but that only gives me the points of the 3D object, and will not colour it or give surface to the objects, or at least I don't know how to that. (I'm talking about VRML)

For running inline things in ipython notebook, I've found:

%matplotlib nbagg

to be working, but nothing else.

Any help is appreciated.

I'm using python3, ipython3 notebook, ubuntu 16.04, firefox but I can install anything that would solve my problem, even use windows in virtualbox if I have to.

答:
I've searched a lot and I found a working example on Oliver Stueker's github site: https://github.com/ostueker/simple_jmol_demo

The only problem I had with it that I've needed .pdb files, not cml,  because cml doesn't contain the secondary structure information. I've searched some more, and found another almost working example posted by jhjensen2: https://gist.github.com/jhjensen2/4701339

So I came up with this:

```<code>%%html
<!doctype html>
<html>
    <title>A simple Jsmol example</title>
<head>
    <script type="text/javascript" src="jsmol/JSmol.min.js"></script>

    <script type="text/javascript">
    var Info = {
      width: 500,
      height: 500,
      j2sPath: "jsmol/j2s",
    }
    </script>
</head>
<body>
    <script type="text/javascript">
      jmolApplet0 = Jmol.getApplet("jmolApplet0", Info);
      Jmol.script(jmolApplet0,"background black; load 1a0k.pdb; wireframe only; spin on")
    </script>
    <br clear="all" / >
        <b>Model:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'wireframe only; ');" checked="checked">Wireframe</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'cartoon only; ');">Cartoon</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'backbone only; ');">Backbone</input>
        <b>        Spin:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'spin off; ');" checked="checked">Off</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'spin on; ');">On</input></br>
    <br clear="all" / >
        <b>Color:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color cpk; ');" checked="checked">Atom</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color structure; ');">Secondary</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color chain; ');">Chain</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color amino; ');">Residue</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color group; ');">Group</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color monomer; ');">Monomer</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color relativeTemperature; ');">Relative temp.</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color fixedTemperature; ');">Fixed temp.</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color black; ');">Black</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color white; ');">White</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color grey; ');">Grey</input>
        </br>
    <br clear="all" / >
        <b>Background:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background black; ');" checked="checked">Black</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background white; ');">White</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background red; ');">Red</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background green; ');">Green</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background blue; ');">Blue</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background yellow; ');">Yellow</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background cyan; ');">Cyan</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background magenta; ');">Magenta</input></br>
</body>
</code>```

You can use this as ipython notebook magic.

Edit:
Well at the moment only if the file you are loading is not a .pdb file, but it will load a .cml file, which you can make with Avogadro. The code will load .pdb files in a browser only, not in ipython notebook. There might not be a way to combine the two. If I use the load inline in Jmol.getApplet it doesn't work for me, but it does work in Jmol.getApplethtml but only with .cml files and does not work with .pdb files. :(

Body:
I've searched a lot and I found a working example on Oliver Stueker's github site: https://github.com/ostueker/simple_jmol_demo

The only problem I had with it that I've needed .pdb files, not cml,  because cml doesn't contain the secondary structure information. I've searched some more, and found another almost working example posted by jhjensen2: https://gist.github.com/jhjensen2/4701339

So I came up with this:

%%html
<!doctype html>
<html>
    <title>A simple Jsmol example</title>
<head>
    <script type="text/javascript" src="jsmol/JSmol.min.js"></script>

    <script type="text/javascript">
    var Info = {
      width: 500,
      height: 500,
      j2sPath: "jsmol/j2s",
    }
    </script>
</head>
<body>
    <script type="text/javascript">
      jmolApplet0 = Jmol.getApplet("jmolApplet0", Info);
      Jmol.script(jmolApplet0,"background black; load 1a0k.pdb; wireframe only; spin on")
    </script>
    <br clear="all" / >
        <b>Model:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'wireframe only; ');" checked="checked">Wireframe</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'cartoon only; ');">Cartoon</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'backbone only; ');">Backbone</input>
        <b>&nbsp; &nbsp; &nbsp; &nbsp; Spin:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'spin off; ');" checked="checked">Off</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'spin on; ');">On</input></br>
    <br clear="all" / >
        <b>Color:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color cpk; ');" checked="checked">Atom</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color structure; ');">Secondary</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color chain; ');">Chain</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color amino; ');">Residue</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color group; ');">Group</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color monomer; ');">Monomer</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color relativeTemperature; ');">Relative temp.</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color fixedTemperature; ');">Fixed temp.</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color black; ');">Black</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color white; ');">White</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'color grey; ');">Grey</input>
        </br>
    <br clear="all" / >
        <b>Background:</b>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background black; ');" checked="checked">Black</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background white; ');">White</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background red; ');">Red</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background green; ');">Green</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background blue; ');">Blue</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background yellow; ');">Yellow</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background cyan; ');">Cyan</input>
        <input name="vis" type="radio" onclick="javascript:Jmol.script(jmolApplet0,
       'background magenta; ');">Magenta</input></br>
</body>

You can use this as ipython notebook magic.

Edit:
Well at the moment only if the file you are loading is not a .pdb file, but it will load a .cml file, which you can make with Avogadro. The code will load .pdb files in a browser only, not in ipython notebook. There might not be a way to combine the two. If I use the load inline in Jmol.getApplet it doesn't work for me, but it does work in Jmol.getApplethtml but only with .cml files and does not work with .pdb files. :(


问:
POST using webclient and WebRequest does not work
I want to write a code in c# to upload values on html page that has text boxes and then click button below.

If I view page source there are two attributes of textbox that are name and ID. Which one should be used while uploading values?

I tried using webclient and http response as well but nothing works.

I started with a demo ASP.Net application given with vs 2010.I cannot login to that page using this code

Html is

```<code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>
    Log In
</title><link href="../Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form method="post" action="Login.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="ctl01">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTM4OTQwMDM1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUmY3RsMDAkTWFpbkNvbnRlbnQkTG9naW5Vc2VyJFJlbWVtYmVyTWXIWDJ/V4XPecqwQe85aLVZC5vuxVoEv8dHC/Mo9pwQZw==" />

</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['ctl01'];
if (!theForm) {
    theForm = document.ctl01;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>

</script>
<script src="/WebSite1/WebResource.axd?d=M5W_658FhJm5n8t9pSFvKuIXRL5Jz7-D_eS0HTIT8JulfjzpAVV_rJb8XF2y3yXBzfewu3sSKDiVdWxirFJDeFUBJp7DwWkz9bRlwYT_VkQ1&t=634271460710781250" type="text/javascript"></script>
<script src="/WebSite1/WebResource.axd?d=d41DICiQepBPG6K5sYiG4w6-5Zow9401xGbcRJ_YjjKKZBzgTrTC_CdIv9aUM1wPVO22HhAV6begkxuIulwZFj_WKMwGJvOFNsnT-yQ7hO41&t=634271460710781250" type="text/javascript"></script>
<script src="/WebSite1/WebResource.axd?d=XnFE4lWLk9gTnM0_06V_76Tt3DRk8edc94bUtBQAZMiY1p3YHp03awb6v8Nz44Zo-gdy2g6LBBsaWMuUeNLboK5ebvvrsIwawVtCZfaujlw1&t=634271460710781250" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[

function WebForm_OnSubmit() {

if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<div class="aspNetHidden">
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQKA+oZWAsXK+OQPAtDNs5YCApW7jtAPAqfAqeMFgx5T3T+5v78wSO8pWO0ORp/qKya1HTwMXoYN8GOYDSo=" />
</div>
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    My ASP.NET Application
                </h1>
            </div>
            <div class="loginDisplay">
                        [ <a href="Login.aspx" id="HeadLoginView_HeadLoginStatus">Log In</a> ]
            </div>

            <div class="clear hideSkiplink">

                <a href="#NavigationMenu_SkipLink"><img alt="Skip Navigation Links" src="/WebSite1/WebResource.axd?d=kJ6t3tHV3cLpBZWByP4-yIKJkygtz3ErE4Tpn7tMIEa4uB2lty0z6Toys6myTCJiM7h32lxUN9nyuc9K6T9RIvRlxGRQvIJjoE2vXGjX6Bw1&t=634271460710781250" width="0" height="0" style="border-width:0px;" /></a><div class="menu" id="NavigationMenu">

    <ul class="level1">

        <li><a class="level1" href="../Default.aspx">Home</a></li><li><a class="level1" href="../About.aspx">About</a></li>

    </ul>

</div><a id="NavigationMenu_SkipLink"></a>
            </div>
        </div>
        <div class="main">
    <h2>   Log In </h2>
        <p>
        Please enter your username and password.
        <a id="MainContent_RegisterHyperLink" href="Register.aspx?ReturnUrl=">Register</a> if you don't have an account.
    </p>
            <span class="failureNotification">
            </span>
            <div id="MainContent_LoginUser_LoginUserValidationSummary" class="failureNotification" style="display:none;">
</div>

            <div class="accountInfo">

                <fieldset class="login">

                    <legend>Account Information</legend>

                    <p>

                        <label for="MainContent_LoginUser_UserName" id="MainContent_LoginUser_UserNameLabel">Username:</label>

                        <input name="ctl00$MainContent$LoginUser$UserName" type="text" id="MainContent_LoginUser_UserName" class="textEntry" />

                        <span id="MainContent_LoginUser_UserNameRequired" title="User Name is required." class="failureNotification" style="visibility:hidden;">*</span>

                    </p>

                    <p>

                        <label for="MainContent_LoginUser_Password" id="MainContent_LoginUser_PasswordLabel">Password:</label>

                        <input name="ctl00$MainContent$LoginUser$Password" type="password" id="MainContent_LoginUser_Password" class="passwordEntry" />

                        <span id="MainContent_LoginUser_PasswordRequired" title="Password is required." class="failureNotification" style="visibility:hidden;">*</span>

                    </p>

                    <p>

                        <input id="MainContent_LoginUser_RememberMe" type="checkbox" name="ctl00$MainContent$LoginUser$RememberMe" />

                        <label for="MainContent_LoginUser_RememberMe" id="MainContent_LoginUser_RememberMeLabel" class="inline">Keep me logged in</label>

                    </p>

                </fieldset>

                <p class="submitButton">

                    <input type="submit" name="ctl00$MainContent$LoginUser$LoginButton" value="Log In" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContent$LoginUser$LoginButton", "", true, "LoginUserValidationGroup", "", false, false))" id="MainContent_LoginUser_LoginButton" />

                </p>

            </div>

        </div>

        <div class="clear">

        </div>

    </div>

    <div class="footer">

    </div>

<script type="text/javascript">

//<![CDATA[

var Page_ValidationSummaries =  new Array(document.getElementById("MainContent_LoginUser_LoginUserValidationSummary"));

var Page_Validators =  new Array(document.getElementById("MainContent_LoginUser_UserNameRequired"), document.getElementById("MainContent_LoginUser_PasswordRequired"));

//]]>

</script>

<script type="text/javascript">

//<![CDATA[

var MainContent_LoginUser_LoginUserValidationSummary = document.all ? document.all["MainContent_LoginUser_LoginUserValidationSummary"] : document.getElementById("MainContent_LoginUser_LoginUserValidationSummary");

MainContent_LoginUser_LoginUserValidationSummary.validationGroup = "LoginUserValidationGroup";

var MainContent_LoginUser_UserNameRequired = document.all ? document.all["MainContent_LoginUser_UserNameRequired"] : document.getElementById("MainContent_LoginUser_UserNameRequired");

MainContent_LoginUser_UserNameRequired.controltovalidate = "MainContent_LoginUser_UserName";

MainContent_LoginUser_UserNameRequired.errormessage = "User Name is required.";

MainContent_LoginUser_UserNameRequired.validationGroup = "LoginUserValidationGroup";

MainContent_LoginUser_UserNameRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";

MainContent_LoginUser_UserNameRequired.initialvalue = "";

var MainContent_LoginUser_PasswordRequired = document.all ? document.all["MainContent_LoginUser_PasswordRequired"] : document.getElementById("MainContent_LoginUser_PasswordRequired");

MainContent_LoginUser_PasswordRequired.controltovalidate = "MainContent_LoginUser_Password";
MainContent_LoginUser_PasswordRequired.errormessage = "Password is required.";
MainContent_LoginUser_PasswordRequired.validationGroup = "LoginUserValidationGroup";
MainContent_LoginUser_PasswordRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
MainContent_LoginUser_PasswordRequired.initialvalue = "";
//]]>
</script>
<script type='text/javascript'>new Sys.WebForms.Menu({ element: 'NavigationMenu', disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: false });</script>

<script type="text/javascript">
//<![CDATA[
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {

    ValidatorOnLoad();

}
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        //]]>
</script>
</form>
</body>
</code>```

```<code> var strId = UserName.Text;
        var strName = UserPass.Text;
        var encoding = new ASCIIEncoding();
        var postData = "ctl00$MainContent$LoginUser$UserName=" + strId;
        postData += ("ctl00$MainContent$LoginUser$Password=" + strName);
        byte[] data = encoding.GetBytes(postData);
        var myRequest =              (HttpWebRequest)WebRequest.Create("http://localhost:6226/WebSite1/Account/Login.aspx");
        myRequest.Method = "POST";
        myRequest.ContentType = "application/x-www-form-urlencoded";
        myRequest.ContentLength = data.Length;
        var newStream = myRequest.GetRequestStream();
        newStream.Write(data, 0, data.Length);
        newStream.Close();
        var response = myRequest.GetResponse();
        var responseStream = response.GetResponseStream();
        var responseReader = new StreamReader(responseStream);
        textBox1.Text = responseReader.ReadToEnd();
</code>```

答: I do not see a '&' between the post data elements.</p>

Body:
I want to write a code in c# to upload values on html page that has text boxes and then click button below.

If I view page source there are two attributes of textbox that are name and ID. Which one should be used while uploading values?

I tried using webclient and http response as well but nothing works.

I started with a demo ASP.Net application given with vs 2010.I cannot login to that page using this code

Html is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>
    Log In
</title><link href="../Styles/Site.css" rel="stylesheet" type="text/css" />

    <form method="post" action="Login.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="ctl01">

<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMTM4OTQwMDM1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUmY3RsMDAkTWFpbkNvbnRlbnQkTG9naW5Vc2VyJFJlbWVtYmVyTWXIWDJ/V4XPecqwQe85aLVZC5vuxVoEv8dHC/Mo9pwQZw==" />

    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQKA+oZWAsXK+OQPAtDNs5YCApW7jtAPAqfAqeMFgx5T3T+5v78wSO8pWO0ORp/qKya1HTwMXoYN8GOYDSo=" />

                    My ASP.NET Application

                        [ Log In ]

Home

About

   Log In

        Please enter your username and password.
        Register if you don't have an account.

                <fieldset class="login">

                    <legend>Account Information</legend>

                        Username:

                        <input name="ctl00$MainContent$LoginUser$UserName" type="text" id="MainContent_LoginUser_UserName" class="textEntry" />

                        *

                        Password:

                        <input name="ctl00$MainContent$LoginUser$Password" type="password" id="MainContent_LoginUser_Password" class="passwordEntry" />

                        *

                        <input id="MainContent_LoginUser_RememberMe" type="checkbox" name="ctl00$MainContent$LoginUser$RememberMe" />

                        Keep me logged in

                </fieldset>

                    <input type="submit" name="ctl00$MainContent$LoginUser$LoginButton" value="Log In" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContent$LoginUser$LoginButton", "", true, "LoginUserValidationGroup", "", false, false))" id="MainContent_LoginUser_LoginButton" />

</form>

 var strId = UserName.Text;
        var strName = UserPass.Text;
        var encoding = new ASCIIEncoding();
        var postData = "ctl00$MainContent$LoginUser$UserName=" + strId;
        postData += ("ctl00$MainContent$LoginUser$Password=" + strName);
        byte[] data = encoding.GetBytes(postData);
        var myRequest =              (HttpWebRequest)WebRequest.Create("http://localhost:6226/WebSite1/Account/Login.aspx");
        myRequest.Method = "POST";
        myRequest.ContentType = "application/x-www-form-urlencoded";
        myRequest.ContentLength = data.Length;
        var newStream = myRequest.GetRequestStream();
        newStream.Write(data, 0, data.Length);
        newStream.Close();
        var response = myRequest.GetResponse();
        var responseStream = response.GetResponseStream();
        var responseReader = new StreamReader(responseStream);
        textBox1.Text = responseReader.ReadToEnd();

ContentLicense: CC BY-SA 2.5


问:
How I can get real time output of a process from the terminal while the process is running in c++?
I am working on something where I need to execute a bash command which will initiate a process and this process really takes a long time to execute. The running process continuously print something on the terminal.  Without completion of the process I cannot get that output. I am doing this in cpp. Is there anyway to get the output from the process in real time without the completion of that process? </p>

答:
Look at tee to write the output to a file or use a pipe | to send the output to another process.

```<code>$ myprog | tee outputfile.txt
</code>```

or

```<code>$ myprog | otherpeog
</code>```

The pipe | sends the output from the myprog to another program.

Body:
Look at tee to write the output to a file or use a pipe | to send the output to another process.

$ myprog | tee outputfile.txt

or

$ myprog | otherpeog

The pipe | sends the output from the myprog to another program.


问:
Spatie Activity Log only returns the last log. I want all logs returned.
So, I went to read all the Spatie Activity Log documentation and in there examples it only returns the most recent log (One last log). But I need to see all the Activity Log created. </p>

```<code>     public function index()
    {
    $user = Auth::user();
    Activity()->log('Look mum, I logged something') ->causedBy($user);
    $lastActivity = Activity::all()->last();
    $lastActivity =$lastActivity->causer;
    $lastActivity->description;
    return View('hello', compact('lastActivity'));
    }
</code>```

<p>I think it has to do with hte Activity::all()->last(); I tried deleting the last but it won't work. Thank you very much for your help. </p>

答:
Activity is an Eloquent model, to get all the activities you can call Activity::all();, it will returns a collection.

```<code>public function index()
{
    $user = Auth::user();
    activity()->log('Look mum, I logged something')->causedBy($user);

    $allActivities = Activity::all();
    return view('hello', compact('allActivities'));
}
</code>```

Then in your hello view, you can loop through the collection

```<code>@foreach($allActivities as $activity)
{{ $activity->description }}
@endforeach
</code>```

Body:
So, I went to read all the Spatie Activity Log documentation and in there examples it only returns the most recent log (One last log). But I need to see all the Activity Log created.

     public function index()
    {
    $user = Auth::user();
    Activity()->log('Look mum, I logged something') ->causedBy($user);
    $lastActivity = Activity::all()->last();
    $lastActivity =$lastActivity->causer;
    $lastActivity->description;
    return View('hello', compact('lastActivity'));
    }

I think it has to do with hte Activity::all()->last(); I tried deleting the last but it won't work. Thank you very much for your help.

Body:
Activity is an Eloquent model, to get all the activities you can call Activity::all();, it will returns a collection.

public function index()
{
    $user = Auth::user();
    activity()->log('Look mum, I logged something')->causedBy($user);

    $allActivities = Activity::all();
    return view('hello', compact('allActivities'));
}

Then in your hello view, you can loop through the collection

@foreach($allActivities as $activity)
{{ $activity->description }}
@endforeach


问:
Loading basic HTML in Node.js
I'm trying to find out how to load and render a basic HTML file so I don't have to write code like:</p>

```<code>response.write('...<p>blahblahblah</p>...');
</code>```

答:
```<code>   var http = require('http');
   var fs = require('fs');

  http.createServer(function(request, response) {
    response.writeHeader(200, {"Content-Type": "text/html"});
    var readSream = fs.createReadStream('index.html','utf8')
    readSream.pipe(response);
  }).listen(3000);

 console.log("server is running on port number ");
</code>```

ContentLicense: CC BY-SA 4.0

Title: Loading basic HTML in Node.js

Body:
I'm trying to find out how to load and render a basic HTML file so I don't have to write code like:

response.write('...
blahblahblah
...');


问:
How to optimize this regex
Can someone help me to optimize my regex pattern, so I don't have to go through each regexes below. So it matches all of the string like the example I provided.

```<code>$pattern = "/__\(\"(.*)\"/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\"(.*)\",/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\'(.*)\'/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\'(.*)\',/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\"(.*)\"/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\"(.*)\",/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\'(.*)\'/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\'(.*)\',/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);
</code>```

Example:

```<code>_e('string');
_e("string");
_e('string', 'string2');
_e("string", 'string2');
__('string');
__("string");
__('string', 'string2');
__("string", 'string2');
</code>```

Also if it possible, to match also these string below.

```<code>"string"|trans
'string'|trans
"string"|trans({}, "string2")
'string'|trans({}, 'string2')
'string'|trans({}, "string2")
"string"|trans({}, 'string2')
</code>```

If it is possible to get the value string2 too. In the worst case, in the file, there are also mixed single and double quote.

Like you see on my preg_match_all code now, I go with 8 patterns for the first and also 8 patterns for the second one to get the first string.

Note:
I just only run this script on console command, not in PHP application. So I don't pay any attention to the performance and it doesn't matter too.

Thank you for your help!

Edited

Thank you for the response. I tried both your regex, almost there. My question might confusing. I am not english speaker. I copy paste from regex101. It might be easier to understand, what I am trying to achieve.

https://regex101.com/r/uX5nqR/2

and this one too

https://regex101.com/r/Fxs7yY/1

Please check this out. I tried to extract translations from wordpress project and also twig file which using "trans" filter. I know there are mo po Editor, but the editor don't recognize the file extension I used.

答:
I tried to understand the purpose of these regexes - here's what I think. (Let me omit the slashes on both sides, also the string quotes belonging to the language instead of the regex itself.)

```<code>(__|_e)\(\"(.*)\"
(__|_e)\(\'(.*)\'
</code>```

This way you get all the hits of your 8 regexes above; but that's probably not what you were trying to achieve.

As far as I understand, you want to list the I18N refs in your code, with one or more arguments between the brackets.  I think the best way to do it is run a preg_match_all with the simplest form of the pattern:

```<code>(__|_e)\(.*\)
</code>```

or maybe this one is better:

```<code>(__|_e)\([^\)]+\)     // works for multiple calls in one line, ignores empties
</code>```

...and then iterate the results one by one and split them by comma:

```<code>foreach($matches as $m) {
    $args = explode(",",$m[1]);  // [1] = second subpattern
    ;
    ; // now you have the arguments of this function call
    ;
}
</code>```

If this answer is not helping, let's refine the question :)

Title: How to optimize this regex

Body:
Can someone help me to optimize my regex pattern, so I don't have to go through each regexes below. So it matches all of the string like the example I provided.

$pattern = "/__\(\"(.*)\"/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\"(.*)\",/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\'(.*)\'/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/__\(\'(.*)\',/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\"(.*)\"/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\"(.*)\",/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\'(.*)\'/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

$pattern = "/_e\(\'(.*)\',/";
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);

Example:

_e('string');
_e("string");
_e('string', 'string2');
_e("string", 'string2');
__('string');
__("string");
__('string', 'string2');
__("string", 'string2');

Also if it possible, to match also these string below.

"string"|trans
'string'|trans
"string"|trans({}, "string2")
'string'|trans({}, 'string2')
'string'|trans({}, "string2")
"string"|trans({}, 'string2')

If it is possible to get the value string2 too. In the worst case, in the file, there are also mixed single and double quote.

Like you see on my preg_match_all code now, I go with 8 patterns for the first and also 8 patterns for the second one to get the first string.

Note:
I just only run this script on console command, not in PHP application. So I don't pay any attention to the performance and it doesn't matter too.

Thank you for your help!

Edited

Thank you for the response. I tried both your regex, almost there. My question might confusing. I am not english speaker. I copy paste from regex101. It might be easier to understand, what I am trying to achieve.

https://regex101.com/r/uX5nqR/2

and this one too

https://regex101.com/r/Fxs7yY/1

Please check this out. I tried to extract translations from wordpress project and also twig file which using "trans" filter. I know there are mo po Editor, but the editor don't recognize the file extension I used.

Body:
I tried to understand the purpose of these regexes - here's what I think. (Let me omit the slashes on both sides, also the string quotes belonging to the language instead of the regex itself.)

(__|_e)\(\"(.*)\"
(__|_e)\(\'(.*)\'

This way you get all the hits of your 8 regexes above; but that's probably not what you were trying to achieve.

As far as I understand, you want to list the I18N refs in your code, with one or more arguments between the brackets.  I think the best way to do it is run a preg_match_all with the simplest form of the pattern:

(__|_e)\(.*\)

or maybe this one is better:

(__|_e)\([^\)]+\)     // works for multiple calls in one line, ignores empties

...and then iterate the results one by one and split them by comma:

foreach($matches as $m) {
    $args = explode(",",$m[1]);  // [1] = second subpattern
    ;
    ; // now you have the arguments of this function call
    ;
}

If this answer is not helping, let's refine the question :)


问:
Unable to search for '\\n' using regular expressions in python3
```<code>>>> import re
>>> a='''\\n5
... 8'''
>>> b=re.findall('\\n[0-9]',a)
>>> print(b)
['\n8']
</code>```

Why does it show \n8 and not \n5?
I used a \ in front of \n the first time.
I am finding the use of raw string in regex in python a bit confusing. To me it does not seem to be making any changes to the result

答:
<code>\\n</code> is not a newline, it's an escaped backslash with an n. </p>

```<code>>>> import re
>>> a = '''\n5
... 8'''
>>> a=re.findall('\\n[0-9]',a)
>>> print(a)
['\n5', '\n8']
</code>```

Body:
>>> import re
>>> a='''\\n5
... 8'''
>>> b=re.findall('\\n[0-9]',a)
>>> print(b)
['\n8']

Why does it show \n8 and not \n5?
I used a \ in front of \n the first time.
I am finding the use of raw string in regex in python a bit confusing. To me it does not seem to be making any changes to the result

Body:
\\n is not a newline, it's an escaped backslash with an n.

>>> import re
>>> a = '''\n5
... 8'''
>>> a=re.findall('\\n[0-9]',a)
>>> print(a)
['\n5', '\n8']


问:
'ng' is not recognized as an internal or external command
After removing the previous version of Node.js , now i have installed the latest version of it. I have also installed @angular/cli .

But when i am trying to create new Project through CLI , i am getting error

'ng' is not recognized as an internal or external command.

I have uninstalled Node.js several time using command and manually all folder but still it coming after fresh installation.

I have tried to install @angular/cli but getting below error.

Any help will be much appreciated.
Thanks in Advance.

答: Simple way to solve this by using  NodeJS command prompt rather Windows Command, NodeJs command prompt will recognize ng.


问:
Pivot a dataframe in python
I have the below csv file

And after reading it with python in a DataFrame,I want to reshape it as

country,year1,value

country,year2,value

Taking into account only the country the year and the value.. So I will end up with 3 variables.

You can find the data set here:

http://data.worldbank.org/indicator/NY.GDP.MKTP.KD.ZG

答:
You can try this:</p>

```<code>df = pd.read_csv('Your file path.csv', dtype = object) # read file
df.drop(['Country Name','Indicator Name'], axis = 1, inplace = True) # delete unwanted columns
dfT = pd.melt(df, id_vars=['Country Code','Indicator Code']) # transpose
dfF = dfT.dropna(subset=['value']) # delete Nan
</code>```

Title: Pivot a dataframe in python

Body:
You can try this:

df = pd.read_csv('Your file path.csv', dtype = object) # read file
df.drop(['Country Name','Indicator Name'], axis = 1, inplace = True) # delete unwanted columns
dfT = pd.melt(df, id_vars=['Country Code','Indicator Code']) # transpose
dfF = dfT.dropna(subset=['value']) # delete Nan


问:
VSTO Outlook 2007 unique message ID
I am creating an Outlook 2007 add-in using VSTO.  I need to store information (entered by the user) about each email.  My first thought is to create a small "database" that references each email as necessary.  But I can't seem to find an accessible identifier for each email for this purpose.  Is there an ID or some other unique field that is available for each mail message item that I can use?

C# or VB.NET code is fine.  Hopefully this can be some easy points for you!

Thanks in Advance!

答: The mail item has a number of properties, including EntryID Property. You can also add custom properties.</p>

Title: VSTO Outlook 2007 unique message ID


问:
Batch - Replace Nth Character of variable
I've been stuck trying to replace nth character from a variable. Here is an example.

```<code>String: This Will Be A 230 Bytes String

Input : 1st char, change to char 5
       (the variable and character to change is hardcoded, so you can ignore it)

Output: 5his Will Be A 230 Bytes String
</code>```

I couldn't figure out how to do this. Here is what I have tried.

```<code>set remaining=237-%aircraft1Loc%
set aircraft1LocB=%aircraft1Loc%-1
call set LowTrack=%OrgLowTrack:~0,%
call set LowTrack=%%OrgLowTrack:~0,%aircraft1LocB%%%5 %%OrgLowTrack,%aircraft1Loc%,%remaining%%
</code>```

This is the %OrgLowTrack%

```<code>                             {0C}+{#}                                                `.:////////::--.`     ``.....``````                      ``.``  ``         ````                                             ```     ``..```
```

<ul>
<li>LowTrack should now contain the replaced string.</li>
<li>Aircraft1Loc defaults to 231 and reduces 1 everytime the above script runs(the <code>set /a var-=1</code> is not shown here-)</li>
<li>remaining is 237 - aircraft1Loc</li>
<li>aircraft1LocB is aircraft1Loc - 1</li>
</ul>

<p>The result should be something like</p>

```Original: XXXXXXXX(String shortened)
Output  : XXXXXXX5
2nd out : XXXXX5XX - This occurs when the snippet is run again
```

<p>But my snippet outputs:</p>

```Original: XXXXXXXX
Output  : XXXXXXXX5 OrgLowTrack,,237 -
2nd out : XXXXXXXX5 OrgLowTrack,,237
```

答:
Rewrote the batch completely (needed a sub for strLen):</p>

```<code>:: Q:\Test\2017\07\09\SO_44995458.cmd
@Echo off&SetLocal EnableExtensions EnableDelayedExpansion
Set "string=This Will Be A 230 Bytes String"

Call :strLen string len

For /L %%i in (%len%,-1,0) Do (
  Echo !string:~0,%%i!_!string:~%%i!
)

Goto :Eof
:strLen string len
:: returns the length of a string
:: string [in]  - variable name containing the string being measured for length
:: len    [out] - variable to be used to return the string length
:$source http://www.dostips.com/DtTipsStringOperations.php#Function.strLen
SETLOCAL ENABLEDELAYEDEXPANSION
set "str=A!%~1!"
set "len=0"
for /L %%A in (12,-1,0) do (set /a "len|=1<<%%A"
  for %%B in (!len!) do if "!str:~%%B,1!"=="" set /a "len&=~1<<%%A"
)
ENDLOCAL & IF "%~2" NEQ "" SET /a %~2=%len%
EXIT /b
</code>```

Body:
I've been stuck trying to replace nth character from a variable. Here is an example.

String: This Will Be A 230 Bytes String

Input : 1st char, change to char 5
       (the variable and character to change is hardcoded, so you can ignore it)

Output: 5his Will Be A 230 Bytes String

I couldn't figure out how to do this. Here is what I have tried.

set remaining=237-%aircraft1Loc%
set aircraft1LocB=%aircraft1Loc%-1
call set LowTrack=%OrgLowTrack:~0,%
call set LowTrack=%%OrgLowTrack:~0,%aircraft1LocB%%%5 %%OrgLowTrack,%aircraft1Loc%,%remaining%%

This is the %OrgLowTrack%

                             {0C}+{#}                                                `.:////////::--.`     ``.....``````                      ``.``  ``         ````                                             ```     ``..```

LowTrack should now contain the replaced string.

Aircraft1Loc defaults to 231 and reduces 1 everytime the above script runs(the set /a var-=1 is not shown here-)

remaining is 237 - aircraft1Loc

aircraft1LocB is aircraft1Loc - 1

The result should be something like

Original: XXXXXXXX(String shortened)
Output  : XXXXXXX5
2nd out : XXXXX5XX - This occurs when the snippet is run again

But my snippet outputs:

Original: XXXXXXXX
Output  : XXXXXXXX5 OrgLowTrack,,237 -
2nd out : XXXXXXXX5 OrgLowTrack,,237

Body:
Rewrote the batch completely (needed a sub for strLen):

:: Q:\Test\2017\07\09\SO_44995458.cmd
@Echo off&SetLocal EnableExtensions EnableDelayedExpansion
Set "string=This Will Be A 230 Bytes String"

Call :strLen string len

For /L %%i in (%len%,-1,0) Do (
  Echo !string:~0,%%i!_!string:~%%i!
)

Goto :Eof
:strLen string len
:: returns the length of a string
:: string [in]  - variable name containing the string being measured for length
:: len    [out] - variable to be used to return the string length
:$source http://www.dostips.com/DtTipsStringOperations.php#Function.strLen
SETLOCAL ENABLEDELAYEDEXPANSION
set "str=A!%~1!"
set "len=0"
for /L %%A in (12,-1,0) do (set /a "len|=1<<%%A"
  for %%B in (!len!) do if "!str:~%%B,1!"=="" set /a "len&=~1<<%%A"
)
ENDLOCAL & IF "%~2" NEQ "" SET /a %~2=%len%
EXIT /b


答:
This is because in strings, the newline character is considered that, a single character.

When you do \\n5 you're escaping the \, so that's literally printing \n5, and not a newline by Python standards.

When you search for a regex such as \\n[0-9] though, in the first \ you're escaping the \n regex expression, so in the end you're looking for \n which is Python's newline. That matches the actual newline in your string, but not \\n which is two separate characters, an escaped \ and an n.

Title: Unable to search for '\\n' using regular expressions in python3


问:
jQtree positioning issue in electron app
I am trying to use jqtree in an Electron application.  I have been able to get it to do everything I need it to do.  However, I am running into a problem with positioning it on the window.

My index.html file looks like this:

```<code><body>
    <div id="container">
        <div id="authors">
            <ul id="authlist"></ul>
        </div>
        <div id="stree"></div>
        <div id="clear"></div>
    </div>
    <div id="main-area"></div>
</body>
</code>```

And the relevant CSS is:

```<code>#container {
    display: inline-block;
    width: 610px;
    margin: auto;
    border: 10px solid orange''
}
#authors {
    float: left;
    width: 200px;
    border-style: solid;
}
#stree {
    width: 400px;
    margin-left: 210px;
    border-style: solid;
}
#clear {
    clear: both;
}
</code>```

stree is the div holding the jqtree.

When I populate it I get the following:

What I want is to have the top element of the tree aligned with the first element of the list.

I have tried setting vertical-align on the container and on the stree divs but haven't had any luck yet.

HTML/CSS is not my primary area of expertise so I am probably doing something stupid here.  But I would appreciate any help I can get.

答:
I tried the following css:

```<code>#container {
    width: 612px;
    margin: auto;
    border: 10px solid orange;
}
#authors {
    float: left;
    width: 200px;
    border-style: solid;
}
#stree {
    float: left;
    width: 400px;
    border-style: solid;
}
#clear {
    clear: both;
}
</code>```

It seems to work. It positions the tree next to the authors div.

Body:
I am trying to use jqtree in an Electron application.  I have been able to get it to do everything I need it to do.  However, I am running into a problem with positioning it on the window.

My index.html file looks like this:

And the relevant CSS is:

#container {
    display: inline-block;
    width: 610px;
    margin: auto;
    border: 10px solid orange''
}
#authors {
    float: left;
    width: 200px;
    border-style: solid;
}
#stree {
    width: 400px;
    margin-left: 210px;
    border-style: solid;
}
#clear {
    clear: both;
}

stree is the div holding the jqtree.

When I populate it I get the following:

What I want is to have the top element of the tree aligned with the first element of the list.

I have tried setting vertical-align on the container and on the stree divs but haven't had any luck yet.

HTML/CSS is not my primary area of expertise so I am probably doing something stupid here.  But I would appreciate any help I can get.

Body:
I tried the following css:

#container {
    width: 612px;
    margin: auto;
    border: 10px solid orange;
}
#authors {
    float: left;
    width: 200px;
    border-style: solid;
}
#stree {
    float: left;
    width: 400px;
    border-style: solid;
}
#clear {
    clear: both;
}

It seems to work. It positions the tree next to the authors div.


问:
Extract names from file in python
I'm dealing with a file where I want to extract the names and append them to a list. The names are formatted like this:

"Firstname LastnameAnotherfirstname Anotherlastname" etc...

I'm not an experienced programmer, therefore, I haven't got a lot of regex lingo in the back of my head so a little help would be much appreciated!

答:
Find name by Upper Case

```<code>import re

file_open = open('file_name.txt').read()
value = re.findall('[A-Z][a-z]*', file_open)
print(value)
</code>```

You get a list of name.

Title: Extract names from file in python

Body:
Find name by Upper Case

import re

file_open = open('file_name.txt').read()
value = re.findall('[A-Z][a-z]*', file_open)
print(value)

You get a list of name.


问:
Batch: Save multiple files with same extension but in another directory
I need to write a script that saves all the files processed by the batch at the same time, with the same extension (.P3D) but in another directory, I tried this but it did not work, please help me

bat1.bat:

```<code>set var=1 0
start cmd goto /k bat2
</code>```

bat2.bat

```<code>set src_folder=C:\Users\kaue9\Desktop\ResLodRemover\OriginalPlants2Trees
set dst_folder=C:\Users\kaue9\Desktop\ResLodRemover\teste

for /R %src_folder% %%f in (*.p3d) do ResLodRemover.exe %%f %dst_folder%\*.p3d %var%
</code>```

the problem is in     %dst_folder%, ty guys

答:
Best guess:

bat1.cmd

@SET "var=1 0"
@CALL "bat2.cmd" "%var%"
```

<p><strong>bat2.cmd</strong></p>

<pre class="lang-bat prettyprint-override"><code>@SET "src_folder=%UserProfile%\Desktop\ResLodRemover\OriginalPlants2Trees"
@SET "dst_folder=%UserProfile%\Desktop\ResLodRemover\teste"

@FOR /R "%src_folder%" %%A IN (*.p3d
) DO @ResLodRemover.exe "%%~A" "%dst_folder%\%%~nxA" %~1
</code>```

Body:
I need to write a script that saves all the files processed by the batch at the same time, with the same extension (.P3D) but in another directory, I tried this but it did not work, please help me

bat1.bat:

set var=1 0
start cmd goto /k bat2

bat2.bat

set src_folder=C:\Users\kaue9\Desktop\ResLodRemover\OriginalPlants2Trees
set dst_folder=C:\Users\kaue9\Desktop\ResLodRemover\teste

for /R %src_folder% %%f in (*.p3d) do ResLodRemover.exe %%f %dst_folder%\*.p3d %var%

the problem is in     %dst_folder%, ty guys

Body:
Best guess:

bat1.cmd

@SET "var=1 0"
@CALL "bat2.cmd" "%var%"

bat2.cmd

@SET "src_folder=%UserProfile%\Desktop\ResLodRemover\OriginalPlants2Trees"
@SET "dst_folder=%UserProfile%\Desktop\ResLodRemover\teste"

@FOR /R "%src_folder%" %%A IN (*.p3d
) DO @ResLodRemover.exe "%%~A" "%dst_folder%\%%~nxA" %~1