Maven errors question [message #1060731] |
Tue, 28 May 2013 09:30 |
|
Hello folks
I was wondering if I could get some help with my maven setup?
I have been using this example as my base for building my maven setup, but since I only need the jar file and not a compilation I have modded the mydsl pom file.
When I extract it in eclipse as runnable jar with the option "Package required libraries into generated Jar" everything works fine, but when I build and run the jar with maven I get the following errors:
----------------------ERROR--------------------------------------
log4j:WARN No appenders could be found for logger (org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.eclipse.emf.common.util.WrappedException: java.lang.StringIndexOutOfBoundsException:
String index out of range: 369
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:182)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:135
)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:11
4)
at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:510)
at org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:154)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:67)
at idainfront.iipax.dsl.generator.Generator.runGenerator(Generator.java:42)
at idainfront.iipax.dsl.generator.Main.main(Main.java:32)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 369
at java.lang.String.substring(Unknown Source)
at org.eclipse.xtext.nodemodel.impl.AbstractNode.getText(AbstractNode.java:95)
at org.eclipse.xtext.nodemodel.util.NodeModelUtils.getTokenText(NodeModelUtils.java:373)
at org.eclipse.xtext.linking.impl.LinkingHelper.getCrossRefNodeAsString(LinkingHelper.java:51)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getCrossRefNodeAsString(DefaultLinkingService.java:1
39)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:115)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:198)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
... 7 more
I don't really know what files may help you I thought atleast I might post the pom for this file and the mydsl (which is iidsl for me) projects.
Generator pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>idainfront.iipax.maven</groupId>
<artifactId>idainfront.iipax.dsl.parent</artifactId>
<!-- You should change this and the MANIFEST.MF to your versioning scheme -->
<version>1.0.0-SNAPSHOT</version>
<relativePath>../idainfront.iipax.dsl.parent/pom.xml</relativePath>
</parent>
<artifactId>idainfront.iipax.dsl.generator</artifactId>
<packaging>jar</packaging>
<name>idainfront.iipax.dsl.IiDsl - Generator</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<forceCreation>true</forceCreation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>idainfront.iipax.dsl.generator.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>idainfront.iipax.maven</groupId>
<artifactId>idainfront.iipax.dsl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>idainfront.iipax.maven</groupId>
<artifactId>idainfront.iipax.dsl.standalone</artifactId>
<classifier>repackaged</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
</dependencies>
</project>
IiDSL pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>idainfront.iipax.maven</groupId>
<artifactId>idainfront.iipax.dsl.parent</artifactId>
<!-- You should change this and the MANIFEST.MF to your versioning scheme -->
<version>1.0.0-SNAPSHOT</version>
<relativePath>../idainfront.iipax.dsl.parent/pom.xml</relativePath>
</parent>
<artifactId>idainfront.iipax.dsl</artifactId>
<packaging>eclipse-plugin</packaging>
<name>idainfront.iipax.dsl.IiDsl - Grammar</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<!-- Do not clean the src-gen folder, therefore we remove all paths from
the default configuration in the parent pom. Note the combine.self="override"
statement -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration combine.self="override">
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Hmm... might as well ask, but since I only want to compile a jar file from my main class which turns my dsl file into an xml file by using the generator, do I need to build all the projects they have in the xtext-maven-example or can I simplify it?
(Cinda new to maven )
Thanks for any help
Write you later / Mårten
|
|
|
|
Re: Maven errors question [message #1060737 is a reply to message #1060735] |
Tue, 28 May 2013 09:49 |
|
Hi,
I should probably have mentioned it. But I did stumble over it, fell quite hard and no wiser when I got up
I tried to remove the log4j and repackage them in the standalone but it didn't seem to help.
I guess I missed something so will look into it again.
Well, sorry for taking your time if the answer already was here
Write you later / Mårten
|
|
|
|
Re: Maven errors question [message #1060741 is a reply to message #1060740] |
Tue, 28 May 2013 10:09 |
|
Hi,
meh! Sorry for taking up your time. Seems I forgot to fix in the repackage.xml file.
Now I only have the log4j warning but... since it compiles I will take that when I have more time
Sorry again, its like when you ask the teacher about something and just as you ask you find the answer.
Well, at least people here have good patience with me
Have a good day
Write you later / Mårten
|
|
|
Powered by
FUDForum. Page generated in 0.02239 seconds