appassembler and long classpath

I am using maven appassembler to create my assembly. My classpath is too long and I get "The input line is too long." The suggestion here is to use booter windows platform, but I'm constrained to use Java Service Wrapper. Any way I can use java6 wildcarded classpath and java service wrapper?

Answers


Have you tried:

<useWildcardClassPath>true</useWildcardClassPath>

This solved the problem for me, however, if you arent already, you also need to make sure you are using:

<repositoryLayout>flat</repositoryLayout>

It seems that the answer is 'No', without writing a plugin or extending the existing plugin, which is not an 'answer' to the original question.


I'd suggest filing a bug in http://jira.codehaus.org/browse/MAPPASM to address it. I wrote the JSW integration and know it needs a bit more work.


You can also try flattening the directory structure of the repository (i.e. lib) directory. By default, the appassembler preserves the deep directory structure which can add unnecessary length to the classpath.

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>appassembler-maven-plugin</artifactId>
      <version>1.3.1</version>
      <configuration>
        <programs>
          <program>
            <mainClass>com.mycompany.app.MyApp</mainClass>
            <name>runMyApp</name>
          </program>
        </programs>
        <repositoryLayout>flat</repositoryLayout>
      </configuration>
    </plugin>
  </plugins>
</build>

As a long shot...

Having never worked with JSW, perhaps you could create your own assembly plugin based on the code at http://maven.apache.org/plugins/maven-assembly-plugin/source-repository.html and use it instead.


I have filed a JIRA issue here:

http://jira.codehaus.org/browse/MAPPASM-203

You can go and vote for it.


On the windows command prompt the maximum length of the string that you can use at the command prompt is 8191 characters.

So if your project has too many dependencies, then it will generate long classpath.

To overcome this situation maven-appassembler has provided option

Add these two lines under configuration section

<configuration>
    <repositoryLayout>flat</repositoryLayout>
    <useWildcardClassPath>true</useWildcardClassPath>
</configuration>

Documentation for these two options : (documentation)

useWildcardClassPath:

Sometimes it happens that you have many dependencies which means having a very long classpath, and becomes too long (in particular on Windows based platforms). This option can help in such situation. If you activate this option, your classpath contains only a classpath wildcard (REPO/*). But be aware that this works only in combination with Java 1.6 and above and with repositoryLayout flat.

repositoryLayout:

The layout of the generated Maven repository. Supported types - "default" (Maven2) | "legacy" (Maven1) | "flat" (flat lib/ style). The style "legacy" is only supported if you are running under Maven 2.2.1 and before.


Need Your Help

Oracle - select a specific column from a ref cursor

oracle stored-procedures cursor

I have a table named Table1. It has lots of columns, one of them is Column1. I don't know the other columns, they may even change sometimes. There is a strongly typed ref cursor type which returns ...

How to convert NSString to a date formattted string

ios objective-c nsdateformatter

I have string with value 01012016 which i want to show to user like 01-01-2016. For this, i am using the below code