Tuesday, December 2, 2008
Антран плагины: нельзя два в одном и как проверить проперть
Вот пример:
===\/=====================================
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>000</id>
<phase>clean</phase>
<configuration>
<tasks>
<echo>=== ECHO === [${project.build.directory}] ===</echo>
<echo>=== ECHO === 000 ===</echo>
<echo>=== ECHO === 000 ===</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>0</id>
<phase>clean</phase>
<configuration>
<tasks>
<echo>=== ECHO === [${project.build.directory}] ===</echo>
<echo>=== ECHO === 0 ===</echo>
<echo>=== ECHO === 0 ===</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
===/\=====================================
Результат работы:
[INFO] [clean:clean]
[INFO] [antrun:run {execution: 0}]
[INFO] Executing tasks
[echo] === ECHO === [/home/alexey/java/eXoProjects/portlet-container/trunk/applications/tck-tests/target] ===
[echo] === ECHO === 0 ===
[echo] === ECHO === 0 ===
[INFO] Executed tasks
Кстати, таким образом антран плагином можно проверить наличие системной проперти при помощи ECHO!
Затягиваем в Эклипс несобирающийся проект.
Всем привет!
1. Редактируем файл "pom.xml":
сразу за тегом "<build>" вставляем строки:
-------------------------------------
<sourceDirectory>src/nosources</sourceDirectory>
<testSourceDirectory>src/notest</testSourceDirectory>
-------------------------------------
2. Выполняем команду "mvn eclipse:eclipse"
можно использовать до этого mvn eclipse:clean
3. Редактируем файл ".classpath" на строки: <classpathentry kind="src" path="target/generated"/> <classpathentry excluding="**/*.java" including="**/*.xml" kind="src" <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> Потом фиксим уже в Эклипсе чего-там не собирается, при этом проверяем С уважением,
Сразу после тега " <classpath>" заменяем строки:
-------------------------------------
<classpathentry kind="src" path="src/main/java"
including="**/*.xml|**/*.xsl|**/*.properties|**/*.ion|**/*.conf|**/*.config
excluding="**/*.java"/>
<classpathentry kind="src" path="src/main/resources"
including="**/*.xml|**/*.xsl|**/*.properties|**/login.conf|**/*.ion|**/*.co
excluding="**/*.java"/>
<classpathentry kind="src" path="src/test/java"
output="target/test-classes"
including="**/*.properties|**/*.xml|**/*.txt|**/*.conf|**/*.config"
excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
-------------------------------------
-------------------------------------
<classpathentry kind="src" path="src/main/java"/>
path="src/main/resources"/>
-------------------------------------
билд с восстановленным файлом "pom.xml"
Алексей.
Monday, December 1, 2008
SAXParseException: Content is not allowed in prolog.
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:510)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:215)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:190)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:241)
at org.exoplatform.services.wsrp2.utils.StandardPayload.getUnmarshalledObject(StandardPayload.java:95)
at org.exoplatform.services.wsrp2.utils.StandardClasses.getUnmarshalledObject(StandardClasses.java:71)
at org.exoplatform.services.wsrp2.utils.JAXBEventTransformer.getUnmarshalledObject(JAXBEventTransformer.java:254)
at org.exoplatform.services.wsrp2.utils.JAXBEventTransformer.getEventsUnmarshal(JAXBEventTransformer.java:132)
at org.exoplatform.services.wsrp2.consumer.impl.WSRPConsumerPlugin.processAction(WSRPConsumerPlugin.java:745)
Where not a consistent xml to unmarshal.
Первый параметр должен быть репрезентацией валидного хмл.
| unmarshal(Node node, Class |
JAXBElement